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
Non-blocking batch span processor? #4264
Comments
Hi @trask - I would say exporters are already non-blocking since they make the export request but don't block waiting for it to complete, there would only be blocking if the caller decides to call The question is more about how to make a non-blocking batch span processor I think. FWIW, the spec wording seems to be a bug
This seems to be too strict and I would be surprised if any exporter in the languages actually relies on this because OTLP conversion is known to be stateless. Maybe it could be removed from the spec safely. Also just for reference, a very early version of the BatchSpanProcessor never blocked but we switched back to the blocking pattern to simplify the code. |
💯 will update title of this issue |
ya, I will open a spec issue 👍 |
re-reading the spec now:
I'm reading it completely different now, that this is just "concurrent" from a thread perspective, and still allows what we want, which is to call Export() again from the same thread after the previous call returns. |
Is your feature request related to a problem? Please describe.
I'd like to increase export throughput, and the most obvious way (at least in my case with a remote ingestion service) is to not block waiting for a response from the ingestion service.
However the spec explicitly disallows calling the exporter concurrently:
So exporters need to implement the non-blocking behavior themselves.
But the only way to tell the batch span processor not to block, is to return an immediately completed
CompletableResultCode
, instead of a realCompletableResultCode
.Which sort of defeats the purpose of the async-friendly
CompletableResultCode
return type fromexport
.In any case though, if this is a supported pattern (returning an immediately completed
CompletableResultCode
from the exporter), it would be nice for the batch span processor to flush the span exporter after if flushes itself, or to document on the batch span processor'sflush()
method that you may still need to flush the underlying span exporter after calling that method.The text was updated successfully, but these errors were encountered: