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

Give reporters a final chance to flush data before stopping #533

Closed
ivantopo opened this issue May 8, 2018 · 1 comment · Fixed by #811
Closed

Give reporters a final chance to flush data before stopping #533

ivantopo opened this issue May 8, 2018 · 1 comment · Fixed by #811

Comments

@ivantopo
Copy link
Contributor

ivantopo commented May 8, 2018

In the particular case of all reporters being shut down because of the JVM exiting we should have a means of reporting whatever data has been accumulated since the last tick before completely stopping the reporters. I think the flow should be:

  1. Kamon.stopAllReporters() is called
  2. Whatever state is available for metrics and span reporters is flushed via reportPeriodSnapshots/reportSpans
  3. The stop hook is called
  4. After completing all the above successfully or a timeout is reached Kamon finishes shutting down the reporters.
@l15k4
Copy link

l15k4 commented Jan 9, 2019

Yeah this is pretty important. I run a lot of kubernetes jobs that just shut jvm down after their are done and metrics are not flushed after Kamon.stopAllReporters() ... I would simply have to Thread.sleep :-/

Also some monitoring services like Stackdriver doesn't allow for tick-interval less than 15 seconds as you'd reach quota... so I'd have to Thread.sleep(15000) :-/

ivantopo added a commit to ivantopo/Kamon that referenced this issue Jul 22, 2020
…report the last bit of data before being stopped. Fixes kamon-io#533
ivantopo added a commit that referenced this issue Jul 22, 2020
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 a pull request may close this issue.

2 participants