-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trace HTTPClient request execution #320
base: main
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
4 similar comments
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So since technically we're 0.1 and something may change... how do we want to tackle adoption here.
I was thinking to kick off a branch like tracing
for now, so we can polish up there and once we're all confident merge into mainline? We could also tag those tracing releases, they'd follow normal releases e.g. 1.2.2-tracing.
I don't really expect anything breaking in the core APIs but the open telemetry support which we may want to use here could still fluctuate a little bit until they're final hmmm...
Package.swift
Outdated
], | ||
targets: [ | ||
.target( | ||
name: "AsyncHTTPClient", | ||
dependencies: ["NIO", "NIOHTTP1", "NIOSSL", "NIOConcurrencyHelpers", "NIOHTTPCompression", | ||
"NIOFoundationCompat", "NIOTransportServices", "Logging"] | ||
"NIOFoundationCompat", "NIOTransportServices", "Logging", "Instrumentation"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we right away go with Tracing
and do the full thing in a single PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's my intention. I've added a checklist to the PR including creating a Span. I first wanted to get the instrumentation part down and then continue with tracing, but all inside this PR.
047fbb0
to
87085d9
Compare
@swift-server-bot add to whitelist |
I'd like to punt this to a side-branch for iterative development if we can. |
Sure, sounds like a good approach. I can change the target branch once it's created. |
I've opened up the |
@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 👍 |
87085d9
to
ae7268d
Compare
@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. |
ae7268d
to
329522c
Compare
329522c
to
d68cb8f
Compare
e6e48ef
to
5e7ddf1
Compare
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 aSpan
for executed requestsunder the hood, so that users benefit from tracing effortlessly.
Modifications:
Span
for executed HTTP requestResult:
AsyncHTTPClient
automatically creates a Distributed Tracing span per requestAsyncHTTPClient
propagates service context to server, making server spans children of client spans