Skip to content

Comments

[Tracing] Implement trace header context propagation#862

Merged
ktoso merged 3 commits intoswift-server:mainfrom
ktoso:wip-context-propagation
Oct 10, 2025
Merged

[Tracing] Implement trace header context propagation#862
ktoso merged 3 commits intoswift-server:mainfrom
ktoso:wip-context-propagation

Conversation

@ktoso
Copy link
Contributor

@ktoso ktoso commented Oct 9, 2025

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.

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.
@ktoso ktoso requested a review from glbrntt October 9, 2025 00:32
@ktoso ktoso added the 🔨 semver/patch No public API change. label Oct 9, 2025
@ktoso ktoso force-pushed the wip-context-propagation branch from 3fff148 to c2afc27 Compare October 9, 2025 22:31
@ktoso ktoso requested a review from glbrntt October 9, 2025 22:39
@ktoso
Copy link
Contributor Author

ktoso commented Oct 9, 2025

Addressed the comments @glbrntt

@ktoso ktoso enabled auto-merge (squash) October 9, 2025 22:40
@ktoso ktoso merged commit 353bbc8 into swift-server:main Oct 10, 2025
33 of 34 checks passed
@ktoso ktoso deleted the wip-context-propagation branch October 10, 2025 08:10
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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants