Add indexed_dataset_version_time OTel gauge#1129
Open
leonhandreke wants to merge 1 commit intomainfrom
Open
Conversation
Tracks Unix timestamp of max last_seen across all documents per dataset, set after each successful catalog refresh. We'd ideally use last_export for this, but that's only available in the catalog index before the new index is loaded — once the catalog refresh completes, it's gone. So we derive freshness by max-aggregating last_seen across all indexed documents instead. - SearchProvider.get_index_max_date() runs a max aggregation on any date field, works for both ES and OpenSearch via the existing search() abstraction - yente/data/metrics.py holds the gauge and the update function - Triggered from indexer.py after alias rollover completes Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
@pudo how much do you hate this mechanism and do you have a better idea? Basically, I want to have a metric that makes it possible to alert on "default older than X". Right now, we can only export stale/not stale ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracks Unix timestamp of max
last_seenacross all documents per dataset, set after each successful catalog refresh. We'd ideally uselast_exportfor this, but that's only available in the catalog index before the new index is loaded — once the catalog refresh completes, it's gone. So we derive freshness by max-aggregatinglast_seenacross all indexed documents instead.Changes
SearchProvider.get_index_max_date()— new method on the base class that runs amaxaggregation on any date field; works for both ES and OpenSearch via the existingsearch()abstractionyente/data/metrics.py— new module holding the gauge andupdate_dataset_version_metric()indexer.py— calls the update function after alias rollover completestests/test_search_provider.py— covers empty index (→None) and the max-of-two case🤖 Generated with Claude Code
#1079