-
Notifications
You must be signed in to change notification settings - Fork 171
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
HTTP transporter does not send open records when node process is about to terminate #33
Comments
The reason we Anyway, would like to hear if anyone has a good solution. I do remember @eirslett telling me that high consistency isn't a requirement for Zipkin trace data, so I think that's why we might assume that if a few spans are lost as the server is coming down, it's an acceptable scenario. The problem of course is if your Node script just runs for a second or a half-second from start to finish, you'll never get anything unless you wait for the recorder to run. You can set the |
I would suggest adding a I already built this to fix my problem, could create a PR for this if wanted. |
That sounds like a good solution. I think a similar change could be made to the BatchRecorder since it also uses a timer. Hopefully @sveisvei or @adriancole can comment on this, too. |
I also hit this issue during development of a new instrumentation for a serverless function platform. Serverless platforms spawn a new process for each invocation. Once the function handler returns, the process is terminated. This means the final spans often haven't finished sending before the process exits. I worked around this issue but would prefer a custom event or configuration flag to modify this behaviour in the HTTP logger. |
most instrumentation I've noticed attempt to flush on close, although not always via a shutdown hook. For example, in the java side, up to 1 second of blocking is permitted before spans are dropped on close |
@jquatier curious about the statement about not being able to do synchronous operations.. in a shutdown scenario, would synchronous flush (with timeout) be a problem ? (I understand why it would be in a non-shutdown one). |
added "help-wanted" as at least 3 libraries are hacking around this, and at least to me, that suggests we could either document or support a pattern for this. |
Will this issue be solved by #417 or could we do something else using the |
The current implementation of the HTTP transporter does not send open records in it's queue when the node process finished executing (no events left in the queue).
Why shouldn't the transporter send all open records before exiting?
The text was updated successfully, but these errors were encountered: