Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make test_otel more robust to elastic-transport changes #2470

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
Loading