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
  • Loading branch information
nicoloboschi authored Nov 12, 2024
1 parent 4068c6c commit de6ed82
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 de6ed82

Please sign in to comment.