get-lifecycle-stats.asciidoc 2.9 KB

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