Skip to content

Commit a648bef

Browse files
committed
instrumentation/django: fix test_trace_parent
Remove async keyword that did not make the test run and then fix tests to send the traceparent as header instead of query string. Fix #2336
1 parent 223c79c commit a648bef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: instrumentation/opentelemetry-instrumentation-django/tests/test_middleware.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -390,15 +390,15 @@ def response_hook(span, request, response):
390390
self.assertIsInstance(response_hook_args[2], HttpResponse)
391391
self.assertEqual(response_hook_args[2], response)
392392

393-
async def test_trace_parent(self):
393+
def test_trace_parent(self):
394394
id_generator = RandomIdGenerator()
395395
trace_id = format_trace_id(id_generator.generate_trace_id())
396396
span_id = format_span_id(id_generator.generate_span_id())
397397
traceparent_value = f"00-{trace_id}-{span_id}-01"
398398

399399
Client().get(
400400
"/span_name/1234/",
401-
traceparent=traceparent_value,
401+
HTTP_TRACEPARENT=traceparent_value,
402402
)
403403
span = self.memory_exporter.get_finished_spans()[0]
404404

0 commit comments

Comments
 (0)