We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 44cbf67 commit c5ec903Copy full SHA for c5ec903
elasticsearch/_otel.py
@@ -77,9 +77,9 @@ def span(
77
otel_span.set_attribute("http.request.method", method)
78
otel_span.set_attribute("db.system", "elasticsearch")
79
if endpoint_id is not None:
80
- otel_span.set_attribute("db.operation", endpoint_id)
+ otel_span.set_attribute("db.operation.name", endpoint_id)
81
for key, value in path_parts.items():
82
- otel_span.set_attribute(f"db.elasticsearch.path_parts.{key}", value)
+ otel_span.set_attribute(f"db.operation.parameter.{key}", value)
83
84
yield OpenTelemetrySpan(
85
otel_span,
@@ -94,8 +94,8 @@ def helpers_span(self, span_name: str) -> Generator[OpenTelemetrySpan, None, Non
94
return
95
96
with self.tracer.start_as_current_span(span_name) as otel_span:
97
- otel_span.set_attribute("db.system", "elasticsearch")
98
- otel_span.set_attribute("db.operation", span_name)
+ otel_span.set_attribute("db.system.name", "elasticsearch")
+ otel_span.set_attribute("db.operation.name", span_name)
99
# Without a request method, Elastic APM does not display the traces
100
otel_span.set_attribute("http.request.method", "null")
101
yield OpenTelemetrySpan(otel_span)
test_elasticsearch/test_otel.py
@@ -68,7 +68,7 @@ def test_minimal_span():
68
assert spans[0].name == "GET"
69
assert spans[0].attributes == {
70
"http.request.method": "GET",
71
- "db.system": "elasticsearch",
+ "db.system.name": "elasticsearch",
72
}
73
74
@@ -92,11 +92,11 @@ def test_detailed_span():
92
assert spans[0].name == "ml.open_job"
93
- "db.operation": "ml.open_job",
- "db.elasticsearch.path_parts.job_id": "my-job",
- "db.elasticsearch.cluster.name": "e9106fc68e3044f0b1475b04bf4ffd5f",
- "db.elasticsearch.node.name": "instance-0000000001",
+ "db.operation.name": "ml.open_job",
+ "db.operation.parameter.job_id": "my-job",
+ "db.namespace": "e9106fc68e3044f0b1475b04bf4ffd5f",
+ "elasticsearch.node.name": "instance-0000000001",
102
0 commit comments