{
  "schema_version": 2,
  "id": "operate/rs/monitoring/metrics_stream_engine/local-metrics-storage",
  "title": "Local metrics storage",
  "url": "https://redis.io/docs/latest/operate/rs/monitoring/metrics_stream_engine/local-metrics-storage/",
  "summary": "Keep a history of v2 metrics on each Redis Software node and include it in support packages.",
  "tags": [
    "docs",
    "integrate",
    "rs"
  ],
  "last_updated": "2026-09-29T16:51:25+03:00",
  "page_type": "content",
  "content_hash": "863f333c7e3dc0e947cd259e53b2c5ca20530250f0c55517e91b3a9ae37a453e",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Local metrics storage is available as of [Redis Software version 8.2](https://redis.io/docs/latest/operate/rs/release-notes/rs-8-2-releases).\n\nLocal metrics storage is an optional history layer on top of the [v2 metrics stream engine](https://redis.io/docs/latest/operate/rs/monitoring/metrics_stream_engine) stored on each node. [Support packages](#support-packages) include this history automatically."
    },
    {
      "id": "tiers",
      "title": "Tiers",
      "role": "content",
      "text": "Local storage collects metrics in two tiers:\n\n- **Standard** collects metrics about every 30 seconds whenever local storage is enabled.\n\n- **Granular** collects metrics every second, but only while you run it. You start and stop it on demand, on one node or on all nodes. Use it for short troubleshooting windows, not for continuous collection. Granular collection stops automatically after a maximum duration if you don't stop it first. Its data stays on disk after collection stops, so support packages still include it. The data is deleted automatically after a cleanup delay. You can also delete it yourself, but only after collection stops on every node you're deleting data from."
    },
    {
      "id": "resource-cost",
      "title": "Resource cost",
      "role": "content",
      "text": "Use a tier only if the node has enough spare CPU and memory.\n\n**Standard** is expected to raise CPU use by about 3–5% and memory use by about 2.5–5.5%. For example:\n\n- If CPU is at about 50%, you can enable standard. CPU is expected to rise to about 52%.\n- If CPU is at about 95%, add headroom first. Otherwise, CPU could reach 98–100%.\n- If you have 2.6 GB of memory used and 1 GB available, you can enable standard. Memory use is expected to rise by about 65–143 MB.\n- If you have 2.6 GB of memory used and 100 MB available, add headroom first. Otherwise, the increase could use up the available memory.\n\n**Granular** is expected to raise CPU use by about 95–125%, which can nearly double it, and memory use by about 4–5.5%. For example:\n\n- If CPU is at about 30%, you can run granular collection. CPU is expected to rise to about 59–68%. The increase lasts only while granular collection runs. After collection stops, CPU is expected to return to its previous level.\n- If CPU is at about 50%, add headroom first. Otherwise, CPU demand could reach 98–113% and saturate the node.\n- If you have 2.6 GB of memory used and 1 GB available, you can run granular collection. Memory use is expected to rise by about 104–143 MB. The increase lasts only while granular collection runs. After collection stops, memory use is expected to return to its previous level.\n- If you have 2.6 GB of memory used and 100 MB available, add headroom first. Otherwise, the increase could use up the available memory."
    },
    {
      "id": "storage-pressure-retention",
      "title": "Storage-pressure retention",
      "role": "content",
      "text": "Each node keeps its stored metrics within its size limit by shortening retention when disk usage runs high. Every minute, the node compares the size of its stored data with `local_storage_max_size_mb`:\n\n- When usage rises above 90% of the limit, the node's effective retention drops by one day, to a minimum of one day.\n- When usage falls below 50% of the limit, effective retention returns to the configured `local_storage_retention_days`.\n\nA busy or undersized node can therefore keep less history than you configured. To compare configured and effective retention for each node, see [metrics status](https://redis.io/docs/latest/operate/rs/references/rest-api/requests/metrics#get-metrics-status)."
    },
    {
      "id": "support-packages",
      "title": "Support packages",
      "role": "compatibility",
      "text": "When local storage is enabled, [support packages](https://redis.io/docs/latest/operate/rs/installing-upgrading/creating-support-package) include each node's stored metrics. You don't need to run a separate command or set a flag, and you can't leave the metrics out.\n\n- **Format**: The metrics are Prometheus-compatible time series database (TSDB) blocks. You can load them into your own Prometheus-compatible system and query them with Prometheus Query Language (PromQL), even if you had no external monitoring in place when the issue happened.\n- **History**: Each node contributes all the metrics it currently retains, up to its effective retention.\n- **Granular data**: Included after collection stops, until the data is deleted.\n\nFor where the metrics are in the package, see [support package files](https://redis.io/docs/latest/operate/rs/installing-upgrading/creating-support-package#node-support-package-files)."
    },
    {
      "id": "manage-local-storage",
      "title": "Manage local storage",
      "role": "content",
      "text": ""
    },
    {
      "id": "enable-local-storage",
      "title": "Enable local storage",
      "role": "content",
      "text": "Local storage is disabled by default. To enable it, turn on `metrics_local_storage_service` with the [REST API](https://redis.io/docs/latest/operate/rs/references/rest-api/requests/cluster/services_configuration) or the [CLI](https://redis.io/docs/latest/operate/rs/references/cli-utilities/rladmin/cluster/config). The setting applies to every node in the cluster.\n\n- **REST API**: Send a `PUT /v1/cluster/services_configuration` request with the following body:\n\n    [code example]\n\n- **CLI**: Run the following `rladmin` command:\n\n    [code example]"
    },
    {
      "id": "set-the-standard-tiers-size-limit-and-retention",
      "title": "Set the standard tier's size limit and retention",
      "role": "content",
      "text": "To change how much disk space the standard tier uses and how long it keeps metrics, update `local_storage_max_size_mb` and `local_storage_retention_days` with the [REST API](https://redis.io/docs/latest/operate/rs/references/rest-api/requests/metrics_config) or the [CLI](https://redis.io/docs/latest/operate/rs/references/cli-utilities/rladmin/metrics#metrics-config). The following examples set a 2048 MB limit and 14-day retention.\n\n- **REST API**: Send a `PUT /v1/metrics_config` request with the following body:\n\n    [code example]\n\n- **CLI**: Run the following `rladmin` command:\n\n    [code example]"
    },
    {
      "id": "check-local-storage-status",
      "title": "Check local storage status",
      "role": "content",
      "text": "To check each node's store state, disk usage, and configured and effective retention, use the [REST API](https://redis.io/docs/latest/operate/rs/references/rest-api/requests/metrics#get-metrics-status) or the [CLI](https://redis.io/docs/latest/operate/rs/references/cli-utilities/rladmin/metrics#metrics-status).\n\n- **REST API**: Send the following request. To check a single node, add `?node_uid=<node-id>`.\n\n    [code example]\n\n- **CLI**: Run the following `rladmin` command. To check a single node, add `node <node-id>`.\n\n    [code example]"
    },
    {
      "id": "start-stop-or-check-granular-collection",
      "title": "Start, stop, or check granular collection",
      "role": "content",
      "text": "To control granular collection, use the [REST API](https://redis.io/docs/latest/operate/rs/references/rest-api/requests/metrics/granular) or the [CLI](https://redis.io/docs/latest/operate/rs/references/cli-utilities/rladmin/metrics#metrics-granular-start). Each command applies to all nodes unless you specify a node.\n\n- **REST API**: Send one of the following requests. To target a single node, add `?node_uid=<node-id>`.\n\n    [code example]\n\n- **CLI**: Run one of the following `rladmin` commands. To target a single node, add `node <node-id>`.\n\n    [code example]"
    },
    {
      "id": "delete-granular-data",
      "title": "Delete granular data",
      "role": "content",
      "text": "To delete granular data before the cleanup delay passes, use the [REST API](https://redis.io/docs/latest/operate/rs/references/rest-api/requests/metrics/granular#delete-granular-data) or the [CLI](https://redis.io/docs/latest/operate/rs/references/cli-utilities/rladmin/metrics#metrics-granular-cleanup). Stop granular collection on the affected nodes first.\n\n- **REST API**: Send the following request. To target a single node, add `?node_uid=<node-id>`.\n\n    [code example]\n\n- **CLI**: Run the following `rladmin` command. To target a single node, add `node <node-id>`.\n\n    [code example]"
    },
    {
      "id": "change-the-granular-maximum-duration-and-cleanup-delay",
      "title": "Change the granular maximum duration and cleanup delay",
      "role": "content",
      "text": "To change how long granular collection runs and how long its data is kept after it stops, update [`granular_metrics_job_settings`](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/job_scheduler/granular_metrics_job_settings) with the [REST API](https://redis.io/docs/latest/operate/rs/references/rest-api/requests/job_scheduler). Both values are in seconds. The following example sets a 2-hour maximum duration and a 48-hour cleanup delay.\n\n- **REST API**: Send a `PUT /v1/job_scheduler` request with the following body:\n\n    [code example]"
    },
    {
      "id": "get-the-stored-metrics",
      "title": "Get the stored metrics",
      "role": "content",
      "text": "To get the stored metrics, [create a support package](https://redis.io/docs/latest/operate/rs/installing-upgrading/creating-support-package) with the [REST API](https://redis.io/docs/latest/operate/rs/references/rest-api/requests/cluster/debuginfo) or the [CLI](https://redis.io/docs/latest/operate/rs/references/cli-utilities/rladmin/cluster/debug_info).\n\n- **REST API**: Send the following request:\n\n    [code example]\n\n- **CLI**: Run the following `rladmin` command:\n\n    [code example]"
    }
  ],
  "examples": [
    {
      "id": "enable-local-storage-ex0",
      "language": "json",
      "code": "{\n      \"metrics_local_storage_service\": {\n        \"operating_mode\": \"enabled\"\n      }\n    }",
      "section_id": "enable-local-storage"
    },
    {
      "id": "enable-local-storage-ex1",
      "language": "sh",
      "code": "rladmin cluster config services metrics_local_storage_service enabled",
      "section_id": "enable-local-storage"
    },
    {
      "id": "set-the-standard-tiers-size-limit-and-retention-ex0",
      "language": "json",
      "code": "{\n      \"local_storage_max_size_mb\": 2048,\n      \"local_storage_retention_days\": 14\n    }",
      "section_id": "set-the-standard-tiers-size-limit-and-retention"
    },
    {
      "id": "set-the-standard-tiers-size-limit-and-retention-ex1",
      "language": "sh",
      "code": "rladmin metrics config local_storage_max_size_mb 2048 local_storage_retention_days 14",
      "section_id": "set-the-standard-tiers-size-limit-and-retention"
    },
    {
      "id": "check-local-storage-status-ex0",
      "language": "sh",
      "code": "GET /v1/metrics/status",
      "section_id": "check-local-storage-status"
    },
    {
      "id": "check-local-storage-status-ex1",
      "language": "sh",
      "code": "rladmin metrics status",
      "section_id": "check-local-storage-status"
    },
    {
      "id": "start-stop-or-check-granular-collection-ex0",
      "language": "sh",
      "code": "POST /v1/metrics/granular/start\n    POST /v1/metrics/granular/stop\n    GET /v1/metrics/granular/status",
      "section_id": "start-stop-or-check-granular-collection"
    },
    {
      "id": "start-stop-or-check-granular-collection-ex1",
      "language": "sh",
      "code": "rladmin metrics granular start\n    rladmin metrics granular stop\n    rladmin metrics granular status",
      "section_id": "start-stop-or-check-granular-collection"
    },
    {
      "id": "delete-granular-data-ex0",
      "language": "sh",
      "code": "DELETE /v1/metrics/granular/data",
      "section_id": "delete-granular-data"
    },
    {
      "id": "delete-granular-data-ex1",
      "language": "sh",
      "code": "rladmin metrics granular cleanup",
      "section_id": "delete-granular-data"
    },
    {
      "id": "change-the-granular-maximum-duration-and-cleanup-delay-ex0",
      "language": "json",
      "code": "{\n      \"granular_metrics_job_settings\": {\n        \"granular_max_duration\": 7200,\n        \"granular_cleanup_delay\": 172800\n      }\n    }",
      "section_id": "change-the-granular-maximum-duration-and-cleanup-delay"
    },
    {
      "id": "get-the-stored-metrics-ex0",
      "language": "sh",
      "code": "GET /v1/cluster/debuginfo",
      "section_id": "get-the-stored-metrics"
    },
    {
      "id": "get-the-stored-metrics-ex1",
      "language": "sh",
      "code": "rladmin cluster debug_info",
      "section_id": "get-the-stored-metrics"
    }
  ]
}
