Skip to content
TimescaleDB Enterprise
Esc
↑↓navigate↵open⌘Jpreview

Set metrics mirroring

With mirroring on and a token, GET /metrics/federate gives each metric to a Prometheus that sends the token. Off, the endpoint answers 404. The token stays.

PUT/api/v1/settings/monitoring/mirror
Authorization
tse_sessionAPI key · cookierequired
Request body
requiredapplication/json
enabledbooleanrequired
Responses
200

OK

mirror_enabledbooleanrequired

GET /metrics/federate answers. It also needs a token

mirror_token_created_atstring<date-time>

When the token was made

mirror_token_setbooleanrequired

A mirroring token exists. The console keeps only its hash, so it cannot show it again

retention_daysinteger<int64>required

How many days the metrics engine keeps metrics

retention_days_maxinteger<int64>required
retention_days_mininteger<int64>required
storage_bytesinteger<int64>required

The disk space that the metrics use now, in bytes. -1 when the console cannot read it

default

Error

codestring

Stable code of the refusal, when the route has codes

detailsstring[]

Additional detail, e.g. per-field validation failures

errorstringrequired

Human-readable error message

Request
curl -X PUT 'https://console.example.com/api/v1/settings/monitoring/mirror' \
  -H 'Cookie: tse_session=YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "enabled": true
}'
Response
{
  "mirror_enabled": true,
  "mirror_token_created_at": "2019-08-24T14:15:22Z",
  "mirror_token_set": true,
  "retention_days": 0,
  "retention_days_max": 0,
  "retention_days_min": 0,
  "storage_bytes": 0
}