Skip to content

Conversation

@herin049
Copy link
Contributor

Description

Fixes issue where the opentelemetry-instrumentation-aiohttp-client library does not respect the suppress_http_instrumentation() context manager.

Fixes #3953

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Test cases have been updated to test suppression using suppress_http_instrumentation() in addition to suppress_instrumentation()

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • 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

@herin049 herin049 changed the title fix aiohttp-client to respect http instrumentation suppression opentelemetry-instrumentation-aiohttp-client: update instrumentor to respect http instrumentation suppression Nov 18, 2025
@herin049 herin049 requested a review from a team as a code owner November 18, 2025 20:12

# pylint:disable=unused-argument
def instrumented_init(wrapped, instance, args, kwargs):
if not is_instrumentation_enabled():
Copy link
Contributor Author

@herin049 herin049 Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opted to remove this check since I don't get its purpose. In addition, it could lead to unexpected behavior if the user creates a ClientSession object with instrumentation disabled and then subsequently re-enables instrumentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

opentelemetry-instrumentation-aiohttp-client: instrumentor does not respect "suppress_http_instrumentation"

1 participant