Read one metric series' samples
const url = 'https://example.com/api/v1/systems/example/metrics/example/samples';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/v1/systems/example/metrics/example/samplesThe 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.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The owner’s name or uuid
The owner’s name or uuid
The metric_type name of the series
The metric_type name of the series
Query Parameters
Section titled “ Query Parameters ”The window in hours, counted back from now; 24 when unset
The window in hours, counted back from now; 24 when unset
The row cap, newest kept; 500 when unset. Ignored when a resolution is set
The row cap, newest kept; 500 when unset. Ignored when a resolution is set
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
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
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
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
Responses
Section titled “ Responses ”OK
object
A URL to the JSON Schema for this object.
Every regular bucket of the window, oldest first
object
Samples in the bucket
The newest sample’s value in the bucket
The bucket’s start
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
The one instance the buckets aggregate, measured samples only (observed and calculated); present only on a bucketed read
The series’ metric_type name
The owner’s name
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
Newest first; empty when a resolution was asked for
object
The series discriminator, when set
Observed, or calculated for a derived row
When the sample was observed
Example
{ "$schema": "/api/v1/schemas/MetricSeriesOutputBody.json"}default
Section titled “ default ”Error
object
A URL to the JSON Schema for this object.
A human-readable explanation specific to this occurrence of the problem.
Optional list of individual error details
object
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
HTTP status code
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
A URI reference to human-readable documentation for the error.
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"}