Skip to content

feat: add W3C trace context support to the Lambda context - #2589

Open
maxday wants to merge 6 commits into
aws:masterfrom
maxday:maxday/w3c
Open

maxday wants to merge 6 commits into
aws:masterfrom
maxday:maxday/w3c

Conversation

@maxday

@maxday maxday commented Oct 6, 2026

Copy link
Copy Markdown
Member

Description of changes:

Adds a W3C() method to ILambdaContext that surfaces the W3C trace-context fields (traceparent, tracestate, baggage) carried on clientContext.w3c at invoke time. This brings the .NET runtime support in line with the Node (aws/aws-lambda-nodejs-runtime-interface-client#201) and Python (aws-lambda-python-runtime-interface-client#228) interface clients.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

maxday added 4 commits October 6, 2026 11:26
Satisfies the 'Check for Change File(s) in .autover/changes/' CI gate by
recording the W3C() API addition across Amazon.Lambda.Core,
Amazon.Lambda.RuntimeSupport, Amazon.Lambda.TestUtilities and
Amazon.Lambda.AspNetCoreServer.
@maxday
maxday requested review from a team as code owners October 6, 2026 18:20
@maxday
maxday requested a review from normj October 6, 2026 18:20
normj added 2 commits October 6, 2026 22:26
Converts the W3C trace-context accessor from a W3C() method to a W3C
property to follow .NET naming/design conventions (a parameterless
accessor returning data should be a property). Updates the interface
default implementation, LambdaContext, SnapStartEmptyLambdaContext, and
TestLambdaContext, plus all call sites in the unit tests and the
dockerized W3C test handler (the reflection accessibility check now
looks up the property). Changelog wording updated to match.
The W3CTestHandler targets net10.0, so the dockerized-test workflow only
needs the .NET 10 SDK; drop the unused 8.0.x and 9.0.x installs.

@normj normj left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the W3C() method to W3C property to match the pattern used on ILambdaContext. I also changed the dockerized-test.yml to not install .NET 8 and 9 because the test program is targeting .NET 10. Also 8 and 9 go out of support pretty soon.

I'm running the PR through internal CI. Assuming that passes then I will approve the PR.

Once all the work for W3C is deployed I want to also update the Amazon.Lambda.AspNetCoreServer package to share the W3C info with the ASP.NET Core programming model that this package bridges with the Lambda programming model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants