Skip to content
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

ScheduledReporter reports metrics when stopped/closed even when not started #4135

Closed
ummels opened this issue Apr 26, 2024 · 2 comments · Fixed by #4246 or #4479
Closed

ScheduledReporter reports metrics when stopped/closed even when not started #4135

ummels opened this issue Apr 26, 2024 · 2 comments · Fixed by #4246 or #4479
Labels
Milestone

Comments

@ummels
Copy link
Contributor

ummels commented Apr 26, 2024

ScheduledReporter's close method calls its stop method, which calls report to report the metrics "one last time". This also happens if start has never been called.

In a SpringBoot application that registers a ScheduledReporter as a bean, this can lead to strange behavior since the stop method is automatically called by Spring Boot.

@mikebell90
Copy link
Contributor

My assumption is the logic was indeed "one last time" or metrics would be lost.
What's wrong with this? I suspect you could subclass and override close. And track with AtomicBoolean.compareAndSet

@ummels
Copy link
Contributor Author

ummels commented Jun 16, 2024

I've opened #4246 for this issue. I've just added a check whether the reporter has been started.

@joschi joschi added the bug label Oct 3, 2024
@joschi joschi added this to the 4.2.28 milestone Oct 3, 2024
@joschi joschi closed this as completed in f0bb90d Oct 3, 2024
joschi pushed a commit that referenced this issue Oct 3, 2024
@joschi joschi linked a pull request Oct 3, 2024 that will close this issue
joschi added a commit that referenced this issue Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants