Skip to content

Flask instrumentation DeprecationWarning - The '__version__' attribute is deprecated and will be removed in Flask 3.1 #2297

Closed
@phillipuniverse

Description

@phillipuniverse

Describe your environment
With the just-release opentelemetry-instrumentation-flask 0.44b0 I get this from the flask instrumentation:

DeprecationWarning: The '__version__' attribute is deprecated and will be removed in Flask 3.1. Use feature detection or 'importlib.metadata.version("flask")' instead.

Problematic code is at https://github.com/open-telemetry/opentelemetry-python-contrib/blame/8daa8ad48108775d8e799a3abc3ed06f84b4c00e/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py#L254-L263 and caused by #2013.

Flask version is 3.0.2.

Steps to reproduce
Instrument Flask > 3

What is the expected behavior?
No DeprecationWarning

What is the actual behavior?
DeprecationWarning

Additional context
N/A

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