Skip to content

Get a metric series

POST/projects/{project_id}/services/{service_id}/metrics/series

Returns time-series data points for a named metric within a time window. Use getServiceMetricsAvailableSeries to discover valid metric names.

Parameters are sent as a JSON body so callers can pass an unbounded filter set without query-string length pressure. The response is a list of MetricSeries, each carrying its label set as a structured map alongside its per-bucket data points.

Path ParametersExpand Collapse
project_id: string
service_id: string
Body ParametersJSONExpand Collapse
from: string

Start of the time window (RFC3339; nanosecond precision accepted).

formatdate-time
metric_name: string

Metric series name. Use getServiceMetricsAvailableSeries to discover valid values.

to: string

End of the time window (RFC3339; nanosecond precision accepted).

formatdate-time
bucket_seconds: optional number

Aggregation bucket size in seconds. Optional: when omitted the server picks a default that matches the window (roughly 1m for windows up to 1h, 1h for up to 30d, 1d beyond that). Minimum is 60s (finer buckets don’t add resolution given scrape intervals). Must be coarse enough for the window’s tier; requests that ask for a finer bucket than the tier can produce are rejected.

minimum60
filters: optional array of object { key, value, match_type }

Label filters applied to the series query. Recognized label names depend on the metric. The most common is role (value primary or replica). When role is omitted, some metrics default to primary and others return data for all roles (one series per role); pass an explicit role for deterministic results. Role label values in the response are lowercased.

key: string

Label key to match against, e.g. role.

minLength1
value: string

Label value to match. Case sensitivity follows the underlying metric’s storage convention.

minLength1
match_type: optional "EQUAL" or "NOT_EQUAL"
  • EQUAL: the series must have the label equal to value.
  • NOT_EQUAL: the series must not have the label equal to value. A series missing the label entirely also matches. To exclude multiple values of the same label, pass multiple filters with that key.
One of the following:
"EQUAL"
"NOT_EQUAL"
fn: optional "RATE" or "INCREASE" or "SUM" or 10 more

Aggregation function applied to raw/pre-aggregated samples when collapsing them into one value per output bucket.

  • RATE: counter-reset-aware per-second rate of change.
  • INCREASE: counter-reset-aware total increase over the bucket.
  • SUM: sum of samples in the bucket.
  • AVG: mean of samples in the bucket.
  • MIN: minimum sample in the bucket.
  • MAX: maximum sample in the bucket.
  • MIN_TOTAL / MAX_TOTAL: minimum/maximum of the bucket’s samples added together across every series first — for a metric with labels (e.g. one series per database) where the combined total, not any single series’ own extremum, is the meaningful quantity (e.g. peak of total connections across all databases). MIN/MAX give the single most extreme individual series instead, which is the right answer when the metric is itself an extremum or a timestamp (e.g. longest-running transaction).
  • COUNT: number of samples in the bucket.
  • P50 / P90 / P99: approximate percentiles.
  • LAST: the most recent sample in the bucket.
One of the following:
"RATE"
"INCREASE"
"SUM"
"AVG"
"MIN"
"MAX"
"MIN_TOTAL"
"MAX_TOTAL"
"COUNT"
"P50"
"P90"
"P99"
"LAST"
group_by: optional array of string

Label keys to break the result into one series per distinct value combination. Optional: when omitted (or empty), all matching label sets collapse into a single series.

Not accepted on the following metrics — requests are rejected with INVALID_REQUEST:

  • timescale_cloud_system_cpu_total_millicores
  • timescale_cloud_system_cpu_usage_millicores
  • timescale_cloud_system_disk_io_read_bytes
  • timescale_cloud_system_disk_io_read_ops
  • timescale_cloud_system_disk_io_total_bytes
  • timescale_cloud_system_disk_io_total_ops
  • timescale_cloud_system_disk_io_write_bytes
  • timescale_cloud_system_disk_io_write_ops
  • timescale_cloud_system_disk_usage_bytes
  • timescale_cloud_system_memory_total_bytes
  • timescale_cloud_system_memory_usage_bytes
ReturnsExpand Collapse
data: array of object { time, value }

Per-bucket data points for this label set.

time: string

The bucket start timestamp.

formatdate-time
value: optional number

The aggregated value at this bucket, or null for a gap bucket with no collected data. Gap buckets are still emitted (one entry per bucket in the window), so this is null rather than omitted.

formatdouble
labels: map[string]

Label set identifying this series. The key set depends on the metric (e.g. role, ordinal).

Get a metric series

curl https://console.cloud.tigerdata.com/public/api/v1/projects/$PROJECT_ID/services/$SERVICE_ID/metrics/series \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $TIGER_CLOUD_API_KEY" \
    -d '{
          "from": "2026-06-25T10:00:00Z",
          "metric_name": "timescale_cloud_system_cpu_usage_millicores",
          "to": "2026-06-25T11:00:00Z",
          "bucket_seconds": 3600,
          "fn": "RATE",
          "group_by": [
            "role"
          ]
        }'
[
  {
    "data": [
      {
        "time": "2026-06-25T10:00:00Z",
        "value": 247.5
      }
    ],
    "labels": {
      "foo": "string"
    }
  }
]
Returns Examples
[
  {
    "data": [
      {
        "time": "2026-06-25T10:00:00Z",
        "value": 247.5
      }
    ],
    "labels": {
      "foo": "string"
    }
  }
]