Konnect Metrics Endpoint

v4.0.0OAS 3.0

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.
API Base URL
  • Server 1:https://us.api.konghq.com/v1[Konnect Metrics Endpoint]

    United-States Production region

  • Server 2:https://eu.api.konghq.com/v1[Konnect Metrics Endpoint]

    Europe Production region

  • Server 3:https://au.api.konghq.com/v1[Konnect Metrics Endpoint]

    Australia Production region

  • Server 4:https://me.api.konghq.com/v1[Konnect Metrics Endpoint]

    Middle-East Production region

  • Server 5:https://in.api.konghq.com/v1[Konnect Metrics Endpoint]

    India Production region

Additional Information
Contact Kong

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.

post

Body

application/json

MetricsV2Dto

A query to launch at the API

metricsarray[string]required

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

Allowed values:kong_latency_averagekong_latency_p50kong_latency_p95kong_latency_p99request_countrequest_per_minuterequest_size_averagerequest_size_p50request_size_p95request_size_p99request_size_sumresponse_latency_averageresponse_latency_p50response_latency_p95response_latency_p99response_size_averageresponse_size_p50response_size_p95response_size_p99response_size_sumupstream_latency_averageupstream_latency_p50upstream_latency_p95upstream_latency_p99

<= 3 items

Example:["request_count"]

dimensionsarray[string]

List of attributes or entity types to group by.

Allowed values:api_productapi_product_versionapplicationconsumercontrol_planecontrol_plane_groupdata_plane_nodedata_plane_node_versiongateway_serviceresponse_sourceroutestatus_codestatus_code_groupedtimeupstream_status_codeupstream_status_code_grouped

<= 2 items

Example:["status_code_grouped"]

filtersOne Of
array

A list of filters to apply to the query.

Filter by api_productOne Of
Multiselect filtersobject
Show Child Parameters
granularitystring

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.

Allowed values:tenSecondlythirtySecondlyminutelyfiveMinutelytenMinutelythirtyMinutelyhourlytwoHourlytwelveHourlydailyweekly

time_rangeOne Of

The time range to query.

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

MetricsRelativeTimeRangeDtoV2object

A duration representing a relative-to-now span of time. Generally the start time is floored to the requested granularity. Eg 7d from now, with 1day granularity initiated at 2024-01-08T17:11:00+05:00 will query for the time range from 2024-01-01T00:00:00+05:00 to 2024-01-08T17:11:00+05:00. The exact start and end timestamps are returned in the result query in the meta.start and meta.end fields. If the granularity for the previous query was 1hour, it would query a time range from 2024-01-01T17:00:00+05:00 to 2024-01-08T17:11:00+05:00.

Show Child Parameters

Response

application/json

Aggregated results of the query

MetricsResultV2

The result of a metrics query. Contains the data and metadata about the query.

dataarray[object]required

A result with metrics grouped by the dimensions specified in the query, at a particular time

The example represents a result group that has a summed request_count, and response_latency_p99 for a gateway_service at 2024-01-16T00:00:00Z.

Example:{"event":{"gateway_service":"d5ac5d88-efed-4e10-9dfe-0b0a6646c219:bf16907c-8673-4f9d-aa83-1f2ea9215055","request_count":1000,"response_latency_p99":23},"timestamp":"2024-01-16T00:00:00Z"}

Show Child Parameters
metaobjectrequired

Metadata about the query response. This includes the start and end times of the query, the granularity of the result, whether the result was truncated, the limit of the result, and the query_id.

Example:{"start":"2024-01-16T18:00:00.000Z","end":"2024-01-16T18:16:40.000Z","display":{"gateway_service":{"d5ac5d88-efed-4e10-9dfe-0b0a6646c219:bf16907c-8673-4f9d-aa83-111111111111":{"id":"d5ac5d88-efed-4e10-9dfe-0b0a6646c219:bf16907c-8673-4f9d-aa83-111111111111","deleted":true,"name":"Gateway Service Alpha"},"d5ac5d88-efed-4e10-9dfe-0b0a6646c219:bf16907c-8673-4f9d-aa83-1f2ea9215055":{"id":"d5ac5d88-efed-4e10-9dfe-0b0a6646c219:bf16907c-8673-4f9d-aa83-1f2ea9215055","deleted":false,"name":"Gateway Service Beta"}}},"metric_units":{"request_count":"count","response_latency_p99":"ms"},"granularity_ms":60000,"truncated":false,"limit":50,"query_id":"requested-query-id"}

Show Child Parameters
post/metrics

Body

{
"time_range": {
"type": "relative",
"time_range": "24h",
"tz": "EST"
},
"dimensions": [
"time",
"gateway_service"
],
"filters": [
{
"operator": "in",
"field": "control_plane",
"value": [
"d5ac5d88-efed-4e10-9dfe-0b0a6646c219"
]
}
],
"granularity": "hourly",
"metrics": [
"request_count",
"response_latency_p99"
]
}
 
application/json