enrich-stats.asciidoc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[enrich-stats-api]]
  4. === Enrich stats API
  5. ++++
  6. <titleabbrev>Enrich stats</titleabbrev>
  7. ++++
  8. Returns <<coordinating-node,enrich coordinator>> statistics
  9. and information about <<enrich-policy,enrich policies>>
  10. that are currently executing.
  11. [source,console]
  12. ----
  13. GET /_enrich/_stats
  14. ----
  15. [[enrich-stats-api-request]]
  16. ==== {api-request-title}
  17. `GET /_enrich/_stats`
  18. [[enrich-stats-api-response-body]]
  19. ==== {api-response-body-title}
  20. `executing_policies`::
  21. +
  22. --
  23. (Array of objects)
  24. Objects containing information
  25. about each enrich policy
  26. that is currently executing.
  27. Returned parameters include:
  28. `name`::
  29. (String)
  30. Name of the enrich policy.
  31. `task`::
  32. (<<tasks,Task object>>)
  33. Object containing detailed information
  34. about the policy execution task.
  35. --
  36. `coordinator_stats`::
  37. +
  38. --
  39. (Array of objects)
  40. Objects containing information
  41. about each <<coordinating-node,coordinating ingest node>>
  42. for configured enrich processors.
  43. Returned parameters include:
  44. `node_id`::
  45. (String)
  46. ID of the ingest node coordinating search requests
  47. for configured enrich processors.
  48. `queue_size`::
  49. (Integer)
  50. Number of search requests in the queue.
  51. `remote_requests_current`::
  52. (Integer)
  53. Current number of outstanding remote requests.
  54. `remote_requests_total`::
  55. (Integer)
  56. Number of outstanding remote requests executed
  57. since node startup.
  58. +
  59. In most cases,
  60. a remote request includes multiple search requests.
  61. This depends on the number of search requests in the queue
  62. when the remote request is executed.
  63. `executed_searches_total`::
  64. (Integer)
  65. Number of search requests
  66. that enrich processors have executed
  67. since node startup.
  68. --
  69. [[enrich-stats-api-example]]
  70. ==== {api-examples-title}
  71. [source,console]
  72. ----
  73. GET /_enrich/_stats
  74. ----
  75. //TEST[s/^/PUT \/_enrich\/policy\/my-policy\/_execute\/n/\
  76. The API returns the following response:
  77. [source,console-result]
  78. ----
  79. {
  80. "executing_policies": [
  81. {
  82. "name": "my-policy",
  83. "task": {
  84. "id" : 124,
  85. "type" : "direct",
  86. "action" : "cluster:admin/xpack/enrich/execute",
  87. "start_time_in_millis" : 1458585884904,
  88. "running_time_in_nanos" : 47402,
  89. "cancellable" : false,
  90. "parent_task_id" : "oTUltX4IQMOUUVeiohTt8A:123",
  91. "headers" : {
  92. "X-Opaque-Id" : "123456"
  93. }
  94. }
  95. }
  96. ],
  97. "coordinator_stats": [
  98. {
  99. "node_id": "1sFM8cmSROZYhPxVsiWew",
  100. "queue_size": 0,
  101. "remote_requests_current": 0,
  102. "remote_requests_total": 0,
  103. "executed_searches_total": 0
  104. }
  105. ]
  106. }
  107. ----
  108. // TESTRESPONSE[s/"executing_policies": \[[^\]]*\]/"executing_policies": $body.$_path/]
  109. // TESTRESPONSE[s/"node_id": "1sFM8cmSROZYhPxVsiWew"/"node_id" : $body.coordinator_stats.0.node_id/]
  110. // TESTRESPONSE[s/"remote_requests_total": 0/"remote_requests_total" : $body.coordinator_stats.0.remote_requests_total/]
  111. // TESTRESPONSE[s/"executed_searches_total": 0/"executed_searches_total" : $body.coordinator_stats.0.executed_searches_total/]