async-http-client
async-http-client copied to clipboard
Trace HTTPClient request execution
Motivation:
Context Propagation
In order to instrument distributed systems, metadata such as trace ids must be propagated across network boundaries through HTTP headers. As HTTPClient operates at one such boundary, it should take care of injecting metadata into HTTP headers automatically using the configured instrument.
Built-in tracing
Furthermore, HTTPClient should create a Span for executed requests
under the hood, so that users benefit from tracing effortlessly.
Modifications:
- [x] Propagate service context to server via HTTP request headers
- [x] Create
Spanfor executed HTTP request
Result:
AsyncHTTPClientautomatically creates a Distributed Tracing span per requestAsyncHTTPClientpropagates service context to server, making server spans children of client spans
Can one of the admins verify this patch?
Can one of the admins verify this patch?
Can one of the admins verify this patch?
Can one of the admins verify this patch?
Can one of the admins verify this patch?
I chatted with @ktoso earlier to discuss the manual context propagation, and we agreed that we probably shouldn't deprecate the "old" API accepting a Logger for each request overload, as we don't want to push users too much into the direction of manual context passing because that's ideally not necessary once the mentioned language changes have been made: https://github.com/apple/swift-distributed-tracing#important-note-on-adoption
@swift-server-bot add to whitelist
I'd like to punt this to a side-branch for iterative development if we can.
I'd like to punt this to a side-branch for iterative development if we can. @Lukasa
Sure, sounds like a good approach. I can change the target branch once it's created.
I've opened up the tracing-development branch.
@ktoso The CI seems to fail because the Baggage repo cannot be cloned through the Git URL. Should we pin Tracing to 0.1.1 here in order to get the fix? (apple/swift-distributed-tracing/pull/25)
No, we need to tag a 0.1.1, I'll do that in a moment.
0.1.1. tagged, please depend on that.
Thanks Cory for the development branch, sounds good 👍
@swift-server-bot test this please
Can drafts get CI validation? 🤔
Yes, they can: I think the CI isn't targeting that branch at the moment.