Repository navigation
freshness asked Prometheus 98 times per fill, now once (main) - #2944
Merged
Merged
Conversation
/api/freshness ran one instant query per live spec on every 30 s cache fill: 509k Prom queries a day, 30% of all outbound calls the project made, each billed as an Observability Event. Prometheus.dataAgesSec() folds them into one union query. timestamp() must wrap the bare selector, otherwise it returns evaluation time and every recording rule reads 0 s old, so each metric gets its own term. Checked live: 246/246 specs agree with the per-spec probe within one scrape interval, 77 metrics in ~240 ms. (cherry picked from commit e8a3260)
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.
Cherry-pick of #2942 (
git cherry-pick -x e8a3260c), applied cleanly. Only this fix, nothing else fromdev./api/freshnessmade one Prometheus query per live spec on every 30 s fill: 509k/day, 30% of all outbound calls, each billed as an Observability Event. Now one union query. Verified on prod Prom: 246/246 specs agree with the old probe within one scrape interval.