elastic / elasticsearch

Free and Open, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
68.7k stars 24.39k forks source link

[API][ILM Explain] Add stat for time since Index Rollover #103660

Open stefnestor opened 7 months ago

stefnestor commented 7 months ago

Description

👋 howdy, team!

Will you kindly consider having ILM Explain report (time_since_index_rollover, index_rollover_date_millis)?

We'd like to reduce users' manual steps to validate its age column calculation (as time since rollover fallback index creation).

Currently users have to review Cluster logs / ILM History index to see when index rolled over (if they have history back far enough). Otherwise, AFAICT they have no way to validate potential concerns on / backtrack how this column has calculated.

# GET _all/_ilm/explain | jq '.indices.".ds-metricbeat-8.10.1-2023.11.19-000003"|del(.phase_execution)'
{
  "action": "complete",
  "action_time_millis": 1703008092553,
  "age": "1.97d",
  "index": ".ds-metricbeat-8.10.1-2023.11.19-000003",
  "index_creation_date_millis": 1700415491342,
+ "index_rollover_date_millis": 1700501891000,
  "lifecycle_date_millis": 1703008091326,
  "managed": true,
  "phase": "hot",
  "phase_time_millis": 1700415491734,
  "policy": "metricbeat", # had rollover at 30d
  "step": "complete",
  "step_time_millis": 1703008092553,
  "time_since_index_creation": "31.98d"
+ "time_since_index_rollover": "30.01d"
}
elasticsearchmachine commented 7 months ago

Pinging @elastic/es-data-management (Team:Data Management)