Skip to content

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

@tosti007

Description

@tosti007

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions