Metrics configuration requests
Metrics configuration requests
| Redis Software |
|---|
| Method | Path | Description |
|---|---|---|
| GET | /v1/metrics_config |
Get the cluster's metrics configuration |
| PUT | /v1/metrics_config |
Update the cluster's metrics configuration |
Get metrics configuration
GET /v1/metrics_config
Get the cluster-wide configuration of the v2 metrics stream engine.
Required permissions
| Permission name |
|---|
| view_cluster_info |
Request
Example HTTP request
GET /v1/metrics_config
Request headers
| Key | Value | Description |
|---|---|---|
| Host | cnm.cluster.fqdn | Domain name |
| Accept | application/json | Accepted media type |
Response
Returns a metrics configuration object. If the configuration has not been set, the default values are returned.
Example JSON body
{
"key_distribution_enabled": false,
"key_size_buckets": "",
"key_items_buckets": "",
"local_storage_max_size_mb": 1024,
"local_storage_retention_days": 8,
"expose_db_tags": false,
"metrics_tag_keys_exposed": [],
"max_requests_in_flight": 2
}
Status codes
| Code | Description |
|---|---|
| 200 OK | No error |
Update metrics configuration
PUT /v1/metrics_config
Update the cluster's metrics configuration.
This is a partial update: only the fields included in the request are changed, and any omitted fields keep their stored values. When a list field is included, its entire value is replaced; it is not merged with the stored list. The request must include at least one recognized field. If the configuration has never been set, the first update creates it, and any omitted fields take their default values.
Required permissions
| Permission name |
|---|
| update_cluster |
Request
Example HTTP request
PUT /v1/metrics_config
Example JSON body
{
"key_distribution_enabled": true,
"local_storage_retention_days": 14,
"expose_db_tags": true,
"metrics_tag_keys_exposed": ["env", "team"]
}
The above request enables the key distribution histograms, sets local metrics retention to 14 days, enables database tags in metrics, and exposes the env and team tag keys.
Request headers
| Key | Value | Description |
|---|---|---|
| Host | cnm.cluster.fqdn | Domain name |
| Accept | application/json | Accepted media type |
Request body
Include a metrics configuration object with the fields to update in the request body.
Response
Returns the complete metrics configuration object after the update.
Example JSON body
{
"key_distribution_enabled": true,
"key_size_buckets": "",
"key_items_buckets": "",
"local_storage_max_size_mb": 1024,
"local_storage_retention_days": 14,
"expose_db_tags": true,
"metrics_tag_keys_exposed": ["env", "team"],
"max_requests_in_flight": 2
}
Status codes
| Code | Description |
|---|---|
| 200 OK | No error. |
| 400 Bad Request | Bad content provided, or the request body is empty. |