Query parameters

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

  • metricstring | array[string]

    Defines which additional metrics are included in the response.

    Values are _all, all, queued_watches, current_watches, or pending_watches.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • _nodesobject Required

      Contains statistics about the number of nodes selected by the request.

      Hide _nodes attributes Show _nodes attributes object
      • failuresarray[object]

        Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

        Hide failures attributes Show failures attributes object
        • typestring Required

          The type of error

        • reasonstring | null

          A human-readable explanation of the error, in English.

        • The server stack trace. Present only if the error_trace=true parameter was sent with the request.

        • caused_byobject

          Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

        • root_causearray[object]

          Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

          Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

        • suppressedarray[object]

          Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

          Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

      • totalnumber Required

        Total number of nodes selected by the request.

      • successfulnumber Required

        Number of nodes that responded successfully to the request.

      • failednumber 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_namestring Required
    • manually_stoppedboolean Required
    • statsarray[object] Required
      Hide stats attributes Show stats attributes object
      • current_watchesarray[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_poolobject Required
        Hide execution_thread_pool attributes Show execution_thread_pool attributes object
      • queued_watchesarray[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_countnumber Required

        The number of watches currently registered.

      • watcher_statestring Required

        Values are stopped, starting, started, or stopping.

      • node_idstring Required
GET /_watcher/stats
GET _watcher/stats
resp = client.watcher.stats()
const response = await client.watcher.stats();
response = client.watcher.stats
$resp = $client->watcher()->stats();
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/stats"
Response examples (200)
A successful response from `GET _watcher/stats`.
{
  "watcher_state": "started",  
  "watch_count": 1, 
  "execution_thread_pool": {
    "size": 1000, 
    "max_size": 1 
  }
}
A successful response from `GET _watcher/stats?metric=current_watches`.
{
  "watcher_state": "started",
  "watch_count": 2,
  "execution_thread_pool": {
      "queue_size": 1000,
      "max_size": 20
  },
  "current_watches": [ 
      {
        "watch_id": "slow_condition", 
        "watch_record_id": "slow_condition_3-2015-05-13T07:42:32.179Z", 
        "triggered_time": "2015-05-12T11:53:51.800Z", 
        "execution_time": "2015-05-13T07:42:32.179Z", 
        "execution_phase": "condition" 
      }
  ]
}
An abbreviated response from `GET _watcher/stats/queued_watches`.
{
  "watcher_state": "started",
  "watch_count": 10,
  "execution_thread_pool": {
      "queue_size": 1000,
      "max_size": 20
  },
  "queued_watches": [ 
        {
            "watch_id": "slow_condition4", 
            "watch_record_id": "slow_condition4_223-2015-05-21T11:59:59.811Z", 
            "triggered_time": "2015-05-21T11:59:59.811Z", 
            "execution_time": "2015-05-21T11:59:59.811Z" 
        }
  ]
}