diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py index 85ac407fab..21e102dcca 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py @@ -259,10 +259,7 @@ def response_hook(span: Span, status: str, response_headers: List): from importlib import metadata except ImportError: import importlib_metadata as metadata - try: - flask_version = metadata.version("flask") - except (ImportError, metadata.PackageNotFoundError): - flask_version = "unknown" + flask_version = metadata.version("flask") from opentelemetry.instrumentation.instrumentor import BaseInstrumentor from opentelemetry.instrumentation.propagators import (