[Tracing] Implement trace header context propagation#862
Merged
ktoso merged 3 commits intoswift-server:mainfrom Oct 10, 2025
Merged
[Tracing] Implement trace header context propagation#862ktoso merged 3 commits intoswift-server:mainfrom
ktoso merged 3 commits intoswift-server:mainfrom
Conversation
Somewhere along the way of reviewing previous work this bit got lost; This implements context propagation by injecting the apropriate headers from service context into the headers when forming a `Prepared` http request.
slashmo
approved these changes
Oct 9, 2025
Sources/AsyncHTTPClient/AsyncAwait/HTTPClientRequest+Prepared.swift
Outdated
Show resolved
Hide resolved
glbrntt
requested changes
Oct 9, 2025
3fff148 to
c2afc27
Compare
Contributor
Author
|
Addressed the comments @glbrntt |
glbrntt
approved these changes
Oct 10, 2025
slashmo
added a commit
to swift-otel/swift-otel
that referenced
this pull request
Feb 1, 2026
## Motivation `AsyncHTTPClient` recently gained built-in support for Distributed Tracing (swift-server/async-http-client#857, swift-server/async-http-client#861, swift-server/async-http-client#862). It'd be a great showcase of Distributed Tracing to have an "end-to-end" example involving two server communicating via HTTP and this is now achievable without any manual HTTP client instrumentation. We already have multiple demos for both Vapor and Hummingbird so it feels natural for this demo to exist in Swift OTel as well. ## Modifications - Adds an example with two HTTP servers (Hummingbird & Vapor) where one calls the other via `AsyncHTTPClient` ## Result We now have an example that spans (no pun intended) two servers, connected via `AsyncHTTPClient`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Somewhere along the way of reviewing previous work this bit got lost;
This implements context propagation by injecting the apropriate headers from service context into the headers when forming a
Preparedhttp request.