Konnect Metrics Endpoint (4.0.0)

Download OpenAPI specification:Download

Konnect endpoint for extracting and computing metrics, similar to the data that is used to build graphs in Konnect Advanced Analytics. This endpoint is used to query the Advanced Analytics platform for aggregated metrics down to ten seconds for recent data. Data can be requested to group by any 2 dimensions, up to 3 metrics and any number of filter conditions in 1 query.

Important Considerations:

  • This endpoint is only available for Konnect Advanced Analytics.
  • The time range for the query must be within the last 32 days, otherwise a 400 error will be returned.
  • The time range you request may be adjusted slightly to avoid returning buckets that contain only partial information. For instance:
    • You request data for the last 24 hours with hourly intervals.
    • The current time is Tuesday at 10:40 AM.
    • The query will return data starting from Monday at 10:00 AM up to Tuesday at 10:40 AM.
    • The returned data will include complete hourly buckets (10:00 AM, 11:00 AM, etc.), but the last hour for Tuesday at 10:00 AM will only contain 40 minutes of data since it’s not yet complete. This means the total duration is actually 24 hours and 40 minutes.
    • The exact start and end times can be found in the results under meta.start and meta.end.
  • For queries that use the time dimension, the granularity of the result may be coarser than requested. The finest allowed granularity depends on the query's time range: data farther in the past may have coarser granularity. The exact result granularity will be reported in the response meta.granularity_ms field.
  • Queries must complete within 10 seconds. If a query takes longer than 10 seconds, a 408 will be returned. In this case, it is suggested to add more filters, and/or reduce the time range.
  • This endpoint is rate limited to 10 requests per minute per user.
  • Must at least have the Analytics Viewer permission to use this endpoint.

Metrics

Query metrics in the advanced analytics platform

Post a query to the endpoint to retrieve aggregated metrics down to the minute. Data can be requested to group by any 2 dimensions, and any number of filter conditions.

Request Body schema: application/json
metrics
required
Array of strings <= 3 items
Items Enum: "kong_latency_average" "kong_latency_p50" "kong_latency_p95" "kong_latency_p99" "request_count" "request_per_minute" "request_size_average" "request_size_p50" "request_size_p95" "request_size_p99" "request_size_sum" "response_latency_average" "response_latency_p50" "response_latency_p95" "response_latency_p99" "response_size_average" "response_size_p50" "response_size_p95" "response_size_p99" "response_size_sum" "upstream_latency_average" "upstream_latency_p50" "upstream_latency_p95" "upstream_latency_p99"

List of aggregated metrics to collect across the requested time span. If no metrics are specified, request_count will be computed by default.

dimensions
Array of strings <= 2 items
Items Enum: "api_product" "api_product_version" "application" "consumer" "control_plane" "control_plane_group" "data_plane_node" "data_plane_node_version" "gateway_service" "response_source" "route" "status_code" "status_code_grouped" "time" "upstream_status_code" "upstream_status_code_grouped"

List of attributes or entity types to group by.

Array of (MetricsApiProductFilterByField (Multiselect filters (object) or Empty filters (object))) or (MetricsApiProductVersionFilterByField (Multiselect filters (object) or Empty filters (object))) or (MetricsApplicationFilterByField (Multiselect filters (object) or Empty filters (object))) or (MetricsConsumerFilterByField (Multiselect filters (object) or Empty filters (object))) or (MetricsControlPlaneFilterByField (Multiselect filters (object) or Empty filters (object))) or (MetricsControlPlaneGroupFilterByField (Multiselect filters (object) or Empty filters (object))) or (MetricsDataPlaneNodeFilterByField (Multiselect filters (object) or Empty filters (object))) or (MetricsDataPlaneNodeVersionFilterByField (Multiselect filters (object) or Empty filters (object))) or (MetricsGatewayServiceFilterByField (Multiselect filters (object) or Empty filters (object))) or (MetricsResponseSourceFilterByField (Multiselect filters (object) or Empty filters (object))) or (MetricsRouteFilterByField (Multiselect filters (object) or Empty filters (object))) or (MetricsStatusCodeFilterByField (Multiselect filters (object) or Empty filters (object))) or (MetricsStatusCodeGroupedFilterByField (Multiselect filters (object) or Empty filters (object))) or (MetricsUpstreamStatusCodeFilterByField (Multiselect filters (object) or Empty filters (object))) or (MetricsUpstreamStatusCodeGroupedFilterByField (Multiselect filters (object) or Empty filters (object)))

A list of filters to apply to the query.

granularity
string
Enum: "tenSecondly" "thirtySecondly" "minutely" "fiveMinutely" "tenMinutely" "thirtyMinutely" "hourly" "twoHourly" "twelveHourly" "daily" "weekly"

Force time grouping into buckets of the specified duration. Only has an effect if "time" is in the "dimensions" list.

The granularity of the result may be coarser than requested. The finest allowed granularity depends on the query's time range: data farther in the past may have coarser granularity. The exact result granularity will be reported in the response meta.granularity_ms field.

If granularity is not specified and "time" is in the dimensions list, a default will be chosen based on the time range requested.

Different relative times support different granularities:

  • 15m => tenSecondly, thirtySecondly, minutely
  • 1h => tenSecondly, thirtySecondly, minutely, fiveMinutely, tenMinutely
  • 6h => thirtySecondly, minutely, fiveMinutely, tenMinutely, thirtyMinutely, hourly
  • 12h => minutely, fiveMinutely, tenMinutely, thirtyMinutely, hourly
  • 24h => fiveMinutely, tenMinutely, thirtyMinutely, hourly
  • 7d => thirtyMinutely, hourly, twoHourly, twelveHourly, daily
  • 30d => hourly, twoHourly, twelveHourly, daily, weekly

For special time ranges:

  • current_week, previous_week => thirtyMinutely, hourly, twoHourly, twelveHourly, daily
  • current_month, previous_month => hourly, twoHourly, twelveHourly, daily, weekly

For absolute time ranges, daily will be used.

any
Default: {"type":"relative","time_range":"1h"}

The time range to query.

Responses

Request samples

Content type
application/json
{
  • "time_range": {
    },
  • "dimensions": [
    ],
  • "filters": [
    ],
  • "granularity": "hourly",
  • "metrics": [
    ]
}

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}