Query Meter Data via API

SigNoz Cloud - This page applies to SigNoz Cloud editions.

The SigNoz Query Range API exposes all meter metrics. Pull daily ingestion volumes and compute costs outside the SigNoz UI: in a billing script, cost report, or automated workflow.

Prerequisites

  • A SigNoz Cloud account
  • A read-only API key: see Service Accounts for how to create one.

Meter data aggregates at hourly intervals. Queries under 1 hour return no data.

Meter Metrics

SigNoz exposes five meter metrics. All use Sum / Delta temporality: each data point is the volume ingested in that interval, not a cumulative total.

MetricDescriptionUnit
signoz.meter.log.countLog records ingestedcount
signoz.meter.log.sizeLog data ingestedbytes
signoz.meter.span.countSpans ingestedcount
signoz.meter.span.sizeSpan data ingestedbytes
signoz.meter.metric.datapoint.countMetric datapoints ingestedcount

Filter or group any metric by service.name, deployment.environment, host.name, or signoz.workspace.key.id to break costs down by team, environment, or ingestion key.

SigNoz retains meter data for 1 year. 90-day queries are within the retention window.

API Endpoint

POST https://<your-instance-url>/api/v5/query_range

Add your API key to every request:

SIGNOZ-API-KEY: <your-api-key>

Find the full specification in the API Reference.

Query Daily Volumes

Set stepInterval to 86400 (seconds per day) to get one data point per day. Use timeAggregation: "increase" to sum the delta values within each day's window into a single total.

Provide start and end as Unix timestamps in milliseconds. For the last 90 days:

  • end = current Unix time in ms
  • start = end - (90 × 86400 × 1000)

Calculate Cost from Volumes

The API returns raw bytes for logs and spans, and counts for metric datapoints. Find your per-unit prices on Settings → Billing.

Settings → Billing page showing per-unit prices for logs, traces, and metrics
Settings → Billing
SignalFormula
Logs (signoz.meter.log.size)(bytes / 1e9) × price_per_GB
Traces (signoz.meter.span.size)(bytes / 1e9) × price_per_GB
Metrics (signoz.meter.metric.datapoint.count)(count / 1e6) × price_per_million

Examples

Query daily log size for the last 90 days. The shell computes timestamps at runtime.

NOW_MS=$(( $(date +%s) * 1000 ))
START_MS=$(( NOW_MS - 90 * 86400 * 1000 ))

curl -X POST 'https://<your-instance-url>/api/v5/query_range' \
  -H 'SIGNOZ-API-KEY: <your-api-key>' \
  -H 'Content-Type: application/json' \
  -d "{
    \"start\": $START_MS,
    \"end\": $NOW_MS,
    \"requestType\": \"time_series\",
    \"compositeQuery\": {
      \"queries\": [
        {
          \"type\": \"builder_query\",
          \"spec\": {
            \"name\": \"A\",
            \"signal\": \"metrics\",
            \"source\": \"meter\",
            \"stepInterval\": 86400,
            \"aggregations\": [{
              \"metricName\": \"signoz.meter.log.size\",
              \"timeAggregation\": \"increase\",
              \"spaceAggregation\": \"sum\"
            }],
            \"disabled\": false
          }
        }
      ]
    }
  }" | jq .

Verify these values:

  • <your-instance-url> — your SigNoz Cloud URL, for example acme.in.signoz.cloud
  • <your-api-key> — API key from Settings → Service Accounts

Each data point covers one day. The value is total bytes of logs ingested that day.

Data points at the edges of your time range may carry "partial": true. These mark day buckets cut off by start or end. Exclude them from cost totals as they under-report that day's usage.

Troubleshooting

No data returned

Your query window is under 1 hour. Meter data aggregates hourly. For daily data, use stepInterval: 86400 and a start/end range of at least 24 hours.

Values do not match the SigNoz billing page

Meter data uses UTC. If your script converts timestamps to local time, align the billing cycle start to 00:00:00 UTC before comparing.

401 Unauthorized

Your API key is missing or expired. Regenerate it from Settings → Service Accounts.

Next Steps

Get Help

If you need help with the steps in this topic, please reach out to us on SigNoz Community Slack.

If you are a SigNoz Cloud user, please use in product chat support located at the bottom right corner of your SigNoz instance or contact us at cloud-support@signoz.io.

Last updated: May 18, 2026

Edit on GitHub

Was this page helpful?

Your response helps us improve this page.

On this page

Is this page helpful?

Your response helps us improve this page.