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
Returning the http response status code and error message from HttpExporter.export( ) #6306
Comments
The main problem is that the export API is stable, so we would need to evolve the generic Consuming this info would require a custom processor or metric reader. So I'm curious to learn more about your use case. How are you using the OtlpHttpSpanExporter? What kind of info would you expect if there was no http status code (i.e. it was a connect or timeout error), or if it failed after retrying several times? What would you do with this info if it were available? |
So we basically have an otel extension wherein custom span processors write to a queue which is periodically flushed via the exporter. The spans are exported to a collector service which routes the data to another consuming service and returns status codes for 3 scenarios : complete success (all spans routed successfully), complete failure and partial success. |
Hi @jack-berg , Do you think it would be possible to undertake the enhancement of CompletableResultCode class? Being able to read the response would be really useful for us. |
Check out #6348, which lays the groundwork for this by evolving the |
Thanks for taking this up.. So the exception thrown in case of failure will now contain the error details and the HTTP response status code? Is that correct? is it possible to return the response body as well? |
Additional PR(s) are needed for exporters to include exception in CompletableResultCode, and to decide how to represent what types of information is included in the exception. We don't do anything at all with the response body today, so including it will present an additional challenge. |
Okay. I'll go through the guidelines for contribution and please let me know if I could pitch in anywhere. Thanks |
@jack-berg is this something that could make sense to implement directly in the OTLP exporter? Or if we can't change the default retry behavior, maybe a hook that allows people to override the default retry behavior? |
This is quite complicated to implement at the moment, regardless of where:
I think the reality is that as of today, partial success responses are not designed for this type of partial retry scenario. You can see in the protobuf comments that its intended to help a developer make config changes to address the problem, not for an exporter to interpret and automatically perform some a retry routine:
I could be open to this, but doing so is complicated so would want to see evidence that several people are running into issues. And still, it might be more appropriate to solve this by: 1. Passing failure details back via CompletableResultCode. 2. Disabling retry. 3. Pairing the exporter with a custom processor which interprets the error from CompletableResultCode and implements retry at the processor level.
|
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
In my implementation of the
OtlpHttpSpanExporter
, I want to access the http response status code and error message in case the export fails. Internally, theHttpExporter.export( )
method returns aCompletableResultCode
response indicating successful or failed export and logs the status code and error message. I would like to know if it's possible to return this information from the exporter.Describe alternatives you've considered
An alternative would be to write a custom exporter which returns all the required info.
The text was updated successfully, but these errors were encountered: