-
Notifications
You must be signed in to change notification settings - Fork 765
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
[SelfDiagnostics] Add new public logging APIs for self diagnostics #1529
Conversation
ERROR: Exception in Command Processing for EventSource OpenTelemetry-Api: Multiple definitions for string "event_EmitCriticalEvent".
Codecov Report
@@ Coverage Diff @@
## main #1529 +/- ##
==========================================
- Coverage 83.61% 82.94% -0.68%
==========================================
Files 192 193 +1
Lines 6172 6245 +73
==========================================
+ Hits 5161 5180 +19
- Misses 1011 1065 +54
|
@xiang17 would you post some perf measurements here? |
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.
The new simplified API wrapper on top on EventSource sounds like a good thing. I have one question: |
What's the scenario of turning on/off for individual components? From my experience, when there's an issue, it's easier to ask the customer to reproduce the issue and collect all data than to ask the the same steps done repeatedly for different combinations of components.
I had the same hesitant on this. Another approach I had was having a LoggerFactory and asking each class to initialize a logger object like SLF4J. The downside is we'd have one logger instance for each class where logger is needed, compared to only one logger instance globally in the current approach. Considering the goal is to make it a bare-bones logger infrastructure that works in most cases, I used the current approach. What do you think? |
One scenario is "finding the needle from the hay" - If every component is using separate eventsourcename, and separate event itself, then its easy to spot in tools like PerfView. But this is not a hard requirement :) |
@xiang17 While I generally approve of this approach, I'd be a bit cautious about introducing a set of new self-logging API with less than a week to GA. I'll mark this is post-ga and won't merge. Thanks a lot of making this extremely valuable feature. |
# Conflicts: # src/OpenTelemetry.Api/.publicApi/net452/PublicAPI.Unshipped.txt # src/OpenTelemetry.Api/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Asking community review on a new set of logging API signatures as described in key feature#1 in issue #1258
My intention is to migrate all existing self-diagnostics-related logging methods (such as
OpenTelemetrySdkEventSource.Log.SpanProcessorException
,OpenTelemetryProtocolExporterEventSource.Log.FailedToReachCollector
) to this new set of logging APIs once finalized and approved. And all future need for self diagnostics hopefully could use this set of logging APIs, rather than creating yet another custom subclass ofEventSource
.For example, right now
OpenTelemetry.Exporter.Zipkin.ZipkinExporter
class calls methods in a customZipkinExporterEventSource
class:With the new APIs, no new custom
EventSource
class are needed, it calls:Changes
Added a new class
SelfDiagnostics
inOpenTelemetry.Api.csproj
, which includes a list of internal logging APIs:LogCritical
,LogError
,LogWarning
,LogInformation
andLogVerbose
.These methods call
OpenTelemetryApiEventSource.Log
to emit EventSource events.For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes