Metrics chart

Returns metric values sampled for a line chart: original samples when they are few enough, otherwise values aggregated per minute or per bucket.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Returns metric values ready to be plotted on a line chart. This is the same data used by the Things5 web app charts (Monitoring) and by the Grafana datasource, so the three always show the same values for the same time range.

How the resolution is chosen

The resolution is selected automatically for each metric from the requested time range and from how many samples the device sent:

ConditionresolutionPoints
Range ≤ 30 minutesrawOriginal samples sent by the device
At most 1000 samples in the rangerawOriginal samples sent by the device
At most 1000 minutes with data in the rangeminuteOne point per minute (bucket_seconds = 60)
OtherwisebucketOne point per bucket of range / 400 minutes (bucket_seconds gives the size)

When the points are aggregated (minute or bucket), each value is computed with the aggregate function over the bucket: avg (default, weighted on the number of samples), min, max or sum. With raw resolution the original values are returned and aggregate has no effect.

Gaps

With show_gaps=true (default) aggregated series contain a point with value: null for each bucket without data, so a chart can draw a gap instead of joining distant points. Use show_gaps=false to receive only buckets with data.

With show_gaps=auto each metric follows its trend chart in the Things5 web app (Monitoring): it gets null points only if that trend shows gaps. The trend settings are the user's own trends for the device, otherwise the defaults of the device firmware; a metric without a trend has no gaps. Many metrics are sent only when their value changes, so a hole in the data usually means "unchanged" rather than "missing".

Trend settings and value before the range

Every series reports how the Monitoring trend of the metric is drawn, so a client can draw it the same way:

  • interpolation: linear (a line joining the points) or step (each value held until the next point).
  • show_gaps: whether the trend shows gaps.

The defaults (metric without a trend) are linear and false.

With include_previous=true each series also contains previous: the last sample sent at or before from (looking back at most one year), or null if there is none. It is the value in effect at the start of the range, useful to start the line at the left edge for metrics sent only when they change.

Limits

At most 50 metric_names[] per request. To read more metrics, split them over several requests.

To read the per-minute processed values (first, last, min, max, avg, sum, sample count) with pagination use Metrics read.

Path Params
string
required

Device id (UUID)

Query Params
metric_names[]
array of strings
required

Metric names to read, at most 50

metric_names[]*
date
required

Start of the range, timestamp ISO 8601. E.g. 2026-11-01T00:00:00Z

date
required

End of the range, timestamp ISO 8601. E.g. 2026-11-02T00:00:00Z

string
enum
Defaults to avg

Function used when points are aggregated (resolution minute or bucket). Ignored for raw data

Allowed:
string
enum
Defaults to true

true: null points for buckets without data. false: only points with data. auto: per metric, as its Monitoring trend (see Gaps)

Allowed:
boolean
Defaults to false

Add previous to every series: the last sample at or before from, or null

Responses

Language
Credentials
Header
LoadingLoading…
Response
Choose an example:
application/json