Skip to content

Index stats enhancement: creation date and tier_preference#116339

Merged
3kt merged 29 commits intoelastic:mainfrom
3kt:index_stats_enhancement
Nov 15, 2024
Merged

Index stats enhancement: creation date and tier_preference#116339
3kt merged 29 commits intoelastic:mainfrom
3kt:index_stats_enhancement

Conversation

@3kt
Copy link
Contributor

@3kt 3kt commented Nov 6, 2024

What

This adds two additional fields to the index stats API call response:

  • creation_date
  • tier_preference

Both information are transparently pushed from the IndexMetadata class, otherwise natively displayed in the index settings.

A stats call against an index would give such a response:

[...]
  "indices": {
    "foobar": {
      "uuid": "H3BofqE4QWqk21PZk314pg",
      "health": "yellow",
      "status": "open",
      "tier_preference": [
        "data_content"
      ],
      "creation_date": 1730912491278,
      "primaries": {
        "docs": {
          "count": 1,
          "deleted": 0,
          "total_size_in_bytes": 5208
        },
[...]

This is similar to #81954

Why

In their current state, the index stats are hard to consume for users, as most exposed stats are increasing counters. Giving contextual information such as when the index was created or what data tier it currently lives in allows users to answer questions like:

  • What is my relative usage (query time, storage, index time, etc...) for one data tier compared to another?
  • Within a given data tier, what index is the most used?
  • What is my relative usage, as function of the index age?

@elasticsearchmachine elasticsearchmachine added v9.0.0 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Nov 6, 2024
@3kt 3kt force-pushed the index_stats_enhancement branch from 8efa052 to 2d471ce Compare November 6, 2024 16:50
@3kt 3kt marked this pull request as ready for review November 8, 2024 10:59
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Nov 8, 2024
@3kt 3kt force-pushed the index_stats_enhancement branch 2 times, most recently from 0ef0ec8 to e6113ef Compare November 11, 2024 19:09
@3kt 3kt force-pushed the index_stats_enhancement branch from 2a51af2 to 6326bba Compare November 12, 2024 16:27
@3kt 3kt added :Core/Infra/Stats Statistics tracking and retrieval APIs >feature labels Nov 13, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label Nov 13, 2024
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine removed the needs:triage Requires assignment of a team area label label Nov 13, 2024
@elasticsearchmachine
Copy link
Collaborator

Hi @3kt, I've created a changelog YAML for you.

@dakrone dakrone self-assigned this Nov 14, 2024
@dakrone dakrone self-requested a review November 14, 2024 16:32
Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@3kt 3kt merged commit e0af123 into elastic:main Nov 15, 2024
3kt added a commit that referenced this pull request Nov 15, 2024
3kt added a commit to 3kt/elasticsearch that referenced this pull request Nov 15, 2024
…16339)

* Expose tier preference as part of the index stats
* Also expose index creation date in index stats
* Added test
joegallo added a commit that referenced this pull request Nov 15, 2024
@joegallo
Copy link
Contributor

I went to revert this, but it involves a TransportVersion change, so it's not quite as trivial as hitting revert and merging the resulting PR, so I'm ignoring this for now. I imagine @elastic/es-data-management will discuss again on Monday and figure out a way forward.

@3kt
Copy link
Contributor Author

3kt commented Nov 15, 2024

What's the matter @joegallo ? Are there implications I didn't foresee?

@3kt 3kt deleted the index_stats_enhancement branch November 15, 2024 17:25
salvatore-campagna pushed a commit to salvatore-campagna/elasticsearch that referenced this pull request Nov 18, 2024
…16339)

* Expose tier preference as part of the index stats
* Also expose index creation date in index stats
* Added test
@dakrone
Copy link
Member

dakrone commented Nov 18, 2024

@3kt yes, we discussed this as a Data Management team, and decided we didn't want to pursue this (and not in this format also). I'm sorry, I hadn't had a chance to comment that yet on the PR before it was reviewed.

DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Nov 18, 2024
DaveCTurner pushed a commit to DaveCTurner/elasticsearch that referenced this pull request Nov 18, 2024
This change was reverted with a new transport protocol in `main` so we
must backport the new protocol versions to `8.x`.
DaveCTurner added a commit that referenced this pull request Nov 18, 2024
This change was reverted with a new transport protocol in `main` so we
must backport the new protocol versions to `8.x`.
rjernst pushed a commit to rjernst/elasticsearch that referenced this pull request Nov 20, 2024
alexey-ivanov-es pushed a commit to alexey-ivanov-es/elasticsearch that referenced this pull request Nov 28, 2024
…16339)

* Expose tier preference as part of the index stats
* Also expose index creation date in index stats
* Added test
alexey-ivanov-es pushed a commit to alexey-ivanov-es/elasticsearch that referenced this pull request Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Stats Statistics tracking and retrieval APIs external-contributor Pull request authored by a developer outside the Elasticsearch team >feature Team:Data Management (obsolete) DO NOT USE. This team no longer exists. v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants