feat: implement tracing without composition #30
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tracing with composition is tricky for OONI because we sometimes have
a DoH resolution (so two HTTP round trips) before a real HTTP round trip
when we're using a DoH resolver.
In such a case, tracing with composition complicates attributing the
correct connection to the request that's using it. This happens because
the whole chain of operations is using the same context.Context, so we
end up attaching three traces to the context (one per round trip).
Conversely, if traces do not compose, each round trip gets its own
Trace and we should be able to bind connections and requests.
Because ooni/oohttp is experimental and will always be experimental, I
don't feel bad about adding this API for experimentation and for our
own sake. The original API is still there, so it all feels ~fine.
I will revert this commit if the experiment fails 😬.
Reference issue: ooni/probe#2220