Skip to content

freshness asked Prometheus 98 times per fill, now once (main) - #2944

Merged
Flotapponnier merged 1 commit into
mainfrom
hotfix/freshness-one-prom-query
Oct 10, 2026
Merged

Flotapponnier merged 1 commit into
mainfrom
hotfix/freshness-one-prom-query

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Cherry-pick of #2942 (git cherry-pick -x e8a3260c), applied cleanly. Only this fix, nothing else from dev.

/api/freshness made 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.

/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)
@Flotapponnier
Flotapponnier merged commit ce87318 into main Oct 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant