Get Watcher statistics
Added in 5.5.0
This API always returns basic metrics. You retrieve more metrics by using the metric parameter.
Query parameters
-
emit_stacktraces
boolean 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.
GET
/_watcher/stats
curl \
--request GET 'http://api.example.com/_watcher/stats' \
--header "Authorization: $API_KEY"
Response examples (200)
Basic metrics
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"
}
]
}