{
  "id": "metrics_config",
  "title": "Metrics configuration requests",
  "url": "https://redis.io/docs/latest/operate/rs/references/rest-api/requests/metrics_config/",
  "summary": "Metrics configuration requests",
  "tags": [
    "docs",
    "operate",
    "rs"
  ],
  "last_updated": "2026-07-24T10:52:10-07:00",
  "children": [],
  "page_type": "content",
  "content_hash": "53fe0dac361c22baadd484a20f937731552447c99fa0f8be1b6297259574e9f8",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "| Method | Path | Description |\n|--------|------|-------------|\n| [GET](#get-metrics-config) | `/v1/metrics_config` | Get the cluster's metrics configuration |\n| [PUT](#put-metrics-config) | `/v1/metrics_config` | Update the cluster's metrics configuration |"
    },
    {
      "id": "get-metrics-configuration-get-metrics-config",
      "title": "Get metrics configuration {#get-metrics-config}",
      "role": "content",
      "text": "GET /v1/metrics_config\n\nGet the cluster-wide configuration of the [v2 metrics stream engine](https://redis.io/docs/latest/operate/rs/monitoring/metrics_stream_engine).\n\n#### Required permissions\n\n| Permission name |\n|-----------------|\n| [view_cluster_info](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#view_cluster_info) |"
    },
    {
      "id": "request-get-request",
      "title": "Request {#get-request}",
      "role": "content",
      "text": "#### Example HTTP request\n\n\tGET /v1/metrics_config\n\n#### Request headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |"
    },
    {
      "id": "response-get-response",
      "title": "Response {#get-response}",
      "role": "returns",
      "text": "Returns a [metrics configuration object](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/metrics_config). If the configuration has not been set, the default values are returned.\n\n#### Example JSON body\n\n[code example]"
    },
    {
      "id": "status-codes-get-status-codes",
      "title": "Status codes {#get-status-codes}",
      "role": "content",
      "text": "| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | No error |"
    },
    {
      "id": "update-metrics-configuration-put-metrics-config",
      "title": "Update metrics configuration {#put-metrics-config}",
      "role": "content",
      "text": "PUT /v1/metrics_config\n\nUpdate the cluster's metrics configuration.\n\nThis 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.\n\n#### Required permissions\n\n| Permission name |\n|-----------------|\n| [update_cluster](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#update_cluster) |"
    },
    {
      "id": "request-put-request",
      "title": "Request {#put-request}",
      "role": "content",
      "text": "#### Example HTTP request\n\n\tPUT /v1/metrics_config\n\n#### Example JSON body\n\n[code example]\n\nThe 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.\n\n#### Request headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n#### Request body\n\nInclude a [metrics configuration object](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/metrics_config) with the fields to update in the request body."
    },
    {
      "id": "response-put-response",
      "title": "Response {#put-response}",
      "role": "returns",
      "text": "Returns the complete [metrics configuration object](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/metrics_config) after the update.\n\n#### Example JSON body\n\n[code example]"
    },
    {
      "id": "status-codes-put-status-codes",
      "title": "Status codes {#put-status-codes}",
      "role": "content",
      "text": "| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | No error. |\n| [400 Bad Request](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1) | Bad content provided, or the request body is empty. |"
    }
  ],
  "examples": [
    {
      "id": "response-get-response-ex0",
      "language": "json",
      "code": "{\n    \"key_distribution_enabled\": false,\n    \"key_size_buckets\": \"\",\n    \"key_items_buckets\": \"\",\n    \"local_storage_max_size_mb\": 1024,\n    \"local_storage_retention_days\": 8,\n    \"expose_db_tags\": false,\n    \"metrics_tag_keys_exposed\": [],\n    \"max_requests_in_flight\": 2\n}",
      "section_id": "response-get-response"
    },
    {
      "id": "request-put-request-ex0",
      "language": "json",
      "code": "{\n    \"key_distribution_enabled\": true,\n    \"local_storage_retention_days\": 14,\n    \"expose_db_tags\": true,\n    \"metrics_tag_keys_exposed\": [\"env\", \"team\"]\n}",
      "section_id": "request-put-request"
    },
    {
      "id": "response-put-response-ex0",
      "language": "json",
      "code": "{\n    \"key_distribution_enabled\": true,\n    \"key_size_buckets\": \"\",\n    \"key_items_buckets\": \"\",\n    \"local_storage_max_size_mb\": 1024,\n    \"local_storage_retention_days\": 14,\n    \"expose_db_tags\": true,\n    \"metrics_tag_keys_exposed\": [\"env\", \"team\"],\n    \"max_requests_in_flight\": 2\n}",
      "section_id": "response-put-response"
    }
  ]
}
