Skip to content
You're viewing documentation for v2026.11.11-beta. It may be out of date.Go to latest
TimescaleDB Enterprise
Esc
↑↓navigate↵open⌘Jpreview

Set metrics retention

Saves the retention and restarts the metrics engine with it. The charts have no new data for some seconds. A shorter retention deletes the older metrics.

PUT/api/v1/settings/monitoring/retention
Authorization
tse_sessionAPI key · cookierequired
Request body
requiredapplication/json
daysinteger<int64>required

How many days the metrics engine keeps metrics

min 1 · max 3650
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/retention' \
  -H 'Cookie: tse_session=YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "days": 1
}'
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
}