Skip to content

Conversation

@normj
Copy link
Contributor

@normj normj commented Dec 19, 2025

Fixes

Fix issue when using ADOT auto-instrumentation which includes a version of OpenTelemetry.Instrumentation.AWSLambda in the Lambda layer. In this scenario nothing is forcing the NuGet resolution to include the updated version of Amazon.Lambda.Core that has the reworked logic for determining the trace id.

This is causing us some breaking issues with ADOT and are looking to get this fix released as soon as possible.

Changes

Add defensive code around accessing the LambdaTraceProvider.CurrentTraceId and fallback to the environment variable if we get a TypeLoadException. We need to try and use LambdaTraceProvider.CurrentTraceId to support Lambda's recently released Managed Instances where there is concurrency and an environment variable will not work. For users using Managed Instances feature they are required to use the updated version of Amazon.Lambda.Core in their Lambda function.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

…on of OpenTelemetry.Instrumentation.AWSLambda in the Lambda layer
@normj normj requested a review from a team as a code owner December 19, 2025 01:33
@github-actions github-actions bot added the comp:instrumentation.awslambda Things related to OpenTelemetry.Instrumentation.AWSLambda label Dec 19, 2025
@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

❌ Patch coverage is 44.44444% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.39%. Comparing base (9f71a33) to head (a0b8791).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ntation.AWSLambda/Implementation/AWSLambdaUtils.cs 37.50% 5 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3629      +/-   ##
==========================================
- Coverage   71.41%   71.39%   -0.02%     
==========================================
  Files         443      444       +1     
  Lines       17519    17527       +8     
==========================================
+ Hits        12511    12514       +3     
- Misses       5008     5013       +5     
Flag Coverage Δ
unittests-Instrumentation.AWS 83.42% <44.44%> (-0.39%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
....AWSLambda/Implementation/TraceProviderIsolated.cs 100.00% <100.00%> (ø)
...ntation.AWSLambda/Implementation/AWSLambdaUtils.cs 78.72% <37.50%> (-4.04%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@normj
Copy link
Contributor Author

normj commented Dec 19, 2025

@martincostello Addressed your comments

@Kielek Kielek enabled auto-merge December 19, 2025 09:17
@Kielek Kielek added this pull request to the merge queue Dec 19, 2025
Merged via the queue into open-telemetry:main with commit 4b75afd Dec 19, 2025
73 checks passed
@normj normj deleted the normj/aws-lambda-defence branch December 19, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:instrumentation.awslambda Things related to OpenTelemetry.Instrumentation.AWSLambda

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants