Skip to content

Commit

Permalink
HH-244220: add http.target to telemetry test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparkymann committed Jan 14, 2025
1 parent c467073 commit 62281fd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_get_netloc(self) -> None:

@router.get('/page_a')
async def get_page_a(request: Request, http_client: HttpClient) -> None:
await http_client.get_url(request.headers.get('host'), '/page_b')
await http_client.get_url(request.headers.get('host'), '/page_b?firstParam=1&secondParam=2')


@router.get('/page_b')
Expand Down Expand Up @@ -120,7 +120,7 @@ async def test_parent_span(self, frontik_app: FrontikApplication) -> None:
BATCH_SPAN_PROCESSOR[0].force_flush()
assert len(SPAN_STORAGE) == 4
client_a_span = find_span('http.request.cloud.region', 'externalRequest')
server_b_span = find_span('http.target', '/page_b')
server_b_span = find_span('http.route', '/page_b')
SPAN_STORAGE.clear()

assert client_a_span is not None
Expand All @@ -133,3 +133,4 @@ async def test_parent_span(self, frontik_app: FrontikApplication) -> None:
assert server_b_span.attributes.get(SpanAttributes.CODE_NAMESPACE) == 'tests.test_telemetry'
assert server_b_span.attributes.get(SpanAttributes.USER_AGENT_ORIGINAL) == self.app.app_name
assert server_b_span.attributes.get(SpanAttributes.HTTP_ROUTE) == '/page_b'
assert server_b_span.attributes.get(SpanAttributes.HTTP_TARGET) == '/page_b?firstParam=1&secondParam=2'

0 comments on commit 62281fd

Please sign in to comment.