Config inner sdk logger #5261
Open
vivek378521 wants to merge 2 commits into
Open
Conversation
b2b850f to
130e0ba
Compare
130e0ba to
fa46880
Compare
fa46880 to
54f2ebd
Compare
Contributor
Author
|
Hi I was gone for a long time, but I had this PR which was closed due to inactivity. I wanted to complete it, so I have done the changes on a freshly pulled main and added the change, tested it. (Used AI to write test cases, as the older PR only had 1) If anyone can review it then it would be awesome! All checks are passing. |
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
Add a way to configure the
InstrumentationScopeused by the SDK logger created internally byLoggingHandler.LoggingHandlercurrently creates SDK loggers internally, so users cannot populate the instrumentation scope values the same way they can when creating tracers or meters directly. This change allows callers to provide an explicit instrumentation scope toLoggingHandler.The default behavior is preserved: when no instrumentation scope is provided,
LoggingHandlercontinues to use the logging record name as the logger/scope name. Existing logger providers that do not accept the new optional argument continue to work when the new argument is not supplied.Fixes #4060
Type of change
How Has This Been Tested?
LoggerProvider.get_loggerwith an explicit instrumentation scope.LoggingHandlerto verify exportedLogDatauses the provided instrumentation scope.mainand reapplying the change.Reproduced with:
Results:
Does This PR Require a Contrib Repo Change?
Checklist: