Skip to content

Conversation

D-Sokol
Copy link

@D-Sokol D-Sokol commented Oct 11, 2025

Description

This PR adds support for asynchronous request/response hooks in the aiohttp client instrumentation.

Current version supports only synchronous functions. For an async-oriented library aiohttp it's counterintuitive that async hook will not be called without any exceptions. That also does not align with httpx instrumentation which expects async hook for async requests.
My personal use case was the need to inspect the response body, which required to call await params.response.read() in the hook. Currently this is not possible.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A

Does This PR Require a Core Repo Change?

  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added

Copy link

linux-foundation-easycla bot commented Oct 11, 2025

CLA Signed
The committers listed above are authorized under a signed CLA.

@xrmx xrmx moved this to Ready for review in @xrmx's Python PR digest Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

1 participant