Ingest reference
Metrics ingest
Send custom metric points with a metric source’s token, and read back the points and limits that token’s source holds.
Its operations take the source's token as Authorization: Bearer <token>, never an API key.
Send metric points
POST/api/metric-sources/ingest
Sends a batch of custom metric points with a metric source’s token. The body is a JSON envelope {"points": […]}, a JSON array, one point or newline-delimited JSON, any of them gzipped. Each point names its metric by key (metric) or by uuid (metric_uuid) and carries a numeric value and an optional recorded_at. The answer counts what was queued and, per reason, what was refused; a batch can be partly accepted.
Limits (by default):
- 1,000 points in one request.
- A body of 1,048,576 bytes as sent and 10,485,760 bytes after decompression.
- A
recorded_atat most 300 seconds ahead of the server’s clock, and at most 1,095 days back.
Headers
- Idempotency-KeystringOptional
Any text of 1 to 255 visible ASCII characters. Required for points older than 30 days. A repeat of the same batch with the same key within 30 days is answered as the first was and counted once; a different batch under a used key is refused.
Body parameters
- pointsarray of objectsRequired
The points of the batch.
- metricstringRequired
The metric key, as it appears in WatchTower15:
A-Z a-z 0-9 . _ -, up to 100 characters. Taken exactly as sent. Send this ormetric_uuid, not both. - metric_uuidstring (uuid)Optional
The metric’s uuid, instead of its key. Never creates a metric, and must belong to the source whose token is used.
- valuenumberRequired
A number. For a level, the measurement (negative and fractional are fine). For a count, how many occurrences the point represents; a count cannot be negative.
- metric_typestringOptional
The type to create a new metric as. Honoured only on the push that creates the metric; any other value refuses the point.
Values:countlevel(an open set: new values may be added) - recorded_atstringOptional
When the value was measured: RFC 3339, or a Unix epoch in seconds or milliseconds as a number or a string. A time without a timezone is read as UTC. Defaults to now.
Returns
200 OK:
What was queued and how many points each reason refused.
The response panel's status selector shows each failure this operation can answer.
List a source's metrics
GET/api/metric-sources/ingest
Returns the metrics of the token’s own metric source, deleted ones included, sorted by key, each with its type and status, and the organisation’s metric allowance and use. Read only: it does not count as a push.
Returns
200 OK:
The source’s metrics and the organisation’s metric allowance.
The response panel's status selector shows each failure this operation can answer.