Get Watcher statistics Added in 5.5.0

GET /_watcher/stats/{metric}

This API always returns basic metrics. You retrieve more metrics by using the metric parameter.

Path parameters

  • metric string | array[string] Required

    Defines which additional metrics are included in the response.

Query parameters

  • Defines whether stack traces are generated for each watch that is running.

  • metric string | array[string]

    Defines which additional metrics are included in the response.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • _nodes object Required
      Hide _nodes attributes Show _nodes attributes object
      • failures array[object]
        Hide failures attributes Show failures attributes object
      • total number Required

        Total number of nodes selected by the request.

      • successful number Required

        Number of nodes that responded successfully to the request.

      • failed number Required

        Number of nodes that rejected the request or failed to respond. If this value is not 0, a reason for the rejection or failure is included in the response.

    • cluster_name string Required
    • manually_stopped boolean Required
    • stats array[object] Required
      Hide stats attributes Show stats attributes object
      • current_watches array[object]

        The current executing watches metric gives insight into the watches that are currently being executed by Watcher. Additional information is shared per watch that is currently executing. This information includes the watch_id, the time its execution started and its current execution phase. To include this metric, the metric option should be set to current_watches or _all. In addition you can also specify the emit_stacktraces=true parameter, which adds stack traces for each watch that is being run. These stack traces can give you more insight into an execution of a watch.

        Hide current_watches attributes Show current_watches attributes object
      • execution_thread_pool object Required
        Hide execution_thread_pool attributes Show execution_thread_pool attributes object
        • max_size number Required

          The largest size of the execution thread pool, which indicates the largest number of concurrent running watches.

        • queue_size number Required

          The number of watches that were triggered and are currently queued.

      • queued_watches array[object]

        Watcher moderates the execution of watches such that their execution won't put too much pressure on the node and its resources. If too many watches trigger concurrently and there isn't enough capacity to run them all, some of the watches are queued, waiting for the current running watches to finish.s The queued watches metric gives insight on these queued watches.

        To include this metric, the metric option should include queued_watches or _all.

        Hide queued_watches attribute Show queued_watches attribute object
      • watch_count number Required

        The number of watches currently registered.

      • watcher_state string Required

        Values are stopped, starting, started, or stopping.

      • node_id string Required
GET /_watcher/stats/{metric}
curl \
 --request GET http://api.example.com/_watcher/stats/{metric} \
 --header "Authorization: $API_KEY"
Response examples (200)
{
  "_nodes": {
    "failures": [
      {
        "type": "string",
        "reason": "string",
        "stack_trace": "string",
        "caused_by": {},
        "root_cause": [
          {}
        ],
        "suppressed": [
          {}
        ]
      }
    ],
    "total": 42.0,
    "successful": 42.0,
    "failed": 42.0
  },
  "cluster_name": "string",
  "manually_stopped": true,
  "stats": [
    {
      "current_watches": [
        {
          "execution_phase": "awaits_execution",
          "executed_actions": [
            "string"
          ],
          "watch_id": "string",
          "watch_record_id": "string"
        }
      ],
      "execution_thread_pool": {
        "max_size": 42.0,
        "queue_size": 42.0
      },
      "queued_watches": [
        {
          "": "string"
        }
      ],
      "watch_count": 42.0,
      "watcher_state": "stopped",
      "node_id": "string"
    }
  ]
}