Skip to content

Commit

Permalink
Add resouce_attr test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimf5 committed Nov 13, 2024
1 parent ab1e772 commit 4d49d0c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_otel.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
}
otel_service_name {{ name }};
otel_resource_attr my.name "my {{ name }}";
otel_trace on;
add_header "X-Otel-Trace-Id" $otel_trace_id;
Expand Down Expand Up @@ -286,6 +287,13 @@ def test_service_name(self, http_ver, batches, idx, otel_mode):
== f"test_http{http_ver}"
)

@pytest.mark.parametrize("idx", [0, 1, 2], ids=["batch"] * 3)
def test_resouce_attr(self, http_ver, batches, idx, otel_mode):
assert (
span_attr(batches[idx][0].resource, "my.name", "string_value")
== f"my test_http{http_ver}"
)

@pytest.mark.parametrize(
("idx", "value"),
enumerate(
Expand Down

0 comments on commit 4d49d0c

Please sign in to comment.