Skip to content

Commit ce50d9e

Browse files
authored
Make test_otel more robust to elastic-transport changes (#2470)
1 parent 53c5ea3 commit ce50d9e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test_elasticsearch/test_server/test_otel.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ def test_otel_end_to_end(monkeypatch, elasticsearch_url: str):
4444
spans = memory_exporter.get_finished_spans()
4545
assert len(spans) == 1
4646
assert spans[0].name == "search"
47-
assert spans[0].attributes == {
47+
expected_attributes = {
4848
"http.request.method": "POST",
4949
"db.system": "elasticsearch",
50+
"db.operation": "search",
5051
"db.elasticsearch.path_parts.index": "logs-*",
5152
}
53+
# Assert expected atttributes are here, but allow other attributes too
54+
# to make this test robust to elastic-transport changes
55+
assert expected_attributes.items() <= spans[0].attributes.items()

0 commit comments

Comments
 (0)