Closed matt-phylum closed 1 year ago
Should this be done differently? This issue is blocking adoption of Octorust 0.2.1.
Looking at this (and other PRs) today.
This looks good to me. Agreed that deferring to the consumer here is definitely correct.
I don't know if this is really the best solution. Would it be better to just use the default features of reqwest-tracing and let the consuming program enable the opentelemetry feature if desired?
The generated API clients have some code to create an HTTP client and they attach reqwest-tracing so the requests are observable. In my project, we are using a newer version of opentelemetry and providing our own HTTP clients. For octorust 0.1.x this worked fine because we were compiling two versions of reqwest-tracing and two versions of opentelemetry and then at runtime we would only use the newer version of the middleware. However, now that octorust uses the same reqwest-tracing we get a compile error because there are multiple opentelemetry_* features enabled at the same time in the same reqwest-tracing.