Query Metrics with the API

Use the Edge Delta API to query metric timeseries data programmatically.

The Edge Delta metrics API returns timeseries data for any metric in your organization. Use it to build custom dashboards, automate alerting workflows, or integrate Edge Delta metrics with external tools.

Prerequisites

You need:

Endpoint

GET /v1/orgs/{org_id}/metrics_v2/graph

Query Syntax

The query parameter uses a metric-specific query format:

aggregation:metric_name{filter} [by {field1,field2}] [.rollup(seconds)]
ComponentRequiredDescription
aggregationYesHow to combine data points: sum, avg, min, max, count, last, median, p50, p75, p90, p95, p99
metric_nameYesExact metric name, such as ed.buffer.disk.bytes. See Metrics List for available metrics.
{filter}YesFilter expression. Use {*} to match all data, or specify field conditions.
by {fields}NoGroup results by one or more fields.
.rollup(seconds)NoAggregation window in seconds.

Filter Syntax

Filters go inside the curly braces:

PatternExampleDescription
Match all{*}No filtering
Exact match{ed.tag:my-pipeline}Match a specific pipeline tag
Quoted value{ed.tag:"my pipeline"}Match a value containing spaces
Wildcard{ed.tag:prod*}Prefix matching
OR{ed.tag:(prod OR staging)}Match multiple values
NOT{-(ed.tag:dev)}Exclude a value
Multiple fields{ed.tag:prod host.name:web-1}AND (implicit)

Examples

Basic Query

Query the average disk buffer size over the last hour:

curl -G 'https://api.edgedelta.com/v1/orgs/<ORG_ID>/metrics_v2/graph' \
  --data-urlencode 'query=avg:ed.buffer.disk.bytes{*}' \
  --data-urlencode 'lookback=1h' \
  -H 'X-ED-API-Token: <API_TOKEN>'

Filter by Pipeline

Query successful uploads for a specific pipeline:

curl -G 'https://api.edgedelta.com/v1/orgs/<ORG_ID>/metrics_v2/graph' \
  --data-urlencode 'query=sum:ed.pipeline.node.upload.successful{ed.tag:my-pipeline}' \
  --data-urlencode 'lookback=1h' \
  -H 'X-ED-API-Token: <API_TOKEN>'

Group by Host

Query buffer queue depth grouped by host with a 60-second rollup:

curl -G 'https://api.edgedelta.com/v1/orgs/<ORG_ID>/metrics_v2/graph' \
  --data-urlencode 'query=max:ed.buffer.disk.items{*} by {host.name}.rollup(60)' \
  --data-urlencode 'lookback=30m' \
  -H 'X-ED-API-Token: <API_TOKEN>'

Specific Time Range

Use from and to instead of lookback for an exact time range:

curl -G 'https://api.edgedelta.com/v1/orgs/<ORG_ID>/metrics_v2/graph' \
  --data-urlencode 'query=avg:ed.buffer.disk.bytes{*}' \
  --data-urlencode 'from=2025-01-15T00:00:00.000Z' \
  --data-urlencode 'to=2025-01-15T01:00:00.000Z' \
  -H 'X-ED-API-Token: <API_TOKEN>'

Response Format

The API returns timeseries data grouped by the fields in your by clause:

{
  "from": "2025-01-15T00:00:00Z",
  "to": "2025-01-15T01:00:00Z",
  "window": "1m0s",
  "records": [
    {
      "values": ["my-pipeline", "worker-1"],
      "timeseries": [
        {"timestamp": "2025-01-15T00:01:00Z", "value": 1048576},
        {"timestamp": "2025-01-15T00:02:00Z", "value": 2097152},
        {"timestamp": "2025-01-15T00:03:00Z", "value": 3145728}
      ],
      "aggregate": {"value": 6291456}
    }
  ],
  "keys": ["ed.tag", "host.name"]
}
FieldDescription
windowThe rollup window applied to the timeseries
recordsOne record per unique combination of by fields
valuesThe field values for this record, matching the order in keys
timeseriesArray of timestamp/value pairs. Missing values indicate no data for that interval.
aggregateThe aggregation applied across the entire time range
keysThe field names corresponding to values, present when by is used

Query Parameters

ParameterTypeDescription
querystringMetric query expression (required)
lookbackstringDuration in Go format, such as 30m, 1h, 24h. Use this or from/to.
fromstringStart time in ISO 8601 format
tostringEnd time in ISO 8601 format

Common Metrics

For a full list of available metrics, see the Metrics List. Common metrics for monitoring pipeline health include:

MetricDescription
ed.pipeline.node.read_bytesBytes ingested by a node
ed.pipeline.node.write_bytesBytes output by a node
ed.pipeline.node.upload.successfulSuccessful destination uploads
ed.pipeline.node.errorErrors at a node
ed.buffer.disk.bytesDisk buffer size in bytes
ed.buffer.disk.itemsItems in the disk buffer queue