Skip to content
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

reqwest-tracing has opentelemetry logic even when no opentelemetry is not used #206

Open
tosti007 opened this issue Dec 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@tosti007
Copy link

tosti007 commented Dec 5, 2024

First of all, thank you for making this crate!

Bug description

When using reqwest-tracing without any of the opentelemetry features enabled, the crate still contains quite a bit of code related to and crates needed for opentelemetry. Example of crates are matchit, which does routing.

To Reproduce

The easiest example I can find:

  1. Create a new crate
  2. Add reqwest-tracing as dependency without any enabled features.
  3. Check Cargo.lock and notice it contains matchit (for routing logic).

Expected behavior

I would expect the crate to be slimmer and contain only the required dependencies needed to get tracing working.

Environment

reqwest-tracing: 0.5.4
rustc: 1.83.0

Additional context

After inspecting the code I understand that "simply not adding it" isn't as easy as it sounds and that this might not be solved in the near future. Hence might I mention, as food for thought, that splitting the opentelemetry logic of reqwest-tracing into a separate reqwest-opentelemetry crate might be a method to make this simpler?

On the other hand I can also imagine that I am not fully understanding the codebase (as I've just looked through it after noticing the matchit dep), so I might be fully wrong here. Please let me know so and feel free to close this if that's the case!

@tosti007 tosti007 added the bug Something isn't working label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant