opentelemetry-instrumentation-faraday TracerMiddleware position in RackBuilder #955
ib-drct-dev
started this conversation in
General
Replies: 1 comment 3 replies
-
Hi @ib-drct-dev - this was actually just brought up a few weeks ago (albeit for a different reason). At the time, @fbogsany mentioned that if you insert the tracing middleware yourself manually, then our patches respect the position you chose - see this comment for more details. Would that solution work for you? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I use faraday opentelemetry instrumentation with a logger middleware.
Logs should be tagged with trace_id and span_id.
But there is a problem: OpenTelemetry::Instrumentation::Faraday::Patches::RackBuilder inserts TracerMiddleware before an adapter. Thus a logger is left out of Faraday's request scope and tagged with a wrong span (it uses parent's scope).
https://github.com/open-telemetry/opentelemetry-ruby/blob/main/instrumentation/faraday/lib/opentelemetry/instrumentation/faraday/patches/rack_builder.rb#L14
Would you accept as a solution to insert TracerMiddleware to the top of a middleware stack?
Beta Was this translation helpful? Give feedback.
All reactions