For the complete documentation index, see llms.txt. This page is also available as Markdown.

CREATE METRICS INTEGRATION

Syntax

CREATE METRICS INTEGRATION 
    metrics_integration_name 
WITH (metrics_integration_parameter = value [, ... ]);

Description

Metrics integrations make it possible for organizations to configure an integration that enables scraping of query metrics.

Arguments

metrics_integration_name

Specifies the name of the new metrics integration. If the name is case-sensitive, you must wrap it in double quotes; otherwise, the system uses the lower case name.

token.expires_in_days

Number of days that this token is valid for. Default: 90 days.

metrics

Optionally selects standard metrics to export. Provide a comma-separated list of metric names. Names are case-insensitive.

Supported values are numRecordsInPerSecond, numRecordsOutPerSecond, numBytesInPerSecond, numBytesOutPerSecond, and consumerRecordsLagMax.

Omit this property to export all standard metrics.

aggregation_levels

Controls the metric output levels. Provide a comma-separated list of lowercase values: raw, query, or task.

The default is raw. Select any combination of raw, query, and task, including all three.

The query and task levels return recorded aggregate metrics instead of raw operator samples. This can reduce samples returned by the /metrics endpoint. Use aggregation_types to select the aggregate values to export.

aggregation_types

Controls aggregate values for query and task levels. Provide a comma-separated list of lowercase values: avg, min, max, sum, or count.

This property is required when selecting query or task. It does not apply to raw metrics.

Examples

Create a metrics integration

The following creates a new metrics integration named my-integration. It exports raw metrics and is valid for AWS us-east-1:

Export query and task aggregates

The following exports average and maximum lag metrics at query and task levels:

This integration exports these recorded metric families:

  • consumerRecordsLagMax:query:avg

  • consumerRecordsLagMax:query:max

  • consumerRecordsLagMax:task:avg

  • consumerRecordsLagMax:task:max

The command will output a URI and token you can add as a metric endpoint in Prometheus in Grafana. See Guide to Add Metrics Integration to Prometheus for more information. If you have an active query you can test the URI and token with the following curl command. Use the URI from CREATE METRICS INTEGRATION output:

Example aggregate output

For the lag_alert integration, the endpoint returns recorded query and task aggregates like these:

Query aggregates retain organization_id and query_id. Task aggregates also retain task_name. query_name and query_version appear when available. Values and timestamps depend on the recorded series. Missing recorded series produce no samples.

Example raw output

If there's a query running the output of the above curl should look like:

Guide to Add Metrics Integration to Prometheus

Prometheus Integration

Last updated