elasticsearch/docs/reference/rest-api
Mary Gouseti c1a2d390ef
Update data stream lifecycle telemetry to track global retention (#112451)
Currently, the data stream lifecycle telemetry has the following
structure:

```
{
....
  "data_lifecycle" : {
    "available": true,
    "enabled": true,
    "count": 0,
    "default_rollover_used": true,
    "retention": {
        "minimum_millis": 0,
        "maximum_millis": 0,
        "average_millis": 0.0
    }
  }....
```

In the snippet above you can see that we track:

- The amount of data streams managed by the data stream lifecycle by `count`
- If the default rollover has been overwritten by `default_rollover_used`
- The min, max and average of the `data_retention` configured on a data stream level.

In this PR we propose the following extention:

```
....
  "data_lifecycle" : {
    "available": true,
    "enabled": true,
    "count": 0,
    "default_rollover_used": true,
    "effective_retention": { #https://github.com/elastic/dev/issues/2537
        "retained_data_streams": 5,
        "minimum_millis": 0, # Only if retained data streams > 1
        "maximum_millis": 0,
        "average_millis": 0.0
    },
    "data_retention": {
        "configured_data_streams": 5,
        "minimum_millis": 0, # Only if retained data streams > 1
        "maximum_millis": 0,
        "average_millis": 0.0
    },
    "global_retention": {
      "default": {
         "defined": true/false,
	  "affected_data_streams": 0,
         "millis": 0 
      },
      "max": {
         "defined": true/false,
	  "affected_data_streams": 0,
         "millis": 0 
      }
    }
```

With this extension we are tracking:

- The amount of data streams managed by the data stream lifecycle by `count`
- If the default rollover has been overwritten by `default_rollover_used`
- The min, max and average of the `data_retention` configured on a data stream level and the number of data streams that have it configured. We add the min, max and avg only if there are data streams with data retention configuration to avoid messing with the stats in a dashboard.
- The min, max and average of the `effective_retention` and the number of data streams that are retained. We add the min, max and avg only if there are retained data streams to avoid messing with the stats in a dashboard.
- Global retention stats, if they are defined, if the number of the affected data streams and the actual value.

The above metrics allow us to answer questions like:

- How many data streams are affected by global retention.
- How big is the difference between the longest data retention compared to max global retention.
- How much does the effective retention diverging from the data retention, this will show the impact of the global retention.
2024-09-11 18:31:04 +10:00
..
logstash [DOCS] Move x-pack docs to docs/reference dir (#99209) 2023-09-12 14:53:41 -04:00
security Clean up global retention from the cluster state and obsolete transport actions (#111636) 2024-08-08 09:52:35 +03:00
watcher [DOCS] Align docs to implementation for timeout parameters (#108593) 2024-05-16 13:05:39 +10:00
common-options.asciidoc Typo in example of the filter_path option (#84551) (#84661) 2022-03-04 09:10:55 -05:00
common-parms.asciidoc Updating retriever documentation to better explain how filters are applied (#112201) 2024-08-26 16:15:31 +03:00
cron-expressions.asciidoc [DOCS] Add info about GET/POST to the API conventions. (#74529) 2021-06-30 09:24:42 -07:00
defs.asciidoc [DOCS] Refactor book-scoped variables in docs/reference/index.asciidoc (#107413) 2024-04-17 14:37:07 +02:00
index.asciidoc [DOCS] Refactor book-scoped variables in docs/reference/index.asciidoc (#107413) 2024-04-17 14:37:07 +02:00
info.asciidoc Enable Universal Profiling as Enterprise feature (#100333) 2023-10-09 07:58:04 +02:00
rest-api-compatibility.asciidoc [DOCS] Link to the 7.17 upgrade assistant docs (#83613) (#83615) 2022-02-07 18:29:26 -05:00
root.asciidoc (DOC+) Version API page for ES API Base URL (#105845) 2024-03-18 13:02:54 -06:00
security.asciidoc DOCS Query Roles (#110473) 2024-07-05 19:46:48 +10:00
usage.asciidoc Update data stream lifecycle telemetry to track global retention (#112451) 2024-09-11 18:31:04 +10:00
watcher.asciidoc [DOCS] Move x-pack docs to docs/reference dir (#99209) 2023-09-12 14:53:41 -04:00