Skip to content

Commit

Permalink
instrumentation/django: fix test_trace_parent
Browse files Browse the repository at this point in the history
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
  • Loading branch information
xrmx committed Mar 8, 2024
1 parent 46a8c59 commit b40f049
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -390,15 +390,15 @@ def response_hook(span, request, response):
self.assertIsInstance(response_hook_args[2], HttpResponse)
self.assertEqual(response_hook_args[2], response)

async def test_trace_parent(self):
def test_trace_parent(self):
id_generator = RandomIdGenerator()
trace_id = format_trace_id(id_generator.generate_trace_id())
span_id = format_span_id(id_generator.generate_span_id())
traceparent_value = f"00-{trace_id}-{span_id}-01"

Client().get(
"/span_name/1234/",
traceparent=traceparent_value,
headers={"traceparent": traceparent_value},
)
span = self.memory_exporter.get_finished_spans()[0]

Expand Down

0 comments on commit b40f049

Please sign in to comment.