123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- [role="xpack"]
- [[enrich-stats-api]]
- === Enrich stats API
- ++++
- <titleabbrev>Enrich stats</titleabbrev>
- ++++
- Returns <<coordinating-node,enrich coordinator>> statistics
- and information about <<enrich-policy,enrich policies>>
- that are currently executing.
- [source,console]
- ----
- GET /_enrich/_stats
- ----
- [[enrich-stats-api-request]]
- ==== {api-request-title}
- `GET /_enrich/_stats`
- [[enrich-stats-api-response-body]]
- ==== {api-response-body-title}
- `executing_policies`::
- +
- --
- (Array of objects)
- Objects containing information
- about each enrich policy
- that is currently executing.
- Returned parameters include:
- `name`::
- (String)
- Name of the enrich policy.
- `task`::
- (<<tasks,Task object>>)
- Object containing detailed information
- about the policy execution task.
- --
- `coordinator_stats`::
- +
- --
- (Array of objects)
- Objects containing information
- about each <<coordinating-node,coordinating ingest node>>
- for configured enrich processors.
- Returned parameters include:
- `node_id`::
- (String)
- ID of the ingest node coordinating search requests
- for configured enrich processors.
- `queue_size`::
- (Integer)
- Number of search requests in the queue.
- `remote_requests_current`::
- (Integer)
- Current number of outstanding remote requests.
- `remote_requests_total`::
- (Integer)
- Number of outstanding remote requests executed
- since node startup.
- +
- In most cases,
- a remote request includes multiple search requests.
- This depends on the number of search requests in the queue
- when the remote request is executed.
- `executed_searches_total`::
- (Integer)
- Number of search requests
- that enrich processors have executed
- since node startup.
- --
- `cache_stats`::
- +
- --
- (Array of objects)
- Objects containing information about the enrich
- cache stats on each ingest node.
- Returned parameters include:
- `node_id`::
- (String)
- ID of the ingest node with a enrich cache.
- `count`::
- (Integer)
- Number of cached entries.
- `hits`::
- (Integer)
- The number of enrich lookups served from cache.
- `misses`::
- (Integer)
- The number of time enrich lookups couldn't be
- served from cache.
- `evictions`::
- (Integer)
- The number cache entries evicted from the cache.
- `hits_time_in_millis`::
- (Long)
- The amount of time in milliseconds spent fetching data from the cache on successful cache hits only.
- `misses_time_in_millis`::
- (Long)
- The amount of time in milliseconds spent fetching data from the enrich index and updating the cache, on cache misses only.
- `size_in_bytes`::
- (Long)
- An _approximation_ of the size in bytes that the enrich cache takes up on the heap.
- --
- [[enrich-stats-api-example]]
- ==== {api-examples-title}
- [source,console]
- ----
- GET /_enrich/_stats
- ----
- //TEST[s/^/PUT \/_enrich\/policy\/my-policy\/_execute\/n/\
- The API returns the following response:
- [source,console-result]
- ----
- {
- "executing_policies": [
- {
- "name": "my-policy",
- "task": {
- "id": 124,
- "type": "direct",
- "action": "cluster:admin/xpack/enrich/execute",
- "start_time_in_millis": 1458585884904,
- "running_time_in_nanos": 47402,
- "cancellable": false,
- "parent_task_id": "oTUltX4IQMOUUVeiohTt8A:123",
- "headers": {
- "X-Opaque-Id": "123456"
- }
- }
- }
- ],
- "coordinator_stats": [
- {
- "node_id": "1sFM8cmSROZYhPxVsiWew",
- "queue_size": 0,
- "remote_requests_current": 0,
- "remote_requests_total": 0,
- "executed_searches_total": 0
- }
- ],
- "cache_stats": [
- {
- "node_id": "1sFM8cmSROZYhPxVsiWew",
- "count": 0,
- "hits": 0,
- "misses": 0,
- "evictions": 0,
- "hits_time_in_millis": 0,
- "misses_time_in_millis": 0,
- "size_in_bytes": 0
- }
- ]
- }
- ----
- // TESTRESPONSE[s/"executing_policies": \[[^\]]*\]/"executing_policies": $body.$_path/]
- // TESTRESPONSE[s/"node_id": "1sFM8cmSROZYhPxVsiWew"/"node_id" : $body.coordinator_stats.0.node_id/]
- // TESTRESPONSE[s/"remote_requests_total": 0/"remote_requests_total" : $body.coordinator_stats.0.remote_requests_total/]
- // TESTRESPONSE[s/"executed_searches_total": 0/"executed_searches_total" : $body.coordinator_stats.0.executed_searches_total/]
- // TESTRESPONSE[s/"node_id": "1sFM8cmSROZYhPxVsiWew"/"node_id" : $body.cache_stats.0.node_id/]
- // TESTRESPONSE[s/"count": 0/"count" : $body.cache_stats.0.count/]
- // TESTRESPONSE[s/"misses": 0/"misses" : $body.cache_stats.0.misses/]
- // TESTRESPONSE[s/"evictions": 0/"evictions" : $body.cache_stats.0.evictions/]
- // TESTRESPONSE[s/"hits_time_in_millis": 0/"hits_time_in_millis" : $body.cache_stats.0.hits_time_in_millis/]
- // TESTRESPONSE[s/"misses_time_in_millis": 0/"misses_time_in_millis" : $body.cache_stats.0.misses_time_in_millis/]
- // TESTRESPONSE[s/"size_in_bytes": 0/"size_in_bytes" : $body.cache_stats.0.size_in_bytes/]
|