Skip to content

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

@herin049

Description

@herin049

Describe your environment

OS: Amazon Linux
Python version: Python 3.11
Package version: 0.60b0.dev

What happened?

The OpenTelemetry semantic conventions for AWS Lambda state that:

For all events, a span with kind SERVER SHOULD be created corresponding to the function invocation unless stated otherwise below.

Furthermore, it also states that

Span name MUST be set to the function name from the Lambda Context unless stated otherwise.

The current implementation violates both of these requirements, it sets the span name to the name of the Python handler function instead of the Lambda function name itself. It also occasionally sets the span kind to CONSUMER when receiving events from SQS, SNS, DynamoDB or S3. (source)

Steps to Reproduce

Invoke an AWS Lambda function with the opentelemetry-instrumentation-aws-lambda Python package installed and observe the resulting Span names.

Expected Result

The Span kind should be always marked as SERVER and the Span name should be the invoked function name provided in the Context argument provided in the Lambda handler.

Would you like to implement a fix?

Yes

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions