opentelemetry-otlp exporter with http-proto: should it error on unsuccessful status code? #1275
Labels
A-trace
Area: issues related to tracing
enhancement
New feature or request
triage:accepted
Has been triaged and accepted.
I had some issues setting up the OTLP exporter with http-proto tu report metrics (I finally realized that I needed to include not only the
reqwest-client
but also thereqwest-rustls
feature, since I am using TLS)While debugging the setup, I would had found really useful having more information about the request errors. Therefore, I was considering extending the MetricsClient implementation of OtlpHttpClient to also consider unsuccessful status codes. Something similar to this:
I also realized that opentelemetry_http::ResponseExt already provides a function to check the status code. Unfortunately, it is specialized for traces (it returns
TraceError
). Maybe a refactor inopentelemetry_http::ResponseExt
to use a different error that could be mapped toTraceError
,MetricError
andLogError
would be a better approach.If this is something you also consider useful and you could provide some guidance, I would be willing to work on it.
The text was updated successfully, but these errors were encountered: