Skip to content

Conversation

bisgaard-itis
Copy link

@bisgaard-itis bisgaard-itis commented Oct 8, 2025

Description

Support passing a TracerProvider when using the aiohttp server instrumentation library. This gives users of the library the possibility to provide their own TracerProvider instead of relying on the global one. This is in particular useful for testing.

Fixes # (issue)

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

  • I added the test test_non_global_tracer_provider which checks that a non-global TracerProvider can be provided when instrumenting the aiohttp server. I check that the non-global TracerProvider is used by the instrumentation library by setting a non-default sampling probability in that provider and checking that the corresponding number of traces are collected.

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
  • Documentation has been updated

Copy link

CLA Not Signed

@bisgaard-itis bisgaard-itis changed the title 3801 support passing tracer provider in aiohttp server instrumentation lib Support passing tracer provider in aiohttp server instrumentation lib Oct 8, 2025
@xrmx xrmx moved this to Reviewed PRs that need fixes in @xrmx's Python PR digest Oct 10, 2025
@xrmx
Copy link
Contributor

xrmx commented Oct 10, 2025

@bisgaard-itis You need to sign the CLA in order to contribute to OpenTelemetry, thanks.

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

Labels

None yet

Projects

Status: Reviewed PRs that need fixes

Development

Successfully merging this pull request may close these issues.

Allow passing a TracerProvider when instrumenting an aiohttp server

2 participants