Skip to content

Rework internal logic for determining the trace id created by AWS Lambda#3410

Merged
martincostello merged 5 commits intoopen-telemetry:mainfrom
normj:normj/aws-lambda-traceid
Nov 9, 2025
Merged

Rework internal logic for determining the trace id created by AWS Lambda#3410
martincostello merged 5 commits intoopen-telemetry:mainfrom
normj:normj/aws-lambda-traceid

Conversation

@normj
Copy link
Copy Markdown
Contributor

@normj normj commented Nov 7, 2025

Changes

In Amazon.Lambda.Core we have reworked the logic that for determining the trace id. The OpenTelemetry.Instrumentation.AWSLambda package has been updated to take advantage of the new API added in Amazon.Lambda.Core for getting the current trace id.

I didn't add any new tests as the existing tests covered the the internal change and users will not see any difference.

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)

@normj normj requested a review from a team as a code owner November 7, 2025 00:23
@github-actions github-actions bot added infra Infra work - CI/CD, code coverage, linters dependencies Pull requests that update a dependency file comp:instrumentation.awslambda Things related to OpenTelemetry.Instrumentation.AWSLambda labels Nov 7, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.87%. Comparing base (b2ff815) to head (399fea6).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3410      +/-   ##
==========================================
+ Coverage   70.79%   70.87%   +0.08%     
==========================================
  Files         440      440              
  Lines       17265    17265              
==========================================
+ Hits        12222    12236      +14     
+ Misses       5043     5029      -14     
Flag Coverage Δ
unittests-Contrib.Shared.Tests 86.54% <ø> (ø)
unittests-Exporter.Geneva 53.97% <ø> (+0.19%) ⬆️
unittests-Exporter.InfluxDB 95.14% <ø> (ø)
unittests-Exporter.Instana 74.86% <ø> (ø)
unittests-Exporter.OneCollector 94.62% <ø> (ø)
unittests-Extensions 90.65% <ø> (-0.47%) ⬇️
unittests-Extensions.Enrichment 100.00% <ø> (ø)
unittests-Extensions.Enrichment.AspNetCore 86.27% <ø> (ø)
unittests-Extensions.Enrichment.Http 94.33% <ø> (ø)
unittests-Instrumentation.AWS 83.80% <100.00%> (ø)
unittests-Instrumentation.AspNet 78.14% <ø> (+0.22%) ⬆️
unittests-Instrumentation.AspNetCore 71.69% <ø> (ø)
unittests-Instrumentation.Cassandra 23.52% <ø> (ø)
unittests-Instrumentation.ConfluentKafka 14.10% <ø> (ø)
unittests-Instrumentation.ElasticsearchClient 80.12% <ø> (ø)
unittests-Instrumentation.EntityFrameworkCore 80.80% <ø> (ø)
unittests-Instrumentation.EventCounters 77.27% <ø> (ø)
unittests-Instrumentation.GrpcCore 91.42% <ø> (ø)
unittests-Instrumentation.GrpcNetClient 79.61% <ø> (ø)
unittests-Instrumentation.Hangfire 84.61% <ø> (ø)
unittests-Instrumentation.Http 74.22% <ø> (ø)
unittests-Instrumentation.Owin 88.62% <ø> (ø)
unittests-Instrumentation.Process 100.00% <ø> (ø)
unittests-Instrumentation.Quartz 78.76% <ø> (ø)
unittests-Instrumentation.Runtime 100.00% <ø> (ø)
unittests-Instrumentation.ServiceFabricRemoting 34.54% <ø> (ø)
unittests-Instrumentation.SqlClient 87.29% <ø> (ø)
unittests-Instrumentation.StackExchangeRedis 71.80% <ø> (ø)
unittests-Instrumentation.Wcf 79.57% <ø> (ø)
unittests-OpAmp.Client 71.55% <ø> (ø)
unittests-PersistentStorage 76.58% <ø> (+1.33%) ⬆️
unittests-Resources.AWS 74.42% <ø> (ø)
unittests-Resources.Azure 85.31% <ø> (ø)
unittests-Resources.Container 67.34% <ø> (ø)
unittests-Resources.Gcp 71.42% <ø> (ø)
unittests-Resources.Host 71.85% <ø> (ø)
unittests-Resources.OperatingSystem 76.98% <ø> (ø)
unittests-Resources.Process 100.00% <ø> (ø)
unittests-Resources.ProcessRuntime 79.59% <ø> (ø)
unittests-Sampler.AWS 93.23% <ø> (ø)

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

Files with missing lines Coverage Δ
...ntation.AWSLambda/Implementation/AWSLambdaUtils.cs 82.75% <100.00%> (ø)

... and 7 files with indirect coverage changes

🚀 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
Copy Markdown
Contributor Author

normj commented Nov 7, 2025

The GitHub check looks like an unrelated possibly transient error since the failure is in OpenTelemetry.Instrumentation.GrpcCore. Can the action be rerun?

<PackageVersion Include="Amazon.Lambda.APIGatewayEvents" Version="[2.7.0,)" />
<PackageVersion Include="Amazon.Lambda.ApplicationLoadBalancerEvents" Version="[2.2.0,)" />
<PackageVersion Include="Amazon.Lambda.Core" Version="[2.2.0,)" />
<PackageVersion Include="Amazon.Lambda.Core" Version="[2.8.0,)" />
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.

This is quite a large step forward in terms of the minimum version (~2 years of changes).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changes made to Amazon.Lambda.Core are done very conservatively due to the nature of being being deployed to the Lambda managed runtime so changes are often picked up in a not opt-in way. The changes from 2.2.0 to 2.8.0 are all backwards compatible and we need this change for the correct evaluation of trace id.

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.

IMO it is still worth to add this information to the CHANGELOG. It is a practice to reflect such changes in this repo.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That makes sense, I pushed up another commit updating the change log message to include the version bump.

normj and others added 2 commits November 7, 2025 09:49
This was referenced Mar 29, 2026
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 dependencies Pull requests that update a dependency file infra Infra work - CI/CD, code coverage, linters

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants