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

Trace Pipelines API

Manage pipeline rules, simulate transformations, and inspect processing statistics.

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, simulating rules and querying statistics require backend access but do not require Admin permissions.

The configuration and simulation examples use jq; install it before running them. It builds the JSON request body from a readable configuration file.

Endpoints

Method
Endpoint
Purpose

GET

/api/pipelines/traces/config

Read the current configuration.

POST

/api/pipelines/traces/config

Admin required. Write configuration; returns HTTP 201.

PUT

/api/pipelines/traces/config

Admin required. Replace configuration; returns HTTP 200.

DELETE

/api/pipelines/traces/config

Admin required. Clear the configured rules; returns HTTP 200.

POST

/api/pipelines/traces/simulate

Test rules against a supplied record without saving.

POST

/api/pipelines/traces/stats

Query processing statistics, optionally for a configuration ID.

POST

/api/pipelines/traces/current-stats

Query statistics for the current pipeline.

Read configuration

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

The response contains uuid, created_by, created_timestamp, and value. value is the configuration text, not a nested JSON object. If there is no configuration, the endpoint returns HTTP 204 with no body.

For a readable view of a saved configuration, append | jq -r '.value' to the GET command. This prints the string with its original line breaks.

Create or replace configuration

Both 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. Rule names must be nonempty and unique. Unknown configuration fields and invalid OTTL statements are rejected with HTTP 400.

Read and save the current configuration before replacing it. A write replaces the complete rule list; it does not append or merge individual rules. Preserve any existing rules you want to keep.

Use POST with the same body to write configuration with a 201 response. Successful writes return the same metadata and value structure as GET.

Simulate rules

Simulation does not modify the saved pipeline. Its outer request body is JSON, and ruleYaml is a string parsed in the same YAML or JSON rule-list format as value above. Reuse trace-pipeline.yaml from the previous example:

The response includes ruleValid, ruleRan, spanDropped, an optional error, and the resulting spanRecord. The input span can include trace_id, span_id, parent_id, infrastructure fields, span_name, kind, status, start_time, end_time, request_body, response_body, request_headers, response_headers, query_parameters, attributes, and tags. Timestamps use RFC3339; nonempty trace and span IDs must be valid hexadecimal IDs.

HTTP 200 alone does not mean the rule is valid or executed successfully: inspect ruleValid and error. A condition that does not match can leave ruleRan false.

Query statistics

Field
Type
Required
Description

start

string

Yes

RFC3339 start time.

end

string

Yes

RFC3339 end time, at or after start.

sources

array

No

Structured source filter conditions. Omit for all permitted sources.

configId

string

No

Configuration fingerprint (uuid from GET). Only for /stats.

The response is {"stats": [...]}. Each entry identifies the configuration and rule and includes processed/dropped counts, condition and execution errors, and processing-time measurements. The shared response uses names such as totalLogsSeen and totalLogsDropped, including for trace pipelines.

For the current configuration, send the same time window to /api/pipelines/traces/current-stats without configId. Its response contains both stats and totalStats.

Clear configuration

This clears the dynamic pipeline configuration. It does not delete stored observability data. An unavailable configuration service can return HTTP 503.

Last updated