Skip to content

Conversation

@martincostello
Copy link
Member

@martincostello martincostello commented Jul 21, 2025

Changes

Set the faas.instance and faas.max_memory attributes for AWS Lambda functions, which are both recommended.

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)

@martincostello martincostello added the comp:instrumentation.awslambda Things related to OpenTelemetry.Instrumentation.AWSLambda label Jul 21, 2025
@codecov
Copy link

codecov bot commented Jul 21, 2025

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 69.67%. Comparing base (8764c25) to head (d64c22e).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

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

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2928      +/-   ##
==========================================
+ Coverage   69.60%   69.67%   +0.06%     
==========================================
  Files         413      413              
  Lines       16212    16225      +13     
==========================================
+ Hits        11285    11305      +20     
+ Misses       4927     4920       -7     
Flag Coverage Δ
unittests-Contrib.Shared.Tests 87.36% <ø> (ø)
unittests-Exporter.Geneva 53.45% <ø> (+0.11%) ⬆️
unittests-Exporter.InfluxDB 95.14% <ø> (ø)
unittests-Exporter.Instana 74.86% <ø> (ø)
unittests-Exporter.OneCollector 94.61% <ø> (ø)
unittests-Extensions 90.65% <ø> (ø)
unittests-Extensions.Enrichment 100.00% <ø> (ø)
unittests-Instrumentation.AWS 83.80% <92.30%> (+0.11%) ⬆️
unittests-Instrumentation.AspNet 74.93% <ø> (ø)
unittests-Instrumentation.AspNetCore 70.76% <ø> (ø)
unittests-Instrumentation.Cassandra 23.52% <ø> (ø)
unittests-Instrumentation.ConfluentKafka 14.10% <ø> (ø)
unittests-Instrumentation.ElasticsearchClient 80.12% <ø> (ø)
unittests-Instrumentation.EntityFrameworkCore 80.00% <ø> (ø)
unittests-Instrumentation.EventCounters 76.36% <ø> (ø)
unittests-Instrumentation.GrpcCore 91.42% <ø> (ø)
unittests-Instrumentation.GrpcNetClient 79.61% <ø> (ø)
unittests-Instrumentation.Hangfire 84.61% <ø> (ø)
unittests-Instrumentation.Http 74.18% <ø> (ø)
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.16% <ø> (ø)
unittests-Instrumentation.StackExchangeRedis 70.81% <ø> (ø)
unittests-Instrumentation.Wcf 78.95% <ø> (ø)
unittests-OpAmp.Client 61.08% <ø> (ø)
unittests-PersistentStorage 65.88% <ø> (+0.66%) ⬆️
unittests-Resources.AWS 75.00% <ø> (ø)
unittests-Resources.Azure 84.56% <ø> (ø)
unittests-Resources.Container 67.34% <ø> (ø)
unittests-Resources.Gcp 71.42% <ø> (ø)
unittests-Resources.Host 73.91% <ø> (ø)
unittests-Resources.OperatingSystem 76.98% <ø> (ø)
unittests-Resources.Process 100.00% <ø> (ø)
unittests-Resources.ProcessRuntime 79.59% <ø> (ø)
unittests-Sampler.AWS 88.25% <ø> (ø)

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

Files with missing lines Coverage Δ
...Lambda/Implementation/AWSLambdaResourceDetector.cs 100.00% <100.00%> (ø)
...ntation.AWSLambda/Implementation/AWSLambdaUtils.cs 82.75% <90.90%> (+1.17%) ⬆️

... and 3 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.

@martincostello martincostello marked this pull request as ready for review July 21, 2025 16:26
@Copilot Copilot AI review requested due to automatic review settings July 21, 2025 16:26
@martincostello martincostello requested a review from a team as a code owner July 21, 2025 16:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for two additional OpenTelemetry semantic conventions attributes (faas.instance and faas.max_memory) to the AWS Lambda instrumentation library, enhancing observability capabilities.

  • Implements retrieval of Lambda function instance ID from log stream name and memory limit from environment variables or context
  • Adds the new attributes to both resource detection and span tagging
  • Updates test infrastructure with default values and assertions for the new attributes

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
AWSLambdaUtils.cs Core implementation for extracting instance ID and memory size from Lambda context/environment
AWSLambdaResourceDetector.cs Adds new attributes to resource detection
AWSSemanticConventions.*.cs Defines the new semantic convention attribute constants and builder methods
AWSLambdaWrapperTests.cs Updates test assertions and environment setup for new attributes
SampleLambdaContext.cs Provides default test values for memory limit and log stream name
CHANGELOG.md Documents the new feature addition
opentelemetry-dotnet-contrib.sln Adds AWS shared files to solution structure

@martincostello martincostello removed the comp:instrumentation.awslambda Things related to OpenTelemetry.Instrumentation.AWSLambda label Jul 23, 2025
@martincostello martincostello force-pushed the extend-aws-faas-attributes branch from f071e77 to d1e5871 Compare July 23, 2025 12:03
@github-actions github-actions bot added the comp:instrumentation.awslambda Things related to OpenTelemetry.Instrumentation.AWSLambda label Jul 23, 2025
@martincostello
Copy link
Member Author

/cc @rypdal @Oberon00 @ppittle for review.

@Kielek
Copy link
Member

Kielek commented Jul 28, 2025

@philasmar, could you please check as you are seems the owner of https://github.com/aws/aws-lambda-dotnet? It seems that Philip is no longer affiliated to the AWS and it will be great to have someone with AWS expertise to cover ownership of this package.

This was referenced Oct 23, 2025
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