Skip to content

Commit

Permalink
Fix _otel lint (#2654)
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed Sep 10, 2024
1 parent b8633ba commit ac64e9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions elasticsearch/_otel.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ def helpers_span(self, span_name: str) -> Generator[OpenTelemetrySpan, None, Non
otel_span.set_attribute("db.operation", span_name)
# Without a request method, Elastic APM does not display the traces
otel_span.set_attribute("http.request.method", "null")
yield otel_span
yield OpenTelemetrySpan(otel_span)

@contextlib.contextmanager
def use_span(self, span: OpenTelemetrySpan) -> Generator[None, None, None]:
if not self.enabled or self.tracer is None:
yield
return

with trace.use_span(span):
with trace.use_span(span.otel_span):
yield

0 comments on commit ac64e9f

Please sign in to comment.