-
Notifications
You must be signed in to change notification settings - Fork 393
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
Add methods to Flush and Close a tracer #45
Conversation
Logically this change makes sense.
|
Tracer can forward to any attached SpanProcessors.
There are non-virtual Flush and Close functions. You call them with the C++11 chrono types (e.g. tracer->Flush(std::chrono::milliseconds{5}).) FlushWithMicroseconds is to have a virtual function with a stable ABI -- I wouldn't expect most users to invoke it directly. (But I'm open to tweaking the naming).
I'll remove the return value. |
Do we want to get |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach looks good to me.
I've put some stepping back questions for discussion.
I have concerns about having those methods methods (particularly the As far as I understand, the API layer is strictly targeting instrumenters, while the SDK layer is targeting application operators. I think instrumenters aren't supposed to have the ability to close a tracer. If there's a I guess that's the reason why those methods aren't in the spec (and why they most likely will not make it into the spec). |
Applications need the ability to exit quickly. We can't have a tracer implementation hang up an application while it blocks on a socket for an indefinite amount of time to send buffered spans to a collection point. At the same time, some applications may want to make an effort to send buffered spans before they exit. The amount of time an application would be willing to wait will, of course, vary on the use case. That's why something like Close is necessary. If you don't call Close, then an app should be able to exit immediately without waiting on a tracer. Otherwise, it can Close with a timeout to allow the tracer to cleanly stop. |
I 100% agree. Thinking a bit more about this, I wonder it |
FYI - there was a discussion in the OpenTelemetry specification around flush API design. |
@reyang - sorry I missed the meeting. I added open-telemetry/opentelemetry-specification#351 (comment) to describe the Flush use-case. |
Bump docker/build-push-action from 5 to 6 (open-telemetry#2705)
No description provided.