Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Python Lambda Layer versions > 61 throw an Opentelemetry import error #671

Closed
janritter opened this issue Nov 12, 2024 · 3 comments
Closed
Assignees
Labels

Comments

@janritter
Copy link

Problem Description

When upgrading a Lambda Function that previously ran fine with Instana layer version 61 to 62 or above the execution fails with the error Unable to import module 'instana': No module named 'opentelemetry'

Minimal, Complete, Verifiable, Example

Create an AWS Lambda Function with Python 3.12 / arm64 and the following code:

def handler(event, context):
    return context.function_name

Set the handler to instana.lambda_handler and add the layer with the ARN arn:aws:lambda:eu-central-1:410797082306:layer:instana-python:62

Configure the following environment variables:
INSTANA_AGENT_KEY=test-agent-key
INSTANA_ENDPOINT_URL=https://serverless-blue-saas.instana.io
LAMBDA_HANDLER=app.handler
LAMBDA_TIMEOUT=30

Try to execute the Lambda and it will fail with Unable to import module 'instana': No module named 'opentelemetry'

Python Version

3.12

Python Modules

Standard Lambda Python 3.12 environment without any additional packages

Python Environment

INSTANA_AGENT_KEY=test-agent-key
INSTANA_ENDPOINT_URL=https://serverless-blue-saas.instana.io
LAMBDA_HANDLER=app.handler
LAMBDA_TIMEOUT=30
@janritter janritter added the bug label Nov 12, 2024
@pvital
Copy link
Member

pvital commented Nov 13, 2024

Hello, @janritter. Thanks for reporting this issue.

We have migrated from the OpenTracing dependency to the OpenTelemetry dependency, which is contained in the newer versions of the AWS Lambda Layer.

We will definitely fix it and let you know when a new version is available. Meanwhile, can you downgrade to version 61?

@pvital pvital self-assigned this Nov 14, 2024
@pvital
Copy link
Member

pvital commented Nov 19, 2024

Hello, @janritter. We published a new version of the AWS Lambda Layer, numbered v66.

Could you please confirm this new version works on your environment.

@janritter
Copy link
Author

Hi @pvital,

works as expected, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants