Skip to content

Expose Last Index Request Timestamp in Cat Indices API#18405

Merged
msfroh merged 13 commits intoopensearch-project:mainfrom
rgsriram:index-stats-issue-10766
Jun 25, 2025
Merged

Expose Last Index Request Timestamp in Cat Indices API#18405
msfroh merged 13 commits intoopensearch-project:mainfrom
rgsriram:index-stats-issue-10766

Conversation

@rgsriram
Copy link
Copy Markdown
Contributor

Description

This PR enhances the _cat/indices API by adding two new columns to report the timestamp of the last index request processed for each index:

  • last_index_request_timestamp: The raw timestamp in milliseconds since epoch.
  • last_index_request_timestamp.string: The same timestamp in a human-readable UTC ISO 8601 format.

This mirrors the existing approach for creation.date and creation.date.string, providing both a machine-friendly and a human-friendly representation.

Details

  • The last_index_request_timestamp is updated on successful index and delete operations.
  • The cat indices API now exposes both the raw and formatted timestamp columns.
  • The columns can be queried as follows:
    GET _cat/indices?v&h=index,last_index_request_timestamp,last_index_request_timestamp.string

Manual Testing

  • Create an index and index a document.
  • Query the cat indices API with the new columns.
  • Confirm that the millisecond and string columns are present and correct.
  • Index another document and confirm the timestamp updates.
  • Test with multiple indices and edge cases (no docs, deleted index).

Related Issues

Resolves #10766

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@github-actions
Copy link
Copy Markdown
Contributor

❌ Gradle check result for 3bfecce: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 1, 2025

❌ Gradle check result for 7678134: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

rgsriram added 11 commits June 24, 2025 22:36
Signed-off-by: Sriram Ganesh <srignsh22@gmail.com>
Signed-off-by: Sriram Ganesh <srignsh22@gmail.com>
Signed-off-by: Sriram Ganesh <srignsh22@gmail.com>
Signed-off-by: Sriram Ganesh <srignsh22@gmail.com>
Signed-off-by: Sriram Ganesh <srignsh22@gmail.com>
Signed-off-by: Sriram Ganesh <srignsh22@gmail.com>
Signed-off-by: Sriram Ganesh <srignsh22@gmail.com>
Signed-off-by: Sriram Ganesh <srignsh22@gmail.com>
Signed-off-by: Sriram Ganesh <srignsh22@gmail.com>
Signed-off-by: Sriram Ganesh <srignsh22@gmail.com>
Signed-off-by: Sriram Ganesh <srignsh22@gmail.com>
@rgsriram rgsriram force-pushed the index-stats-issue-10766 branch from 8760b58 to 26d366b Compare June 24, 2025 17:06
@github-actions
Copy link
Copy Markdown
Contributor

✅ Gradle check result for 26d366b: SUCCESS

Signed-off-by: Andrew Ross <andrross@amazon.com>
@andrross
Copy link
Copy Markdown
Member

Looks good to me, @msfroh. I fixed up the changelog so lets merge this when the tests pass again.

Signed-off-by: Andrew Ross <andrross@amazon.com>
@github-actions
Copy link
Copy Markdown
Contributor

❕ Gradle check result for 874981e: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@msfroh msfroh merged commit 9bfc863 into opensearch-project:main Jun 25, 2025
31 checks passed
tandonks pushed a commit to tandonks/OpenSearch that referenced this pull request Aug 5, 2025
…oject#18405)

---------

Signed-off-by: Sriram Ganesh <srignsh22@gmail.com>
Signed-off-by: Andrew Ross <andrross@amazon.com>
Co-authored-by: Andrew Ross <andrross@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement or improvement to existing feature or request Indexing & Search

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants