get-lifecycle-stats.asciidoc 2.8 KB

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