1

I would like to have some health checks, that OpenSearch Dashboards is running, as I expected. I would like to get via some API calls some usage statistics similar, like in Kibana.

Have OpenSearch Dashboards some statistical API endpoints? If yes, can you please share a link to it?

My goal is periodical checks from some script the endpoints and watching values on them.

Many thanks for feedback!

Adavan
  • 63
  • 2
  • 6

1 Answers1

1

I found it:

$ curl -s -u<OSDashUserName>:<OSDashUserPass> http://localhost:5601/api/status | jq .metrics
{
  "last_updated": "2022-11-03T08:00:11.140Z",
  "collection_interval_in_millis": 5000,
  "os": {
    "platform": "linux",
    "platformRelease": "linux-5.10.141-garden-cloud-amd64",
    "load": {
      "1m": 0.53,
      "5m": 0.47,
      "15m": 0.37
    },
    "memory": {
      "total_in_bytes": 16478601216,
      "free_in_bytes": 188170240,
      "used_in_bytes": 16290430976
    },
    "uptime_in_millis": 3431150,
    "distro": "Amazon Linux",
    "distroRelease": "Amazon Linux-2 (Karoo)",
    "cpuacct": {
      "control_group": "/",
      "usage_nanos": 10580524069
    },
    "cpu": {
      "control_group": "/",
      "cfs_period_micros": 100000,
      "cfs_quota_micros": -1,
      "stat": {
        "number_of_elapsed_periods": 0,
        "number_of_times_throttled": 0,
        "time_throttled_nanos": 0
      }
    }
  },
  "process": {
    "memory": {
      "heap": {
        "total_in_bytes": 96047104,
        "used_in_bytes": 89635760,
        "size_limit": 2949644288
      },
      "resident_set_size_in_bytes": 151777280
    },
    "pid": 1,
    "event_loop_delay": 1.2602479998022318,
    "uptime_in_millis": 2719841.143137
  },
  "response_times": {
    "avg_in_millis": 0,
    "max_in_millis": 0
  },
  "concurrent_connections": 0,
  "requests": {
    "disconnects": 0,
    "total": 0,
    "statusCodes": {},
    "status_codes": {}
  }
}
Adavan
  • 63
  • 2
  • 6