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

Set the metrics storage limit

Saves the storage limit, or the default with 0, and restarts the metrics engine with it. The charts have no new data for some seconds. A lower limit deletes the oldest metrics.

PUT/api/v1/settings/monitoring/storage-limit
Authorization
tse_sessionAPI key · cookierequired
Request body
requiredapplication/json
bytesinteger<int64>required

The storage limit in bytes, from storage_limit_min_bytes to storage_limit_max_bytes. 0 sets the default

min 0
Responses
200

OK

kept_secondsinteger<int64>required

The age of the oldest metrics, in seconds. -1 when the console cannot read it

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

storage_fullbooleanrequired

The metrics engine deleted old metrics at the limit since its last start

storage_limit_bytesinteger<int64>required

The storage limit of the metrics in force, in bytes. At the limit, the oldest metrics go first. 0 when the metrics engine runs with no limit, -1 when the console cannot read it

storage_limit_max_bytesinteger<int64>required

80% of the disk of the metrics. -1 when the console cannot read it

storage_limit_min_bytesinteger<int64>required
storage_limit_set_bytesinteger<int64>required

The storage limit that an admin saved, in bytes. 0 is the default: 40% of the disk of the metrics. A saved limit above storage_limit_max_bytes gives the default

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/storage-limit' \
  -H 'Cookie: tse_session=YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "bytes": 0
}'
Response
{
  "kept_seconds": 0,
  "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,
  "storage_full": true,
  "storage_limit_bytes": 0,
  "storage_limit_max_bytes": 0,
  "storage_limit_min_bytes": 0,
  "storage_limit_set_bytes": 0
}