oxidecomputer / third-party-api-clients

A place for keeping all our generated third party API clients.
https://docs.rs/octorust
MIT License
133 stars 56 forks source link

Allow using different version of opentelemetry #38

Closed matt-phylum closed 1 year ago

matt-phylum commented 1 year ago

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.

matt-phylum commented 1 year ago

Should this be done differently? This issue is blocking adoption of Octorust 0.2.1.

augustuswm commented 1 year ago

Looking at this (and other PRs) today.

This looks good to me. Agreed that deferring to the consumer here is definitely correct.