Get Watcher statistics
- GET /_watcher/stats/{metric}
- GET /_watcher/stats
This API always returns basic metrics. You retrieve more metrics by using the metric parameter.
- Cluster privileges:
monitor_watcher
Path Parameters
-
metricWatcherMetric | WatcherMetricoptional -
Defines which additional metrics are included in the response.
Supported values include:
_all(orall),queued_watches,current_watches,pending_watchesLeave it out to use
/_watcher/stats. -
Values:
_allallqueued_watchescurrent_watchespending_watches
Query Parameters
-
emit_stacktracesboolean · default: false Defines whether stack traces are generated for each watch that is running.
-
metricWatcherMetric | WatcherMetric Defines which additional metrics are included in the response.
Supported values include:
_all(orall),queued_watches,current_watches,pending_watches-
Values:
_allallqueued_watchescurrent_watchespending_watches
Response
-
_nodesNodeStatisticsrequired -
failuresErrorCause -
typestringrequired -
The type of error
-
reasonstringnullable -
A human-readable explanation of the error, in English.
-
stack_tracestring -
The server stack trace. Present only if the
error_trace=trueparameter was sent with the request. -
caused_byErrorCause -
root_causeErrorCause -
suppressedErrorCause -
totalnumberrequired -
Total number of nodes selected by the request.
-
successfulnumberrequired -
Number of nodes that responded successfully to the request.
-
failednumberrequired -
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 Namerequired -
manually_stoppedbooleanrequired -
statsWatcherNodeStatsrequired -
current_watchesWatchRecordStats -
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, themetricoption should be set tocurrent_watchesor_all. In addition you can also specify theemit_stacktraces=trueparameter, 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. -
execution_timeDateTimerequired -
The time the watch was run. This is just before the input is being run.
-
execution_phaseExecutionPhaserequired -
The current watch execution phase.
-
Values:
awaits_executionstartedinputconditionactionswatch_transformabortedfinished -
triggered_timeDateTimerequired -
The time the watch was triggered by the trigger engine.
-
executed_actionsstring -
watch_idstring Idrequired -
watch_record_idstring Idrequired -
The watch record identifier.
-
execution_thread_poolExecutionThreadPoolrequired -
max_sizenumberrequired -
The largest size of the execution thread pool, which indicates the largest number of concurrent running watches.
-
queue_sizenumberrequired -
The number of watches that were triggered and are currently queued.
-
queued_watchesWatchRecordQueuedStats -
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
metricoption should includequeued_watchesor_all. -
execution_timeDateTimerequired -
The time the watch was run. This is just before the input is being run.
-
watch_countnumberrequired -
The number of watches currently registered.
-
watcher_stateWatcherStaterequired -
The current state of Watcher.
-
Values:
stoppedstartingstartedstopping -
node_idstring Idrequired