Metrics Aggregation API
Read, configure and clear streaming metric aggregation.
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 aggregation configuration. Reading the saved or default configuration requires backend access but does not require Admin permissions.
The configuration example uses jq; install it before running the example. It builds the JSON request body from a readable configuration file.
Endpoints
GET
/api/aggregations/v1/metrics/config
Read the saved configuration.
GET
/api/aggregations/v1/metrics/config/default
Read the default configuration.
POST
/api/aggregations/v1/metrics/config
Admin required. Write configuration (HTTP 201).
PUT
/api/aggregations/v1/metrics/config
Admin required. Replace configuration (HTTP 200).
DELETE
/api/aggregations/v1/metrics/config
Admin required. Clear custom configuration (HTTP 200).
Read configuration
curl --request GET 'https://api.groundcover.com/api/aggregations/v1/metrics/config' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'X-Backend-Id: <YOUR_BACKEND_ID>'curl --request GET 'https://api.groundcover.com/api/aggregations/v1/metrics/config/default' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'X-Backend-Id: <YOUR_BACKEND_ID>'The saved-configuration response contains uuid, created_by, created_timestamp, and value; no saved configuration returns HTTP 204. The defaults endpoint returns {"value": "..."}.
Append | jq -r '.value' to either GET command to print the configuration text with its original line breaks.
Configure aggregation
POST and PUT require an outer JSON request body with a value string. The server parses that string as YAML; JSON configuration text is also accepted by this parser. The configuration's content field is itself a string containing YAML or JSON stream aggregation rules. In the example below, YAML's | block keeps those rules readable. Other configuration fields include keepInput, dropInput, dropInputLabels, dedupInterval, ignoreOldSamples, ignoreFirstIntervals, enableWindows, keepMetricNames, noAlignFlushToInterval, and flushOnShutdown.
This example keeps the original input series and additionally aggregates an example counter by service. Replace the full configuration only after preserving any existing rules you need.
keepInput controls retaining samples that match aggregation rules; dropInput controls dropping unmatched samples. Review both when changing storage behavior. Invalid or uncompilable aggregation rules return HTTP 400.
Clear custom configuration
The response is HTTP 200 with no body. To understand aggregation configuration and its effect on ingested metrics, see Metrics Aggregation.
Last updated
