Skip to content

write_load stats should be part of the _data_stream/stats #91878

@Leaf-Lin

Description

@Leaf-Lin

Description

The _data_stream/stats API is very useful to inspect stats for different data streams.

With the development of write load forecast, that output (currently available as part of the _cluster/state) would be useful as part of the _data_stream/stats output.

Today (Available from 8.6.0+)

GET _cluster/state?filter_path=metadata.indices.*.write_load_forecast ==> outputs

{
  "metadata": {
    "indices": {
      ".ds-logs-nginx.access-default-2022.11.24-000036": {
        "write_load_forecast": 1.2954573361065367
      },
      ".ds-logs-apache.access-default-2022.11.24-000031": {
        "write_load_forecast": 0.45008927253567943
      },
      ".ds-logs-system.auth-default-2022.11.24-000036": {
        "write_load_forecast": 0.7586636338082635
      },
      ".ds-logs-apache.error-default-2022.11.24-000024": {
        "write_load_forecast": 0.25113676658227435
      },
      ".ds-logs-mysql.slowlog-default-2022.11.24-000026": {
        "write_load_forecast": 0.3289491559561291
      },
      ".ds-logs-nginx.error-default-2022.11.24-000016": {
        "write_load_forecast": 0.21366516152711212
      },
      ".ds-logs-redis.log-default-2022.11.24-000033": {
        "write_load_forecast": 0.6231658341667811
      },
      ".ds-logs-kafka.log-default-2022.11.24-000030": {
        "write_load_forecast": 0.39866356792008534
      },
      ".ds-logs-mysql.error-default-2022.11.24-000021": {
        "write_load_forecast": 0.18427148251749945
      },
      ".ds-logs-system.syslog-default-2022.11.24-000038": {
        "write_load_forecast": 2.0298853475522236
      }
    }
  }
}

GET _data_stream/_stats ==> outputs

{
  "_shards": {
    "total": 294,
    "successful": 294,
    "failed": 0
  },
  "data_stream_count": 13,
  "backing_indices": 294,
  "total_store_size_bytes": 10609008870,
  "data_streams": [
    {
      "data_stream": "logs-apache.error-default",
      "backing_indices": 24,
      "store_size_bytes": 309615709,
      "maximum_timestamp": 1600169383871
    },
...

Expected:

GET _data_stream/_stats ==> outputs

{
  "_shards": {
    "total": 294,
    "successful": 294,
    "failed": 0
  },
  "data_stream_count": 13,
  "backing_indices": 294,
  "total_store_size_bytes": 10609008870,
  "data_streams": [
    {
      "data_stream": "logs-apache.error-default",
      "backing_indices": 24,
      "store_size_bytes": 309615709,
      "write_load_forecast": 0.25113676658227435,  <-- add this
      "maximum_timestamp": 1600169383871
    },
...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions