Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Change logger scope in log appender #2796

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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
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 (2c35ddc).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2796   +/-   ##
=====================================
  Coverage   79.6%   79.6%           
=====================================
  Files        124     124           
  Lines      23174   23178    +4     
=====================================
+ Hits       18456   18461    +5     
+ Misses      4718    4717    -1     

☔ 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.

@@ -173,8 +173,7 @@ where

let mut log_record = self.logger.create_log_record();

// TODO: Fix heap allocation
log_record.set_target(target.to_string());
log_record.set_target(target);
Copy link
Member

Choose a reason for hiding this comment

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

oh wait.. this works now?

Copy link
Member

Choose a reason for hiding this comment

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

@utpilla helped me understand better. We were unnecessarily copying the target before!

@gruebel Please do this change in a separate PR, with a before/after benchmark - it should show measurable improvement.

@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)

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