Skip to content

Commit fd95d8a

Browse files
github-actions[bot]pquentin
andauthoredSep 10, 2024··
[Backport 8.15] Fix _otel lint (#2655)
(cherry picked from commit ac64e9f) Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
1 parent 780ea82 commit fd95d8a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎elasticsearch/_otel.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ def helpers_span(self, span_name: str) -> Generator[OpenTelemetrySpan, None, Non
9898
otel_span.set_attribute("db.operation", span_name)
9999
# Without a request method, Elastic APM does not display the traces
100100
otel_span.set_attribute("http.request.method", "null")
101-
yield otel_span
101+
yield OpenTelemetrySpan(otel_span)
102102

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

109-
with trace.use_span(span):
109+
with trace.use_span(span.otel_span):
110110
yield

0 commit comments

Comments
 (0)
Please sign in to comment.