Skip to content

Read one metric series' samples

GET
/systems/{name}/metrics/{metric}/samples
curl --request GET \
--url https://example.com/api/v1/systems/example/metrics/example/samples

The samples behind the effective read’s latest value for one series, newest first, windowed (hours) and capped (limit, newest kept). With a resolution (seconds) it answers instead with every regular bucket of the window, oldest first, each with count, min, max, avg and last (null when empty), and covered_from, the earliest instant retention leaves data for. A bucket aggregates one instance’s measured samples (observed and calculated, never declared or intended): instance names it, and unset it is the one instance with measured samples in the window, or a 422 listing them when there are several. Over more than 48 hours, or past the series’ retention, the resolution is raised to whole hours, and resolution_seconds is the width applied. At whole hours a series with hourly trends (an observed one) takes every hour the trend fold has closed from its trend, so the read reaches back as far as the trends are kept, and its open hours from the samples; any other series, or a finer resolution, reads its samples, within their retention (ADR-1566). Gated by system:read; an out-of-scope owner is a non-disclosing 404.

name
required

The owner’s name or uuid

string

The owner’s name or uuid

metric
required

The metric_type name of the series

string

The metric_type name of the series

hours

The window in hours, counted back from now; 24 when unset

integer format: int64
>= 1 <= 720

The window in hours, counted back from now; 24 when unset

limit

The row cap, newest kept; 500 when unset. Ignored when a resolution is set

integer format: int64
>= 1 <= 2000

The row cap, newest kept; 500 when unset. Ignored when a resolution is set

resolution

The bucket width in seconds, at most 30 days. Set, the read answers with every regular bucket of the window (buckets) instead of raw rows; unset, the raw samples. Over a window of more than 48 hours, or one past the series’ retention, it is raised to whole hours, at least one, and resolution_seconds says the width applied. A window of more than 5000 buckets is refused

integer format: int64
>= 1 <= 2592000

The bucket width in seconds, at most 30 days. Set, the read answers with every regular bucket of the window (buckets) instead of raw rows; unset, the raw samples. Over a window of more than 48 hours, or one past the series’ retention, it is raised to whole hours, at least one, and resolution_seconds says the width applied. A window of more than 5000 buckets is refused

instance

The instance a bucketed read aggregates. Unset, the one instance with measured samples in the window; when more than one has them the read is refused with a 422 listing them. Ignored without a resolution

string

The instance a bucketed read aggregates. Unset, the one instance with measured samples in the window; when more than one has them the read is refused with a 422 listing them. Ignored without a resolution

OK

Media type application/json
object
$schema

A URL to the JSON Schema for this object.

string format: uri
buckets

Every regular bucket of the window, oldest first

Array<object> | null
object
avg
required
number | null format: double
count
required

Samples in the bucket

integer format: int64
last
required

The newest sample’s value in the bucket

number | null format: double
max
required
number | null format: double
min
required
number | null format: double
ts
required

The bucket’s start

string format: date-time
covered_from

The earliest instant the read could have data for: the start of the window, or the oldest the series keeps when that is later, its samples’ effective retention or, at whole hours for a series with hourly trends, the trends’ window. A bucket before it is empty because of retention, not because collection stopped

string format: date-time
instance

The one instance the buckets aggregate, measured samples only (observed and calculated); present only on a bucketed read

string
metric
required

The series’ metric_type name

string
owner
required

The owner’s name

string
resolution_seconds

The bucket width applied: the one asked for, raised to whole hours over a window of more than 48 hours or past the series’ retention (ADR-1566); present only on a bucketed read

integer format: int64
samples
required

Newest first; empty when a resolution was asked for

Array<object> | null
object
instance

The series discriminator, when set

string
provenance
required

Observed, or calculated for a derived row

string
source
string
ts
required

When the sample was observed

string format: date-time
value
required
number format: double

Example

{
"$schema": "/api/v1/schemas/MetricSeriesOutputBody.json"
}

Error

Media type application/problem+json
object
$schema

A URL to the JSON Schema for this object.

string format: uri
detail

A human-readable explanation specific to this occurrence of the problem.

string
errors

Optional list of individual error details

Array<object> | null
object
location

Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’

string
message

Error message text

string
value

The value at the given location

instance

A URI reference that identifies the specific occurrence of the problem.

string format: uri
status

HTTP status code

integer format: int64
title

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

string
type

A URI reference to human-readable documentation for the error.

string format: uri
default: about:blank

Example

{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}