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

Record logger name as the instrumentation scope name #4208

Conversation

sfc-gh-jopel
Copy link
Contributor

@sfc-gh-jopel sfc-gh-jopel commented Oct 1, 2024

Description

(Copied from #3810)

Fixes issue #2485 Record logger name as the instrumentation scope name

Approach: Cache one Logger object per Python logger (name, version, schema_url) in LoggingHandler.

The Open Telemetry Spec specifies that the Logger Name SHOULD be recorded as the Instrumentation Scope name. Reference: open-telemetry/opentelemetry-specification#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.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

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.

Added logging benchmarks and caching tests.

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

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

@sfc-gh-jopel sfc-gh-jopel requested a review from a team as a code owner October 1, 2024 21:36
Copy link

linux-foundation-easycla bot commented Oct 1, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@sfc-gh-jopel sfc-gh-jopel changed the title Fix issue 2485 instrumentation scope name 2 Record logger name as the instrumentation scope name Oct 1, 2024
Copy link
Member

@aabmass aabmass left a comment

Choose a reason for hiding this comment

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

LGTM with the explicit caching code

@aabmass aabmass added the Approve Public API check This label shows that the public symbols added or changed in a PR are strictly necessary label Oct 10, 2024
@aabmass
Copy link
Member

aabmass commented Oct 10, 2024

@sfc-gh-jopel thanks! Can you resolve all the comment threads that have been addressed? We just need one more approval and can merge this.

Copy link
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.

Left some comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approve Public API check This label shows that the public symbols added or changed in a PR are strictly necessary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants