Retrieves Workers KV request metrics for the given account.
/accounts/{account_identifier}/storage/analytics
get
Workers KV Request Analytics
workers-kv-request-analytics-query-request-analytics
null null [
{
"in": "path",
"name": "account_identifier",
"required": true,
"schema": {
"description": "Identifier",
"example": "023e105f4ecef8ad9ca31a8372d0c353",
"maxLength": 32,
"readOnly": true,
"type": "string"
}
},
{
"in": "query",
"name": "query",
"schema": {
"allOf": [
{
"description": "For specifying result metrics.",
"properties": {
"dimensions": {
"default": "[]",
"description": "Can be used to break down the data by given attributes.",
"items": {
"description": "For drilling down on metrics.",
"type": "string"
},
"type": "array"
},
"filters": {
"default": "\"\"",
"description": "Used to filter rows by one or more dimensions. Filters can be combined using OR and AND boolean logic. AND takes precedence over OR in all the expressions. The OR operator is defined using a comma (,) or OR keyword surrounded by whitespace. The AND operator is defined using a semicolon (;) or AND keyword surrounded by whitespace. Note that the semicolon is a reserved character in URLs (rfc1738) and needs to be percent-encoded as %3B. Comparison options are: \n\nOperator | Name | URL Encoded\n--------------------------|---------------------------------|--------------------------\n== | Equals | %3D%3D\n!= | Does not equals | !%3D\n> | Greater Than | %3E\n< | Less Than | %3C\n>= | Greater than or equal to | %3E%3D\n<= | Less than or equal to | %3C%3D .",
"type": "string"
},
"limit": {
"default": 10000,
"description": "Limit number of returned metrics.",
"type": "integer"
},
"metrics": {
"description": "One or more metrics to compute.",
"items": {
"description": "A quantitative measurement of KV usage.",
"type": "string"
},
"type": "array"
},
"since": {
"default": "<6 hours ago>",
"description": "Start of time interval to query, defaults to 6 hours before request received.",
"example": "2019-01-02T02:20:00Z",
"format": "date-time",
"type": "string"
},
"sort": {
"default": "[]",
"description": "Array of dimensions or metrics to sort by, each dimension/metric may be prefixed by - (descending) or + (ascending).",
"items": {},
"type": "array"
},
"until": {
"default": "<now>",
"description": "End of time interval to query, defaults to current time.",
"example": "2019-01-02T03:20:00Z",
"format": "date-time",
"type": "string"
}
},
"type": "object"
},
{
"properties": {
"dimensions": {
"example": [
"accountId",
"responseCode"
],
"items": {
"enum": [
"accountId",
"responseCode",
"requestType"
]
}
},
"filters": {
"example": "requestType==read AND responseCode!=200"
},
"metrics": {
"default": "[\"requests\"]",
"example": [
"requests",
"readKiB"
],
"items": {
"enum": [
"requests",
"writeKiB",
"readKiB"
]
}
},
"sort": {
"example": [
"+requests",
"-responseCode"
]
}
}
}
]
}
}
] null {
"200": {
"content": {
"application/json": {
"schema": {
"allOf": [
{
"allOf": [
{
"properties": {
"errors": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"messages": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"result": {
"anyOf": [
{
"type": "object"
},
{
"items": {},
"type": "array"
},
{
"type": "string"
}
]
},
"success": {
"description": "Whether the API call was successful",
"enum": [
true
],
"example": true,
"type": "boolean"
}
},
"required": [
"success",
"errors",
"messages",
"result"
],
"type": "object"
},
{
"properties": {
"result": {
"anyOf": [
{
"type": "object"
},
{
"type": "string"
}
]
}
}
}
],
"type": "object"
},
{
"properties": {
"result": {
"allOf": [
{
"description": "Metrics on Workers KV requests.",
"properties": {
"data": {
"items": {
"properties": {
"metrics": {
"description": "List of metrics returned by the query.",
"items": {},
"type": "array"
}
},
"required": [
"metrics"
],
"type": "object"
},
"nullable": true,
"type": "array"
},
"data_lag": {
"description": "Number of seconds between current time and last processed event, i.e. how many seconds of data could be missing.",
"example": 0,
"minimum": 0,
"type": "number"
},
"max": {
"description": "Maximum results for each metric."
},
"min": {
"description": "Minimum results for each metric."
},
"query": {
"description": "For specifying result metrics.",
"properties": {
"dimensions": {
"default": "[]",
"description": "Can be used to break down the data by given attributes.",
"items": {
"description": "For drilling down on metrics.",
"type": "string"
},
"type": "array"
},
"filters": {
"default": "\"\"",
"description": "Used to filter rows by one or more dimensions. Filters can be combined using OR and AND boolean logic. AND takes precedence over OR in all the expressions. The OR operator is defined using a comma (,) or OR keyword surrounded by whitespace. The AND operator is defined using a semicolon (;) or AND keyword surrounded by whitespace. Note that the semicolon is a reserved character in URLs (rfc1738) and needs to be percent-encoded as %3B. Comparison options are: \n\nOperator | Name | URL Encoded\n--------------------------|---------------------------------|--------------------------\n== | Equals | %3D%3D\n!= | Does not equals | !%3D\n> | Greater Than | %3E\n< | Less Than | %3C\n>= | Greater than or equal to | %3E%3D\n<= | Less than or equal to | %3C%3D .",
"type": "string"
},
"limit": {
"default": 10000,
"description": "Limit number of returned metrics.",
"type": "integer"
},
"metrics": {
"description": "One or more metrics to compute.",
"items": {
"description": "A quantitative measurement of KV usage.",
"type": "string"
},
"type": "array"
},
"since": {
"default": "<6 hours ago>",
"description": "Start of time interval to query, defaults to 6 hours before request received.",
"example": "2019-01-02T02:20:00Z",
"format": "date-time",
"type": "string"
},
"sort": {
"default": "[]",
"description": "Array of dimensions or metrics to sort by, each dimension/metric may be prefixed by - (descending) or + (ascending).",
"items": {},
"type": "array"
},
"until": {
"default": "<now>",
"description": "End of time interval to query, defaults to current time.",
"example": "2019-01-02T03:20:00Z",
"format": "date-time",
"type": "string"
}
},
"type": "object"
},
"rows": {
"description": "Total number of rows in the result.",
"example": 2,
"minimum": 0,
"type": "number"
},
"totals": {
"description": "Total results for metrics across all data."
}
},
"required": [
"rows",
"data",
"data_lag",
"min",
"max",
"totals",
"query"
],
"type": "object"
},
{
"properties": {
"data": {
"example": [
{
"metrics": [
[
2,
4
],
[
16,
32
]
]
}
]
},
"max": {
"example": {
"readKiB": 32,
"requests": 4
}
},
"min": {
"example": {
"readKiB": 16,
"requests": 2
}
},
"query": {
"description": "For specifying result metrics.",
"properties": {
"dimensions": {
"default": "[]",
"description": "Can be used to break down the data by given attributes.",
"items": {
"description": "For drilling down on metrics.",
"type": "string"
},
"type": "array"
},
"filters": {
"default": "\"\"",
"description": "Used to filter rows by one or more dimensions. Filters can be combined using OR and AND boolean logic. AND takes precedence over OR in all the expressions. The OR operator is defined using a comma (,) or OR keyword surrounded by whitespace. The AND operator is defined using a semicolon (;) or AND keyword surrounded by whitespace. Note that the semicolon is a reserved character in URLs (rfc1738) and needs to be percent-encoded as %3B. Comparison options are: \n\nOperator | Name | URL Encoded\n--------------------------|---------------------------------|--------------------------\n== | Equals | %3D%3D\n!= | Does not equals | !%3D\n> | Greater Than | %3E\n< | Less Than | %3C\n>= | Greater than or equal to | %3E%3D\n<= | Less than or equal to | %3C%3D .",
"type": "string"
},
"limit": {
"default": 10000,
"description": "Limit number of returned metrics.",
"type": "integer"
},
"metrics": {
"description": "One or more metrics to compute.",
"items": {
"description": "A quantitative measurement of KV usage.",
"type": "string"
},
"type": "array"
},
"since": {
"default": "<6 hours ago>",
"description": "Start of time interval to query, defaults to 6 hours before request received.",
"example": "2019-01-02T02:20:00Z",
"format": "date-time",
"type": "string"
},
"sort": {
"default": "[]",
"description": "Array of dimensions or metrics to sort by, each dimension/metric may be prefixed by - (descending) or + (ascending).",
"items": {},
"type": "array"
},
"until": {
"default": "<now>",
"description": "End of time interval to query, defaults to current time.",
"example": "2019-01-02T03:20:00Z",
"format": "date-time",
"type": "string"
}
},
"type": "object"
},
"totals": {
"example": {
"readKiB": 48,
"requests": 6
}
}
}
}
]
}
},
"type": "object"
}
]
}
}
},
"description": "Query Request Analytics response"
},
"4XX": {
"content": {
"application/json": {
"schema": {
"allOf": [
{
"allOf": [
{
"allOf": [
{
"properties": {
"errors": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"messages": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"result": {
"anyOf": [
{
"type": "object"
},
{
"items": {},
"type": "array"
},
{
"type": "string"
}
]
},
"success": {
"description": "Whether the API call was successful",
"enum": [
true
],
"example": true,
"type": "boolean"
}
},
"required": [
"success",
"errors",
"messages",
"result"
],
"type": "object"
},
{
"properties": {
"result": {
"anyOf": [
{
"type": "object"
},
{
"type": "string"
}
]
}
}
}
],
"type": "object"
},
{
"properties": {
"result": {
"description": "Metrics on Workers KV requests.",
"properties": {
"data": {
"items": {
"properties": {
"metrics": {
"description": "List of metrics returned by the query.",
"items": {},
"type": "array"
}
},
"required": [
"metrics"
],
"type": "object"
},
"nullable": true,
"type": "array"
},
"data_lag": {
"description": "Number of seconds between current time and last processed event, i.e. how many seconds of data could be missing.",
"example": 0,
"minimum": 0,
"type": "number"
},
"max": {
"description": "Maximum results for each metric."
},
"min": {
"description": "Minimum results for each metric."
},
"query": {
"description": "For specifying result metrics.",
"properties": {
"dimensions": {
"default": "[]",
"description": "Can be used to break down the data by given attributes.",
"items": {
"description": "For drilling down on metrics.",
"type": "string"
},
"type": "array"
},
"filters": {
"default": "\"\"",
"description": "Used to filter rows by one or more dimensions. Filters can be combined using OR and AND boolean logic. AND takes precedence over OR in all the expressions. The OR operator is defined using a comma (,) or OR keyword surrounded by whitespace. The AND operator is defined using a semicolon (;) or AND keyword surrounded by whitespace. Note that the semicolon is a reserved character in URLs (rfc1738) and needs to be percent-encoded as %3B. Comparison options are: \n\nOperator | Name | URL Encoded\n--------------------------|---------------------------------|--------------------------\n== | Equals | %3D%3D\n!= | Does not equals | !%3D\n> | Greater Than | %3E\n< | Less Than | %3C\n>= | Greater than or equal to | %3E%3D\n<= | Less than or equal to | %3C%3D .",
"type": "string"
},
"limit": {
"default": 10000,
"description": "Limit number of returned metrics.",
"type": "integer"
},
"metrics": {
"description": "One or more metrics to compute.",
"items": {
"description": "A quantitative measurement of KV usage.",
"type": "string"
},
"type": "array"
},
"since": {
"default": "<6 hours ago>",
"description": "Start of time interval to query, defaults to 6 hours before request received.",
"example": "2019-01-02T02:20:00Z",
"format": "date-time",
"type": "string"
},
"sort": {
"default": "[]",
"description": "Array of dimensions or metrics to sort by, each dimension/metric may be prefixed by - (descending) or + (ascending).",
"items": {},
"type": "array"
},
"until": {
"default": "<now>",
"description": "End of time interval to query, defaults to current time.",
"example": "2019-01-02T03:20:00Z",
"format": "date-time",
"type": "string"
}
},
"type": "object"
},
"rows": {
"description": "Total number of rows in the result.",
"example": 2,
"minimum": 0,
"type": "number"
},
"totals": {
"description": "Total results for metrics across all data."
}
},
"required": [
"rows",
"data",
"data_lag",
"min",
"max",
"totals",
"query"
],
"type": "object"
}
},
"type": "object"
}
]
},
{
"properties": {
"errors": {
"allOf": [
{
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
}
],
"example": [
{
"code": 7003,
"message": "No route for the URI"
}
],
"minLength": 1
},
"messages": {
"allOf": [
{
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
}
],
"example": []
},
"result": {
"enum": [
null
],
"nullable": true,
"type": "object"
},
"success": {
"description": "Whether the API call was successful",
"enum": [
false
],
"example": false,
"type": "boolean"
}
},
"required": [
"success",
"errors",
"messages",
"result"
],
"type": "object"
}
]
}
}
},
"description": "Query Request Analytics response failure"
}
} [
{
"api_token": []
},
{
"api_email": [],
"api_key": []
}
]