Skip to content

reqwest middleware support for object_store #5990

@Conni2461

Description

@Conni2461

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

We could instrument all requests made with object with otlp trace propagation(https://www.w3.org/TR/trace-context/#trace-context-http-headers-format) and for that we would need to be able to inject headers on each request with a different headervalue.

Using https://docs.rs/object_store/latest/object_store/struct.ClientOptions.html#method.with_default_headers doesnt really solve this issue for us because that allows us to set static custom headers but for tracing the injected headervalues need to be dynamic (each request has its own parent trace).

Describe the solution you'd like

Currently, there is no native support for this in reqwest (seanmonstar/reqwest#155) and for the time being we need to look into alternative solutions.

https://github.com/TrueLayer/reqwest-middleware is one of those solutions that allows us to register custom middlewares. So the idea is that object_store could use this crate internally (and wrap the currently used reqwest client with their client wrapper) and provide an interface to pass in new middlewares, which we could then use to provide a trace propagation middleware and other users their own custom once

Describe alternatives you've considered

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAny new improvement worthy of a entry in the changelog

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions