apache / apache/arrow-rs-object-store
Support W3C Trace Context Propagation for HTTP Object Store
- Dominant language
- Rust
- Stars
- 322
- Forks
- 212
- Avg merge
- 5d 2h
- Merged PRs (30d)
- 10
Description
I have an HTTP object store that supports distributed tracing.
I would like the ObjectStore HTP client to propagate the trace context to this service.
This would mean grabbing the trace context from `tracing` and putting it into HTTP headers.
I see three paths forward:
1. Add `ClientOptions::propagate_trace_context: bool` that configures it for you.
a. Add `reqwest_middleware` as a non-feature flagged dep (see note 1) and add `reqwest_tracing` as a feature flagged dep and use its `TracingMiddleware`. The pro of this is that it's not much extra code or complexity, the con is extra deps / features.
b. Implement [the spec for context propagation](https://www.w3.org/TR/trace-context/) ourselves to avoid any extra dependencies. The pro of this is no deps, the con is more code and possibly bugs.
2. Add `reqwest_middleware` as a non-feature flagged dep (see note 1) and expose a `ClientOptions ::with_middleware`. The con of this is that it locks us into `reqwest` as the backing http client and is more complexity for users. The pro is that it would be relatively little code for us.
Note 1: I think it's going to be way too painful to be generic over `request::Client` and `reqwest_middleware::ClientWithMiddleware`, we should probably just add `reqwest_middleware` as a dependency if were going to use it at all.
Contributor guide
Research direction
Start by locating ClientOptions and the ObjectStore HTTP client, then read how requests are built and how tracing is currently accessed. Compare the proposed reqwest_middleware and reqwest_tracing approach with implementing W3C Trace Context directly. Done means the chosen design propagates the trace context in HTTP headers without leaving the alternatives unresolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- distributed-systems, observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100