Skip to content

opentelemetry-instrumentation-aws-lambda: Fix aws lambda span creation#3966

Merged
xrmx merged 5 commits into
open-telemetry:mainfrom
herin049:fix/aws-lambda-span-creation
Feb 16, 2026
Merged

opentelemetry-instrumentation-aws-lambda: Fix aws lambda span creation#3966
xrmx merged 5 commits into
open-telemetry:mainfrom
herin049:fix/aws-lambda-span-creation

Conversation

@herin049
Copy link
Copy Markdown
Contributor

Description

Fixes bug where the Lambda invocation Span name would be incorrectly set to the name of the Python handler function instead of the function name. Also fixes an issue where the Lambda invocation Span kind would occasionally not be set to SERVER which violates the OpenTelemetry FaaS semantic conventions.

Fixes #3963

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Unit tests have been updated to reflect changing the invocation Span name to the Lambda function name and changing the Span kind to always be SERVER.

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added

@herin049 herin049 requested a review from a team as a code owner November 21, 2025 20:03
Copy link
Copy Markdown
Contributor

@tammy-baylis-swi tammy-baylis-swi left a comment

Choose a reason for hiding this comment

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

Thanks for fixes and linking the AWS docs in docstring.

@xrmx xrmx moved this to Ready for review in Python PR digest Nov 27, 2025
@xrmx xrmx moved this from Ready for review to Reviewed PRs that need fixes in Python PR digest Nov 28, 2025
@herin049 herin049 requested a review from xrmx December 4, 2025 05:34
@herin049 herin049 force-pushed the fix/aws-lambda-span-creation branch from 8e83e7b to e5fc809 Compare December 22, 2025 16:36
@herin049 herin049 force-pushed the fix/aws-lambda-span-creation branch 2 times, most recently from 27c5dd6 to b7a78b1 Compare December 22, 2025 16:39
@herin049 herin049 force-pushed the fix/aws-lambda-span-creation branch from b7a78b1 to ca32f35 Compare January 21, 2026 18:45
@herin049
Copy link
Copy Markdown
Contributor Author

herin049 commented Jan 21, 2026

@xrmx When you get the time, can you take another look at this? I would like to get these changes added since it is very annoying having this library not conform with the spec, unlike the AWS Lambda instrumentation libraries in other languages. The spec seems to be consistent on the naming and behavior of the root Lambda span all the way to when it was originally introduced: https://github.com/open-telemetry/semantic-conventions/blob/0f981353221f53df273ebc01c61f8ff2298a9b92/specification/trace/semantic_conventions/faas.md

Comment thread CHANGELOG.md Outdated
@herin049 herin049 force-pushed the fix/aws-lambda-span-creation branch from ca32f35 to 1bbf56b Compare February 12, 2026 22:09
@xrmx xrmx enabled auto-merge (squash) February 16, 2026 10:40
@xrmx xrmx merged commit 1eca3e6 into open-telemetry:main Feb 16, 2026
668 checks passed
@github-project-automation github-project-automation Bot moved this from Reviewed PRs that need fixes to Done in Python PR digest Feb 16, 2026
wikaaaaa pushed a commit to wikaaaaa/opentelemetry-python-contrib that referenced this pull request Feb 17, 2026
open-telemetry#3966)

* update invocation span to have kind SERVER and have name equal to the function name

* update Lambda invocation span name and kind

* add type checking check

* move changelog entry to 'Breaking changes'

---------

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
wrisa pushed a commit to wrisa/opentelemetry-python-contrib that referenced this pull request Feb 18, 2026
open-telemetry#3966)

* update invocation span to have kind SERVER and have name equal to the function name

* update Lambda invocation span name and kind

* add type checking check

* move changelog entry to 'Breaking changes'

---------

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
sightseeker added a commit to sightseeker/opentelemetry-python-contrib that referenced this pull request Mar 11, 2026
open-telemetry#3966)

* update invocation span to have kind SERVER and have name equal to the function name

* update Lambda invocation span name and kind

* add type checking check

* move changelog entry to 'Breaking changes'

---------

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

opentelemetry-instrumentation-aws-lambda: invocation span name and kind do not follow semantic conventions

10 participants