Skip to content

fix(prometheusmetrics): ensure periodic metrics tick on startup #7585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 2, 2023

Conversation

coadler
Copy link
Contributor

@coadler coadler commented May 17, 2023

This ensures that metrics are populated on startup, rather than sitting empty until the first tick.

@coadler coadler self-assigned this May 17, 2023
@github-actions
Copy link

This Pull Request is becoming stale. In order to minimize WIP, prevent merge conflicts and keep the tracker readable, I'm going close to this PR in 3 days if there isn't more activity.

@github-actions github-actions bot added the stale This issue is like stale bread. label May 25, 2023
@coadler coadler removed the stale This issue is like stale bread. label May 25, 2023
@github-actions github-actions bot added the stale This issue is like stale bread. label Jun 2, 2023
@coadler coadler removed the stale This issue is like stale bread. label Jun 2, 2023
@coadler coadler requested a review from mtojek June 2, 2023 01:17
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as CI is happy about this change, I'm fine with it too 👍 .

Comment on lines +103 to +105
ticker := time.NewTicker(time.Nanosecond)
doTick := func() {
defer ticker.Reset(duration)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice trick!

@coadler coadler merged commit 8f736fe into main Jun 2, 2023
@coadler coadler deleted the colin/prom-mets-initial-tick branch June 2, 2023 16:56
@github-actions github-actions bot locked and limited conversation to collaborators Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants