Skip to content

Commit

Permalink
Fix import when trace is missing from opentelemetry (#2694)
Browse files Browse the repository at this point in the history
(cherry picked from commit de6ed82)
  • Loading branch information
nicoloboschi authored and github-actions[bot] committed Nov 12, 2024
1 parent ee10e2a commit cb2d03f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion elasticsearch/_otel.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from opentelemetry import trace

_tracer: trace.Tracer | None = trace.get_tracer("elasticsearch-api")
except ModuleNotFoundError:
except ImportError:
_tracer = None

from elastic_transport import OpenTelemetrySpan
Expand Down

0 comments on commit cb2d03f

Please sign in to comment.