|
2 | 2 |
|
3 | 3 | import pytest
|
4 | 4 | from opentelemetry import trace
|
| 5 | +from opentelemetry.trace import SpanKind |
5 | 6 | from opentelemetry.sdk.trace import TracerProvider
|
6 | 7 | from opentelemetry.sdk.trace.export import SimpleSpanProcessor
|
7 | 8 | from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter
|
@@ -80,6 +81,7 @@ def test_client_request(mock_request, get_request, setup):
|
80 | 81 | _request_options=create_request_options(parent_span, exported_span)
|
81 | 82 | )
|
82 | 83 |
|
| 84 | + assert exported_span.kind == SpanKind.CLIENT |
83 | 85 | assert exported_span.name == f"{get_request.method} {get_request.matched_route}"
|
84 | 86 | assert exported_span.attributes["url.path"] == get_request.path
|
85 | 87 | assert exported_span.attributes["http.request.method"] == get_request.method
|
@@ -136,6 +138,7 @@ def test_client_request_no_parent_span(mock_request, get_request, setup):
|
136 | 138 | _request_options=create_request_options(None, exported_span)
|
137 | 139 | )
|
138 | 140 |
|
| 141 | + assert exported_span.kind == SpanKind.CLIENT |
139 | 142 | assert exported_span.name == f"{get_request.method} {get_request.matched_route}"
|
140 | 143 | assert exported_span.attributes["url.path"] == get_request.path
|
141 | 144 | assert exported_span.attributes["http.request.method"] == get_request.method
|
@@ -174,6 +177,7 @@ def test_with_headers_exception(mock_request, get_request, setup):
|
174 | 177 | actual_headers = create_request_options(None, exported_span)['headers']
|
175 | 178 | assert expected_headers == actual_headers
|
176 | 179 |
|
| 180 | + assert exported_span.kind == SpanKind.CLIENT |
177 | 181 | assert exported_span.name == f"{get_request.method} {get_request.matched_route}"
|
178 | 182 | assert exported_span.attributes["url.path"] == get_request.path
|
179 | 183 | assert exported_span.attributes["http.request.method"] == get_request.method
|
|
0 commit comments