{
  "schema_version": 2,
  "id": "operate/rs/references/rest-api/requests/nodes/stats/last",
  "title": "Latest node stats requests",
  "url": "https://redis.io/docs/latest/operate/rs/references/rest-api/requests/nodes/stats/last/",
  "summary": "Most recent node statistics requests",
  "tags": [
    "docs",
    "operate",
    "rs"
  ],
  "last_updated": "2025-03-10T13:08:54-04:00",
  "page_type": "content",
  "content_hash": "700fb83619ea1492f14f8b09beccba2333e04a1b0396025695ae505bac9b9f9d",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "| Method | Path | Description |\n|--------|------|-------------|\n| [GET](#get-all-nodes-stats-last) | `/v1/nodes/stats/last` | Get latest stats for all nodes |\n| [GET](#get-node-stats-last) | `/v1/nodes/stats/last/{uid}` | Get latest stats for a single node |"
    },
    {
      "id": "get-all-nodes-stats-last",
      "title": "Get latest stats for all nodes",
      "role": "content",
      "text": "[code example]\n\nGet latest statistics for all nodes.\n\n#### Required permissions\n\n| Permission name |\n|-----------------|\n| [view_all_nodes_stats](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#view_all_nodes_stats) |"
    },
    {
      "id": "get-all-request",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n[code example]\n\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\n#### Query parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| interval | string | Time interval for which we want stats: 1sec/10sec/5min/15min/1hour/12hour/1week. Default: 1sec. (optional) |\n| stime | ISO_8601 | Start time from which we want the stats. Should comply with the [ISO_8601](https://en.wikipedia.org/wiki/ISO_8601) format (optional) |\n| etime | ISO_8601 | End time after which we don't want the stats. Should comply with the [ISO_8601](https://en.wikipedia.org/wiki/ISO_8601) format (optional) |"
    },
    {
      "id": "get-all-response",
      "title": "Response",
      "role": "returns",
      "text": "Returns most recent [statistics](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/statistics) for all nodes.\n\n#### Example JSON body\n\n[code example]"
    },
    {
      "id": "get-all-status-codes",
      "title": "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| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | No nodes exist |"
    },
    {
      "id": "get-node-stats-last",
      "title": "Get latest node stats",
      "role": "content",
      "text": "[code example]\n\nGet the latest statistics of a node.\n\n#### Required permissions\n\n| Permission name |\n|-----------------|\n| [view_node_stats](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#view_node_stats) |"
    },
    {
      "id": "get-request",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n[code example]\n\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\n#### URL parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| uid | integer | The unique ID of the node requested. |\n\n\n#### Query parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| interval | string | Time interval for which we want stats: 1sec/10sec/5min/15min/1hour/12hour/1week. Default: 1sec. (optional) |\n| stime | ISO_8601 | Start time from which we want the stats. Should comply with the [ISO_8601](https://en.wikipedia.org/wiki/ISO_8601)format (optional) |\n| etime | ISO_8601 | End time after which we don't want the stats. Should comply with the [ISO_8601](https://en.wikipedia.org/wiki/ISO_8601)format (optional) |"
    },
    {
      "id": "get-response",
      "title": "Response",
      "role": "returns",
      "text": "Returns the most recent [statistics](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/statistics) for the specified node.\n\n#### Example JSON body\n\n[code example]"
    },
    {
      "id": "get-error-codes",
      "title": "Error codes",
      "role": "errors",
      "text": "| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | No error |\n| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | Node does not exist |\n| [406 Not Acceptable](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7) | Node isn't currently active |\n| [503 Service Unavailable](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4) | Mode is in recovery state |"
    }
  ],
  "examples": [
    {
      "id": "get-all-nodes-stats-last-ex0",
      "language": "sh",
      "code": "GET /v1/nodes/stats/last",
      "section_id": "get-all-nodes-stats-last"
    },
    {
      "id": "get-all-request-ex0",
      "language": "sh",
      "code": "GET /v1/nodes/stats/last?interval=1sec&stime=2015-10-14T06:29:43Z",
      "section_id": "get-all-request"
    },
    {
      "id": "get-all-response-ex0",
      "language": "json",
      "code": "{\n    \"1\": {\n         \"conns\": 0.0,\n         \"cpu_idle\": 0.922500000015134,\n         \"cpu_system\": 0.007499999999708962,\n         \"cpu_user\": 0.01749999999810825,\n         \"cur_aof_rewrites\": 0.0,\n         \"egress_bytes\": 7887.0,\n         \"ephemeral_storage_avail\": 75821363200.0,\n         \"ephemeral_storage_free\": 81189969920.0,\n         \"etime\": \"2015-10-14T06:29:44Z\",\n         \"free_memory\": 2956963840.0,\n         \"ingress_bytes\": 4950.0,\n         \"interval\": \"1sec\",\n         \"persistent_storage_avail\": 75821363200.0,\n         \"persistent_storage_free\": 81189969920.0,\n         \"stime\": \"2015-10-14T06:29:43Z\",\n         \"total_req\": 0.0\n     },\n     \"2\": {\n         \"conns\": 0.0,\n         \"cpu_idle\": 0.922500000015134,\n         \"// additional fields...\"\n     }\n}",
      "section_id": "get-all-response"
    },
    {
      "id": "get-node-stats-last-ex0",
      "language": "sh",
      "code": "GET /v1/nodes/stats/last/{int: uid}",
      "section_id": "get-node-stats-last"
    },
    {
      "id": "get-request-ex0",
      "language": "sh",
      "code": "GET /v1/nodes/stats/last/1?interval=1sec&stime=2015-10-13T09:01:54Z",
      "section_id": "get-request"
    },
    {
      "id": "get-response-ex0",
      "language": "json",
      "code": "{\n    \"1\": {\n         \"conns\": 0.0,\n         \"cpu_idle\": 0.8049999999930151,\n         \"cpu_system\": 0.02750000000014552,\n         \"cpu_user\": 0.12000000000080036,\n         \"cur_aof_rewrites\": 0.0,\n         \"egress_bytes\": 2169.0,\n         \"ephemeral_storage_avail\": 75920293888.0,\n         \"ephemeral_storage_free\": 81288900608.0,\n         \"etime\": \"2015-10-13T09:01:55Z\",\n         \"free_memory\": 3285381120.0,\n         \"ingress_bytes\": 3020.0,\n         \"interval\": \"1sec\",\n         \"persistent_storage_avail\": 75920293888.0,\n         \"persistent_storage_free\": 81288900608.0,\n         \"stime\": \"2015-10-13T09:01:54Z\",\n         \"total_req\": 0.0\n    }\n}",
      "section_id": "get-response"
    }
  ]
}
