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

Metric Pipelines API

Manage metric relabeling rules through the API.

Authentication and permissions

Use an API key in Authorization: Bearer <YOUR_API_KEY> and select the backend with X-Backend-Id: <YOUR_BACKEND_ID>. Use your own API base URL for a self-hosted deployment.

Admin required: creating, replacing or clearing the pipeline configuration. Reading configuration requires backend access but does not require Admin permissions.

Endpoints

GET, POST, PUT, and DELETE use /api/pipelines/v1/metrics/config. POST, PUT and DELETE require Admin permissions; GET requires backend access.

Request body

POST and PUT accept a JSON rules object. Unlike log and trace pipelines, this API does not use a value string.

Field within rules

Type

Description

keepRegex

array of strings

Keep metric names matching the configured regular expressions.

dropRegex

array of strings

Drop matching metric names.

addLabel

object

Label names mapped to string values to add.

removeLabel

array of strings

Labels to remove.

raw

string

Advanced relabeling rules as YAML or JSON text, embedded in the JSON request.

These rules operate on incoming metric series. Keep/drop rules use __name__ as their default source label. Writes replace the complete configuration; save the existing response and retain needed rules.

Read and update

curl --request GET 'https://api.groundcover.com/api/pipelines/v1/metrics/config' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'X-Backend-Id: <YOUR_BACKEND_ID>'

A successful GET or PUT returns HTTP 200 with uuid, created_by, created_timestamp, and rules. GET returns HTTP 204 if no configuration exists. POST accepts the same body and returns HTTP 201. Invalid relabeling configuration returns HTTP 400.

Advanced relabeling rules

For rules.raw, keep the relabeling list in a readable YAML file and use jq to embed it as a JSON string. This example requires jq. The outer HTTP body remains JSON; only the raw string is parsed as YAML or JSON.

This example sets the same pipeline label as the structured example above. Include any other rules you want to retain before replacing the configuration.

To display saved raw rules with their original line breaks, append | jq -r '.rules.raw // empty' to the GET command.

Delete

HTTP 200 with no body indicates the dynamic configuration was cleared. This affects future ingestion; previously stored samples are not rewritten.

See also Metrics Aggregation API.

Last updated