Flushing traces on application shutdown #7179
Replies: 2 comments
-
Hey thanks for the reproduction! Super helpful. Spans are only queued up to be exported once In this case, when To see this in action:
|
Beta Was this translation helpful? Give feedback.
-
I think tomcat waits for active requests to complete during a graceful shutdown. @matthewwoodruff can you confirm whether Span.end() is called on that final request (parent span)? it could maybe be a shutdown hook ordering issue? |
Beta Was this translation helpful? Give feedback.
-
I'm building a spring boot application which implements and http api, carries out background jobs, and consumes messages from SQS. The app is configured to send any traces to honeycomb using the java agent.
However when the service is shutdown I am losing traces for currently running tasks. For example in-flight http requests, running jobs, consumption of messages from sqs. These traces are not appearing in honeycomb.
I have a simple app to recreate the problem here. When I terminate the app mid http requests I see the following output. In particular it looks like the
SimpleSpanProcessor
failed to export.Is there a way to ensure these traces are flushed before the application fully terminates?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions