Skip to content

Conversation

@phipag
Copy link
Contributor

@phipag phipag commented Jan 13, 2026

Issue number: closes #

Summary

Related RFC: aws-powertools/powertools-lambda#90

Changes

WIP

User experience

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


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.

@boring-cyborg boring-cyborg bot added dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation tests tracer Tracer utility labels Jan 13, 2026
@pull-request-size pull-request-size bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jan 13, 2026
@phipag phipag moved this to Working on it in Powertools for AWS Lambda (Python) Jan 13, 2026
@hjgraca hjgraca requested a review from Copilot January 13, 2026 12:23
Copy link

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 OpenTelemetry support to AWS Lambda Powertools, introducing a new TracerOpenTelemetry class that provides distributed tracing using the OpenTelemetry SDK. The implementation follows Powertools conventions while offering flexibility through two modes: "auto" mode for use with the ADOT Lambda Layer, and "manual" mode for custom TracerProvider configurations.

Changes:

  • Introduced TracerOpenTelemetry class with support for both auto and manual modes
  • Added context propagation helpers for SQS message tracing
  • Created comprehensive unit, functional, and E2E test suites with 30+ test cases
  • Added detailed documentation with examples for various use cases
  • Updated dependencies to include OpenTelemetry packages as optional extras

Reviewed changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
aws_lambda_powertools/tracing/otel/tracer.py Core OpenTelemetry tracer implementation with decorators for Lambda handlers and methods
aws_lambda_powertools/tracing/otel/propagation.py Context propagation utilities for distributed tracing across services
aws_lambda_powertools/tracing/otel/__init__.py Module initialization and exports
tests/unit/tracing/otel/test_tracer_otel.py Comprehensive unit tests covering initialization, decorators, and edge cases
tests/functional/tracing/otel/test_tracer_otel.py Functional tests with real OpenTelemetry SDK integration
tests/e2e/tracer_otel/test_tracer_otel.py End-to-end test scaffolding for ADOT Layer integration
tests/e2e/tracer_otel/infrastructure.py CDK infrastructure for E2E tests
tests/e2e/tracer_otel/handlers/*.py Sample Lambda handlers for E2E testing
docs/core/tracer-otel.md Comprehensive documentation covering features, usage, and API reference
mkdocs.yml Navigation structure updated to include OpenTelemetry tracer documentation
examples/tracer_otel/src/*.py Example code demonstrating various tracer features
pyproject.toml Added OpenTelemetry dependencies as optional extras under "otel" group
poetry.lock Lock file updated with new OpenTelemetry dependencies

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

if self._tracer is None:
self._tracer = self.provider.get_tracer(
instrumenting_module_name="aws_lambda_powertools",
instrumenting_library_version="1.0.0",
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

The instrumenting_library_version is hardcoded to "1.0.0". This should use the actual library version from aws_lambda_powertools.shared.version.VERSION to accurately represent the Powertools library version in traces.

Copilot uses AI. Check for mistakes.
@github-actions github-actions bot added feature New feature or functionality and removed documentation Improvements or additions to documentation labels Jan 13, 2026
@sonarqubecloud
Copy link

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

Labels

dependencies Pull requests that update a dependency file feature New feature or functionality size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. tests tracer Tracer utility

Projects

Status: Working on it

Development

Successfully merging this pull request may close these issues.

1 participant