Skip to content

Commit 1034b74

Browse files
Refactor: replace use of SpanAttributes (#3504)
1 parent 3efd161 commit 1034b74

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/test_aiohttp_server_integration.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
AioHttpServerInstrumentor,
2525
)
2626
from opentelemetry.instrumentation.utils import suppress_http_instrumentation
27-
from opentelemetry.semconv.trace import SpanAttributes
27+
from opentelemetry.semconv._incubating.attributes.http_attributes import (
28+
HTTP_METHOD,
29+
HTTP_STATUS_CODE,
30+
HTTP_URL,
31+
)
2832
from opentelemetry.test.globals_test import reset_trace_globals
2933
from opentelemetry.test.test_base import TestBase
3034
from opentelemetry.util._importlib_metadata import entry_points
@@ -127,15 +131,11 @@ async def test_status_code_instrumentation(
127131

128132
[span] = memory_exporter.get_finished_spans()
129133

130-
assert expected_method.value == span.attributes[SpanAttributes.HTTP_METHOD]
131-
assert (
132-
expected_status_code
133-
== span.attributes[SpanAttributes.HTTP_STATUS_CODE]
134-
)
134+
assert expected_method.value == span.attributes[HTTP_METHOD]
135+
assert expected_status_code == span.attributes[HTTP_STATUS_CODE]
135136

136137
assert (
137-
f"http://{server.host}:{server.port}{url}"
138-
== span.attributes[SpanAttributes.HTTP_URL]
138+
f"http://{server.host}:{server.port}{url}" == span.attributes[HTTP_URL]
139139
)
140140

141141

0 commit comments

Comments
 (0)