Skip to content

ImportError: cannot import name '_ExtendedAttributes' from 'opentelemetry.util.types' #4698

@yeamusic21

Description

@yeamusic21

Describe your environment

OS: (e.g, Ubuntu)

Ubuntu

Python version: (e.g., Python 3.9.10)

Python 3.11

SDK version: (e.g., 1.25.0)
API version: (e.g., 1.25.0)

opentelemetry-api==1.31.1
opentelemetry-instrumentation==0.52b1
opentelemetry-instrumentation-asgi==0.52b1
opentelemetry-instrumentation-dbapi==0.52b1
opentelemetry-instrumentation-django==0.52b1
opentelemetry-instrumentation-fastapi==0.52b1
opentelemetry-instrumentation-flask==0.52b1
opentelemetry-instrumentation-psycopg2==0.52b1
opentelemetry-instrumentation-requests==0.52b1
opentelemetry-instrumentation-urllib==0.52b1
opentelemetry-instrumentation-urllib3==0.52b1
opentelemetry-instrumentation-wsgi==0.52b1
opentelemetry-resource-detector-azure==0.1.5
opentelemetry-sdk==1.31.1
opentelemetry-semantic-conventions==0.52b1
opentelemetry-util-http==0.52b1

What happened?

When deploying an app to Azure App Services with Python 3.11, and try to run

from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter

Get the following error:

ImportError: cannot import name '_ExtendedAttributes' from 'opentelemetry.util.types'

Steps to Reproduce

Create a simple app to deploy to Azure App Service with Python 3.11.

requirements.txt file should be:

opencv-python-headless
Flask
Flask-WTF
Flask-Dance
Werkzeug
lancedb
langchain
pypdf
docx2txt
pyarrow
python-doctr[torch]
onnx==1.16.1
torch
langchain-community
sentence-transformers
langgraph
langchain_openai
azure-identity
pandas
langgraph-swarm
ipython
langchain-huggingface
azure-search-documents
azure-identity
pyodbc
openinference-instrumentation-langchain
azure-storage-blob
opentelemetry-instrumentation-flask
azure-monitor-opentelemetry
azure-monitor-opentelemetry-exporter
opentelemetry-exporter-otlp-proto-http
docx2txt
aiohttp

And app should run the following line

from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter

Resulting error:

ImportError: cannot import name '_ExtendedAttributes' from 'opentelemetry.util.types'

Expected Result

No error

Actual Result

Error message

ImportError: cannot import name '_ExtendedAttributes' from 'opentelemetry.util.types'

Additional context

No response

Would you like to implement a fix?

None

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