Skip to main content
The Cluster Status endpoints provide detailed information about the nodes, ranges, sessions, and events in your CockroachDB cluster. These endpoints help you monitor cluster health, troubleshoot performance issues, and understand cluster topology.

Authentication

All endpoints on this page require authentication using a session token. See the Cluster API Overview for authentication instructions.
X-Cockroach-API-Session: {session_token}

List Nodes

Get details on all nodes in the cluster, including node IDs, software versions, and hardware specifications.
GET /api/v2/nodes
curl --request GET \
  --url https://localhost:8080/api/v2/nodes \
  --header 'X-Cockroach-API-Session: {session_token}'
Stability: Stable

Response

{
  "nodes": [
    {
      "node_id": 1,
      "address": {
        "network": "tcp",
        "address": "cockroach-1:26257"
      },
      "build_tag": "v25.3.0",
      "started_at": "2024-01-15T10:00:00Z",
      "locality": {
        "region": "us-east-1",
        "zone": "us-east-1a"
      },
      "liveness_status": "LIVE",
      "hardware": {
        "cpu_count": 4,
        "memory_bytes": 17179869184
      }
    },
    {
      "node_id": 2,
      "address": {
        "network": "tcp",
        "address": "cockroach-2:26257"
      },
      "build_tag": "v25.3.0",
      "started_at": "2024-01-15T10:01:00Z",
      "locality": {
        "region": "us-east-1",
        "zone": "us-east-1b"
      },
      "liveness_status": "LIVE"
    }
  ]
}
nodes
array
Array of node objects

List Node Ranges

Get details on the ranges stored on a specific node.
GET /api/v2/nodes/{node_id}/ranges
curl --request GET \
  --url https://localhost:8080/api/v2/nodes/{node_id}/ranges \
  --header 'X-Cockroach-API-Session: {session_token}'
Stability: Unstable

Path Parameters

node_id
integer
required
Unique identifier for the node

Response

{
  "ranges": [
    {
      "range_id": 42,
      "start_key": "/Table/52",
      "end_key": "/Table/52/1",
      "replicas": [
        {
          "node_id": 1,
          "store_id": 1,
          "replica_id": 1
        },
        {
          "node_id": 2,
          "store_id": 2,
          "replica_id": 2
        }
      ],
      "lease_holder": 1,
      "range_size_bytes": 134217728
    }
  ]
}
ranges
array
Array of range objects on this node

List Hot Ranges

Get information on ranges receiving a high number of reads or writes.
GET /api/v2/ranges/hot
curl --request GET \
  --url https://localhost:8080/api/v2/ranges/hot \
  --header 'X-Cockroach-API-Session: {session_token}'
Stability: Stable

Response

{
  "hot_ranges": [
    {
      "range_id": 156,
      "node_id": 1,
      "qps": 1250.5,
      "writes_per_second": 500.2,
      "reads_per_second": 750.3,
      "database": "production",
      "table": "orders",
      "index": "primary"
    },
    {
      "range_id": 89,
      "node_id": 3,
      "qps": 890.1,
      "writes_per_second": 290.4,
      "reads_per_second": 599.7,
      "database": "production",
      "table": "users",
      "index": "users_email_idx"
    }
  ]
}
hot_ranges
array
Array of hot range objects

Get Range Details

Get detailed technical information on a specific range.
GET /api/v2/ranges/{range_id}
curl --request GET \
  --url https://localhost:8080/api/v2/ranges/{range_id} \
  --header 'X-Cockroach-API-Session: {session_token}'
Stability: Unstable
This endpoint is typically used by Cockroach Labs engineers for deep troubleshooting.

Path Parameters

range_id
integer
required
Unique identifier for the range

List Sessions

Get SQL session details for all current users or a specified user.
GET /api/v2/sessions
curl --request GET \
  --url https://localhost:8080/api/v2/sessions \
  --header 'X-Cockroach-API-Session: {session_token}'
Stability: Unstable

Query Parameters

username
string
Filter sessions by username

Response

{
  "sessions": [
    {
      "node_id": 1,
      "session_id": "16b4e1d5f2a3c8d0",
      "username": "app_user",
      "client_address": "192.168.1.100:54321",
      "application_name": "payment_service",
      "active_queries": [
        {
          "sql": "SELECT * FROM orders WHERE status = $1",
          "start": "2024-01-15T14:30:00Z",
          "phase": "executing"
        }
      ],
      "session_start": "2024-01-15T14:00:00Z",
      "oldest_query_start": "2024-01-15T14:30:00Z"
    }
  ]
}
sessions
array
Array of active session objects

List Events

List the latest cluster events in descending order.
GET /api/v2/events
curl --request GET \
  --url https://localhost:8080/api/v2/events \
  --header 'X-Cockroach-API-Session: {session_token}'
Stability: Unstable

Query Parameters

limit
integer
default:"100"
Maximum number of events to return
type
string
Filter by event type (e.g., node_join, node_restart)

Response

{
  "events": [
    {
      "timestamp": "2024-01-15T14:35:00Z",
      "event_type": "node_restart",
      "node_id": 2,
      "info": {
        "reason": "planned maintenance"
      }
    },
    {
      "timestamp": "2024-01-15T10:00:00Z",
      "event_type": "create_database",
      "user": "admin",
      "info": {
        "database_name": "production"
      }
    },
    {
      "timestamp": "2024-01-14T16:20:00Z",
      "event_type": "drop_table",
      "user": "admin",
      "info": {
        "database_name": "test",
        "table_name": "old_data"
      }
    }
  ]
}
events
array
Array of event objects in descending chronological order

List Users

List all SQL users on the cluster.
GET /api/v2/users
curl --request GET \
  --url https://localhost:8080/api/v2/users \
  --header 'X-Cockroach-API-Session: {session_token}'
Stability: Stable

Response

{
  "users": [
    {
      "username": "admin"
    },
    {
      "username": "app_user"
    },
    {
      "username": "readonly"
    }
  ]
}

Common Use Cases

Use /nodes to track which nodes are online and their versions:
curl -X GET https://localhost:8080/api/v2/nodes \
  -H 'X-Cockroach-API-Session: {token}' \
  | jq '.nodes[] | {node_id, build_tag, liveness_status}'
Use /ranges/hot to find ranges with high QPS:
curl -X GET https://localhost:8080/api/v2/ranges/hot \
  -H 'X-Cockroach-API-Session: {token}' \
  | jq '.hot_ranges | sort_by(.qps) | reverse | .[0:5]'
Use /sessions to monitor current SQL sessions:
curl -X GET https://localhost:8080/api/v2/sessions \
  -H 'X-Cockroach-API-Session: {token}' \
  | jq '.sessions | length'
Use /events to track administrative actions:
curl -X GET 'https://localhost:8080/api/v2/events?type=create_database' \
  -H 'X-Cockroach-API-Session: {token}'

API Reference

For complete endpoint specifications, request/response schemas, and examples, refer to: Cluster API v2 Reference

Build docs developers (and LLMs) love