Skip to content

fix: Change logger scope in log appender#2796

Merged
cijothomas merged 2 commits intoopen-telemetry:mainfrom
gruebel:log-appender
Mar 13, 2025
Merged

fix: Change logger scope in log appender#2796
cijothomas merged 2 commits intoopen-telemetry:mainfrom
gruebel:log-appender

Conversation

@gruebel
Copy link
Member

@gruebel gruebel commented Mar 12, 2025

Fixes #2747

Changes

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@gruebel gruebel requested a review from a team as a code owner March 12, 2025 22:49
@codecov
Copy link

codecov bot commented Mar 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.6%. Comparing base (ad88615) to head (8ed638f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2796     +/-   ##
=======================================
- Coverage   79.6%   79.6%   -0.1%     
=======================================
  Files        124     124             
  Lines      23174   23179      +5     
=======================================
+ Hits       18456   18458      +2     
- Misses      4718    4721      +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cijothomas
Copy link
Member

Fixes #2747

Changes

If target is None, then get everything from InstrumentationScope itself. If target is there, then it should be used for name/ver/schema_url. But we should still copy the Attributes from Scope. (This requires some more investigation, so we can tackle it later)

@cijothomas cijothomas merged commit 66579ac into open-telemetry:main Mar 13, 2025
23 checks passed
@gruebel gruebel deleted the log-appender branch March 14, 2025 07:06
takumi-earth pushed a commit to earthlings-dev/opentelemetry-rust that referenced this pull request Jan 27, 2026
djvcom added a commit to djvcom/opentelemetry-rust that referenced this pull request Jan 29, 2026
When logs have a target set, the InstrumentationScope's version and
attributes were being discarded during OTLP export. The target parameter
now correctly overrides only the scope name, preserving other metadata.

This behaviour was introduced in PR open-telemetry#1869 to avoid exporting the
appender crate's version when the scope name was overridden by target.
However, PRs open-telemetry#2735 and open-telemetry#2796 subsequently changed both appenders to use
empty scopes, so this concern no longer applies. Additionally, users who
explicitly create scopes via logger_with_scope() would reasonably expect
their metadata to be preserved.

Fixes open-telemetry#3276
djvcom added a commit to djvcom/opentelemetry-rust that referenced this pull request Jan 29, 2026
When logs have a target set, the InstrumentationScope's version and
attributes were being discarded during OTLP export. The target parameter
now correctly overrides only the scope name, preserving other metadata.

This behaviour was introduced in PR open-telemetry#1869 to avoid exporting the
appender crate's version when the scope name was overridden by target.
However, PRs open-telemetry#2735 and open-telemetry#2796 subsequently changed both appenders to use
empty scopes, so this concern no longer applies. Additionally, users who
explicitly create scopes via logger_with_scope() would reasonably expect
their metadata to be preserved.

Fixes open-telemetry#3276
djvcom added a commit to djvcom/opentelemetry-rust that referenced this pull request Jan 29, 2026
When logs have a target set, the InstrumentationScope's version and
attributes were being discarded during OTLP export. The target parameter
now correctly overrides only the scope name, preserving other metadata.

This behaviour was introduced in PR open-telemetry#1869 to avoid exporting the
appender crate's version when the scope name was overridden by target.
However, PRs open-telemetry#2735 and open-telemetry#2796 subsequently changed both appenders to use
empty scopes, so this concern no longer applies. Additionally, users who
explicitly create scopes via logger_with_scope() would reasonably expect
their metadata to be preserved.

Fixes open-telemetry#3276
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.

Fix logger scope in log-appender

2 participants