-
Notifications
You must be signed in to change notification settings - Fork 772
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
OTLP LogExporter to support ILogger Scopes #3218
OTLP LogExporter to support ILogger Scopes #3218
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3218 +/- ##
==========================================
- Coverage 85.74% 85.23% -0.51%
==========================================
Files 260 252 -8
Lines 9358 9234 -124
==========================================
- Hits 8024 7871 -153
- Misses 1334 1363 +29
|
scopeDepth++; | ||
foreach (var scopeItem in scope) | ||
{ | ||
var scopeItemWithDepthInfo = new KeyValuePair<string, object>($"[Scope.{scopeDepth}]:{scopeItem.Key}", scopeItem.Value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I anticipate users wanting to change this prefix behavior, but something we can tackle later 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be nice to avoid the new string allocation each time, doesn't block this PR though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. The description has this left as open question.
Merging to make progress. (OTLP Log Exporter is now almost ready feature-wise, except the SDK level issue related to buffering : #2905)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Towards : #2482
Focused on just getting the functionality and example usage.
Tests are not added, as the current test approach cannot be used for scopes, so this will be a separate PR.
Open qn:
For scopes, keys are prefixed with "[Scope.depth]:". This does require string allocated, but avoids collision when same keys are repeated in diff. scope depths... We can revisit this based on user feedback :)
For the code below:
Sample output from OTLP collector