Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,7 @@ async def on_request_start(
trace.propagation.set_span_in_context(trace_config_ctx.span)
)

propagators.inject(
tracer, type(params.headers).__setitem__, params.headers
)
propagators.inject(type(params.headers).__setitem__, params.headers)

async def on_request_end(
unused_session: aiohttp.ClientSession,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def _http_request(
"""Helper to start an aiohttp test server and send an actual HTTP request to it."""

async def do_request():
async def default_handler(unused_request):
async def default_handler(request):
assert "traceparent" in request.headers
return aiohttp.web.Response(status=int(status_code))

handler = request_handler or default_handler
Expand Down Expand Up @@ -281,8 +282,9 @@ async def do_request(url):
self.memory_exporter.clear()

def test_timeout(self):
async def request_handler(unused_request):
async def request_handler(request):
await asyncio.sleep(1)
assert "traceparent" in request.headers
return aiohttp.web.Response()

host, port = self._http_request(
Expand Down Expand Up @@ -312,6 +314,7 @@ def test_too_many_redirects(self):
async def request_handler(request):
# Create a redirect loop.
location = request.url
assert "traceparent" in request.headers
raise aiohttp.web.HTTPFound(location=location)

host, port = self._http_request(
Expand Down