Skip to content

Commit

Permalink
Make test_otel more robust to elastic-transport changes (elastic#2470)
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin authored and iuliaferoli committed Mar 24, 2024
1 parent 2eb8fa0 commit 6ac9acf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test_elasticsearch/test_server/test_otel.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ def test_otel_end_to_end(monkeypatch, elasticsearch_url: str):
spans = memory_exporter.get_finished_spans()
assert len(spans) == 1
assert spans[0].name == "search"
assert spans[0].attributes == {
expected_attributes = {
"http.request.method": "POST",
"db.system": "elasticsearch",
"db.operation": "search",
"db.elasticsearch.path_parts.index": "logs-*",
}
# Assert expected atttributes are here, but allow other attributes too
# to make this test robust to elastic-transport changes
assert expected_attributes.items() <= spans[0].attributes.items()

0 comments on commit 6ac9acf

Please sign in to comment.