Skip to content

_instrumentation in package.py for instrumentations#4178

Open
42Questions wants to merge 11 commits into
open-telemetry:mainfrom
42Questions:hardcode-instrumentation-name-4173
Open

_instrumentation in package.py for instrumentations#4178
42Questions wants to merge 11 commits into
open-telemetry:mainfrom
42Questions:hardcode-instrumentation-name-4173

Conversation

@42Questions
Copy link
Copy Markdown

@42Questions 42Questions commented Feb 7, 2026

Description

Refs #4173
Move _instrumentation_name to package.py and pass this to trace.get_tracer and metrics.get_meter during instrumentation. This ensures that instruments are created with the expected instrumentation scope name (e.g. opentelemetry.instrumentation.aio_pika).
Add new tests that show output uses new _instrumentation_name.
Do this for opentelemetry-instrumentation-aio-pika to establish pattern and then to roll out subsequently to other instrumentations.

Type of change

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

How Has This Been Tested?

  • Run tox tests for affected instrumentation pacakgestox -e py3-test-instrumentation-aio-pika-0 -- -k test_aio_pika_instrumentation -v — both existing and new test pass

Does This PR Require a Core Repo Change?

  • No.

Checklist:

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

@42Questions 42Questions marked this pull request as ready for review February 8, 2026 11:53
@42Questions 42Questions requested a review from a team as a code owner February 8, 2026 11:53
@42Questions 42Questions changed the title Added _instrumentation in package.py pattern for aio_pika _instrumentation in package.py for instrumentations Feb 10, 2026
@emdneto emdneto moved this to Approved PRs that need fixes in Python PR digest Feb 11, 2026
@emdneto emdneto moved this from Approved PRs that need fixes to Easy to review / merge / close in Python PR digest Feb 11, 2026
@42Questions 42Questions requested review from emdneto and xrmx February 12, 2026 18:58
Copy link
Copy Markdown
Member

@emdneto emdneto left a comment

Choose a reason for hiding this comment

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

@42Questions can you fix changelog pls

@tammy-baylis-swi tammy-baylis-swi moved this from Easy to review / merge / close to Approved PRs that need fixes in Python PR digest Feb 25, 2026
@xrmx
Copy link
Copy Markdown
Contributor

xrmx commented Mar 25, 2026

Aaron did some work around instrumentation metadata as well #4328

@emdneto
Copy link
Copy Markdown
Member

emdneto commented May 12, 2026

Thanks for the PR!

Just a heads-up: we no longer update CHANGELOG.md directly. The changelog is now generated from changelog fragments using Towncrier.

Please add the appropriate changelog fragment for this change instead of editing CHANGELOG.md manually. You can find the instructions and expected format in CONTRIBUTING.md.

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

Labels

None yet

Projects

Status: Approved PRs that need fixes

Development

Successfully merging this pull request may close these issues.

6 participants