Skip to content

Conversation

@jihed-garaouch
Copy link
Contributor

@jihed-garaouch jihed-garaouch commented Jan 8, 2026

Issue number: #1109

Summary

Adds the TenantId from ILambdaContext to the default logger properties to support
AWS Lambda Tenant Isolation observability.

Changes

  • Added TenantId property to LoggingLambdaContext
  • Propagated TenantId from ILambdaContext during context extraction
  • Extended existing tests to validate TenantId extraction

User experience

Please share what the user experience looks like before and after this change

Checklist

Please leave checklist items unchecked if they do not apply to your change.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 8, 2026
@boring-cyborg boring-cyborg bot added area/logging Core logging utility tests labels Jan 8, 2026
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 8, 2026

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #dotnet channel on our Powertools for AWS Lambda Discord: Invite link

@github-actions github-actions bot added the feature New features or minor changes label Jan 9, 2026
@hjgraca hjgraca linked an issue Jan 9, 2026 that may be closed by this pull request
2 tasks
@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.23%. Comparing base (8ac20f0) to head (05c925a).
⚠️ Report is 7 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1113      +/-   ##
===========================================
+ Coverage    79.22%   79.23%   +0.01%     
===========================================
  Files          299      299              
  Lines        12435    12441       +6     
  Branches      1489     1490       +1     
===========================================
+ Hits          9852     9858       +6     
  Misses        2128     2128              
  Partials       455      455              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

hjgraca
hjgraca previously approved these changes Jan 9, 2026
Copy link
Contributor

@hjgraca hjgraca left a comment

Choose a reason for hiding this comment

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

LGTM

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 pull request adds TenantId support to the Powertools logging library to enable AWS Lambda Tenant Isolation observability. The changes capture the TenantId from the ILambdaContext and store it in the internal LoggingLambdaContext for use in logging.

Key Changes:

  • Added TenantId property to LoggingLambdaContext internal class
  • Updated context extraction logic to capture TenantId from ILambdaContext
  • Extended test coverage to validate TenantId extraction

Reviewed changes

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

File Description
libraries/src/AWS.Lambda.Powertools.Logging/Internal/LoggingLambdaContext.cs Added TenantId property and extraction logic to capture tenant information from Lambda context
libraries/tests/AWS.Lambda.Powertools.Logging.Tests/Context/LambdaContextTest.cs Updated test cases to include TenantId in test setup and validation assertions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 9, 2026
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 9, 2026

@hjgraca hjgraca merged commit 989220b into aws-powertools:develop Jan 9, 2026
9 checks passed
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 9, 2026

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

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

Labels

area/logging Core logging utility feature New features or minor changes size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Add TenantId to Logger default properties

3 participants