get-lifecycle-stats.asciidoc 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. [[data-streams-get-lifecycle-stats]]
  2. === Get data stream lifecycle stats
  3. ++++
  4. <titleabbrev>Get Data Stream Lifecycle</titleabbrev>
  5. ++++
  6. Gets stats about the execution of data stream lifecycle.
  7. [[get-lifecycle-stats-api-prereqs]]
  8. ==== {api-prereq-title}
  9. * If the {es} {security-features} are enabled, you must have the `monitor` or
  10. `manage` <<privileges-list-cluster,cluster privilege>> to use this API.
  11. [[data-streams-get-lifecycle-stats-request]]
  12. ==== {api-request-title}
  13. `GET _lifecycle/stats`
  14. [[data-streams-get-lifecycle-stats-desc]]
  15. ==== {api-description-title}
  16. Gets stats about the execution of the data stream lifecycle. The data stream level stats include only stats about data streams
  17. managed by the data stream lifecycle.
  18. [[get-lifecycle-stats-api-response-body]]
  19. ==== {api-response-body-title}
  20. `last_run_duration_in_millis`::
  21. (Optional, long)
  22. The duration of the last data stream lifecycle execution.
  23. `time_between_starts_in_millis`::
  24. (Optional, long)
  25. The time passed between the start of the last two data stream lifecycle executions. This should amount approximately to
  26. <<data-streams-lifecycle-poll-interval,`data_streams.lifecycle.poll_interval`>>.
  27. `data_stream_count`::
  28. (integer)
  29. The count of data streams currently being managed by the data stream lifecycle.
  30. `data_streams`::
  31. (array of objects)
  32. Contains information about the retrieved data stream lifecycles.
  33. +
  34. .Properties of objects in `data_streams`
  35. [%collapsible%open]
  36. ====
  37. `name`::
  38. (string)
  39. The name of the data stream.
  40. `backing_indices_in_total`::
  41. (integer)
  42. The count of the backing indices of this data stream that are managed by the data stream lifecycle.
  43. `backing_indices_in_error`::
  44. (integer)
  45. The count of the backing indices of this data stream that are managed by the data stream lifecycle and have encountered an error.
  46. ====
  47. [[data-streams-get-lifecycle-stats-example]]
  48. ==== {api-examples-title}
  49. Let's retrieve the data stream lifecycle stats of a cluster that has already executed the lifecycle more than once:
  50. [source,console]
  51. --------------------------------------------------
  52. GET _lifecycle/stats?human&pretty
  53. --------------------------------------------------
  54. // TEST[skip:this is for demonstration purposes only, we cannot ensure that DSL has run]
  55. The response will look like the following:
  56. [source,console-result]
  57. --------------------------------------------------
  58. {
  59. "last_run_duration_in_millis": 2,
  60. "last_run_duration": "2ms",
  61. "time_between_starts_in_millis": 9998,
  62. "time_between_starts": "9.99s",
  63. "data_streams_count": 2,
  64. "data_streams": [
  65. {
  66. "name": "my-data-stream",
  67. "backing_indices_in_total": 2,
  68. "backing_indices_in_error": 0
  69. },
  70. {
  71. "name": "my-other-stream",
  72. "backing_indices_in_total": 2,
  73. "backing_indices_in_error": 1
  74. }
  75. ]
  76. }
  77. --------------------------------------------------