Record logger name as the instrumentation scope name #3810
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.39) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 256 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.332
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3810"
general
weight: 0.35
tm0nk
Description
Fixes issue #2485 Record logger name as the instrumentation scope name
Approach: Cache one Logger object per Python logger name in LoggingHandler. The
@lru_cacheannotation onget_loggerrequires Python 3.2 or later.The Open Telemetry Spec specifies that the Logger Name SHOULD be recorded as the Instrumentation Scope name. Reference: https://github.com/open-telemetry/opentelemetry-specification/pull/2359
This has already been implemented in Open Telemetry Java, but not in Open Telemetry Python.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
I've modified many of the tests in test_export.py to include an assert that tests that the logger name and instrumentation scope name are the same.
Will be happy to modify others to do the same validation.
Does This PR Require a Contrib Repo Change?
No, this brings Open Telemetry Python in line with the existing Open Telemetry spec.
Answer the following question based on these examples of changes that would require a Contrib Repo Change:
opentelemetry-api/oropentelemetry-sdk/test/utilhave changedscripts/that were copied over to the Contrib repo have changed-
pyproject.toml-
isort.cfg-
.flake8.github/CODEOWNERis added-
README.md-
CONTRIBUTING.mdChecklist: