open-telemetry / open-telemetry/opentelemetry-python

Import error - ImportError: cannot import name 'std_to_otel' from 'opentelemetry._logs'

Open
#4,715 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
2.6k
Forks
1k
Avg merge
4d 15h
Merged PRs (30d)
19

Description

Describe your environment

OS: Linux
Python version: python3.12
SDK version: 1.25.0
API version: 1.25.0

What happened?

I have OTEL layer auto instrumented lambda in AWS region us-west-2 which uses OTEL layer -
arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-python-amd64-ver-1-29-0:2

The traces were correctly being sent to OTEL collector -> dynatrace until 21st July, but we noticed no tracing after that.
I checked the logs for CloudWatch and started seeing this error as attached in - log-events-viewer-result.8.csv

log-events-viewer-result (8).csv

We tried updating the lambda layer to the latest version [arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-python-amd64-ver-1-32-0:2] but still see same issue

Steps to Reproduce

Auto instrumented Lambda python function.

Expected Result

Should be able to see traces in Dynatrace.

Actual Result

No tracing.

Additional context

No response

Would you like to implement a fix?

None

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached CloudWatch log and compare the failing import with the AWS Lambda Python layer versions 1.29.0 and 1.32.0, using the reported Python, API, and SDK versions as context. Done means the auto-instrumented Lambda runs without the ImportError and traces are sent to Dynatrace again.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
cloud, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.