_instrumentation in package.py for instrumentations#4178
Open
42Questions wants to merge 11 commits intoopen-telemetry:mainfrom
Open
_instrumentation in package.py for instrumentations#417842Questions wants to merge 11 commits intoopen-telemetry:mainfrom
42Questions wants to merge 11 commits intoopen-telemetry:mainfrom
Conversation
…om/42Questions/opentelemetry-python-contrib into hardcode-instrumentation-name-4173
xrmx
reviewed
Feb 9, 2026
instrumentation/opentelemetry-instrumentation-aio-pika/tests/test_aio_pika_instrumentation.py
Outdated
Show resolved
Hide resolved
emdneto
reviewed
Feb 10, 2026
| spans = self.memory_exporter.get_finished_spans() | ||
| self.assertEqual(len(spans), 1) | ||
| self.assertEqual( | ||
| spans[0].instrumentation_scope.name, _instrumentation_name |
Member
There was a problem hiding this comment.
Instead of using the _instrumentation_name, can we make it hardcoded here?
emdneto
approved these changes
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refs #4173
Move
_instrumentation_nametopackage.pyand pass this totrace.get_tracerandmetrics.get_meterduring 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-pikato establish pattern and then to roll out subsequently to other instrumentations.Type of change
How Has This Been Tested?
tox -e py3-test-instrumentation-aio-pika-0 -- -k test_aio_pika_instrumentation -v— both existing and new test passDoes This PR Require a Core Repo Change?
Checklist: