Skip to content

Update end_time_prometheus on every Prometheus fetch - #686

Merged
nurbal merged 4 commits into
masterfrom
fix-update-end-time-prometheus
Oct 1, 2026
Merged

nurbal merged 4 commits into
masterfrom
fix-update-end-time-prometheus

Conversation

@notoraptor

Copy link
Copy Markdown
Contributor

clusters.end_time_prometheus stops advancing even though Prometheus scraping keeps running: the SQL rewrite of the prometheus scraper dropped the set_auto_end_time() call, leaving init_insert() (python -m sarc.db) as the only writer — a command outside the fetch/parse pipeline. end_time_sacct was unaffected because the sacct scraper still updates it.

The fetch now updates the field on every poll, including polls with no job left to fetch. It records the last successful poll, not a data coverage horizon. The cache-based resync stays as a repair path, and the field recovers on the first poll after deployment.

The field lost its writer in the SQL migration of the prometheus scraper
when the interval-based fetch was dropped; only init_insert() still
synced it, and that does not run in the fetch/parse pipeline. Set it
with set_auto_end_time() at the end of every prometheus poll, including
polls with no job left to fetch.
Avoids re-indenting the fetch loop, trims the end-time comment, and
documents that the fetch commands advance the cluster watermarks.
@nurbal
nurbal merged commit a01bfab into master Oct 1, 2026
3 checks passed
@nurbal
nurbal deleted the fix-update-end-time-prometheus branch October 1, 2026 18:54
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.

2 participants