-
Notifications
You must be signed in to change notification settings - Fork 785
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
Error logging with EventSource #85
Comments
We talked about this on the meeting today - would it be preferable to use LibLog for this rather than EventSource? @lmolkova |
EventSource is the default way to do library debug tracing for the following reasons
Overall LibLog was created in pre-ILogger era and does not intend to solve library debugging issues and rather solves dependency issues for the application. So I'd say EventSource (even though not very friendly) is an only choice and more friendly alternative is ILogger (which is not as performant and still an extra dependency) |
How does EventSource work with non-Windows systems/hosts? I'm not super familiar with it. |
It uses LTTng on linux and you can view traces with standard tools perfview/perfcollect . https://lttng.org/blog/2018/08/28/bringing-dotnet-perf-analysis-to-linux/ With .NET Core 3.0 there will be more tools for that (dotnet-trace): https://devblogs.microsoft.com/dotnet/introducing-diagnostics-improvements-in-net-core-3-0/ |
Lots of good info about Maybe a little bit old, but this issue from the aspnet repo has a thorough overview of the different logging tech. It may be worth pointing out that ASP.NET uses both EventSource and ILogger for their logging purposes, so which framework is selected may depend more on exactly what is being logged. Are these messages that make sense ending up in an EventLog. Are end users actually interested in getting these logs in their Serilog/log4Net log files? Are they actually useful for that? |
DiagnosticSource is not a good choice for lib debugging traces because of perf concerns and bridge to EventSource is rather complicated and limited in features. Also, it's even less friendly than EventSource. The logs we intend to write in the OpenTelemetry are for debugging the library - when an error happens (bug, crash, perf degradation) we should be able to give users instruction what and how to capture so we can parse these logs and understand what went wrong. Users are not expected to configure this logging and basically it's not useful for them as long as things work. ASP.NET Core provides logs and scopes that users are interested in, even when no ASP.NET Core errors happen. |
Sounds good, thanks for the overview @lmolkova. @bruno-garcia, I think you brought up LibLog at the meeting today but I don't remember if you had any other specific reason you wanted to avoid EventSource. Do you have anything you'd like to add or is it reasonable to continue forward with EventSource? @austinlparker - If I determine if have some time to look at this in the next week I'll ask to have this assigned to me. Currently it's marked as for the SDK 0.1 which was due last month, so what's the time frame for this item? Ready by Beta on Oct 1st? |
I'm going to go through this week and re-do the milestones so they're up to date, but yeah it'd be good to have this in by the end of the month. |
@veleek I believe with the clarifications of @lmolkova it seems like Would be nice to understand further:
|
AFAIK lttng should work on macos. Dotnet trace works on Windows, Linux and macos. Regarding bridge to ilogger, what scenarios we have on mind for that? I suggest that we do this when we understand that dotnet trace via pure eventsource is not enought to satisfy them. |
My thoughts on |
This is exactly my question - how would you use information that OTel received the Diagnostic Source callback as long as it works properly? And volume of these logs is overwhelming. So you'd care about this logs only when there are errors and logs OTel produce is purely diagnostic thing for OTel. At least all the logs it produces today or // todos I'm the code are internal diagostics of OTel. |
LTTng is a Linux kernel specific feature so it doesn't work on macOS :) But as mentioned |
@sywhang thanks for the clarification! BTW, would dotnet-trace work on .NET Core 2.x app? If not, what would be the options for macOS app on 2.x? |
There are 2 options available for consuming these events in .NET Core 2.2 on macOS. To consume in in-proc, we can leverage EventListener (similar to how we do it in 3.0). To consume it out-of-proc, there are couple of options available from .NET Core 2.2. One is an undocumented runtime behavior of enabling EventPipe via file-based sessions (basically dropping a config file with a certain format to a well-known directory that the runtime is polling for). There is also another way of enabling it via environment variables. It's kind of complicated to use and frankly weren't designed to be public-facing (hence the lack of documentation), but it does exist. |
I was searching through EventSource implementation , and found that we have 3 EventSource implementations. All of them are in same project - Was this intentionally done, or leftovers/accidentally created? The collector EventSource is public, which should be made internal as well. |
At the moment, the CollectorEventSource is used from two other other projects, but it really shouldn't be public. Move/copy/duplicate this EventSource as necessary (changing the provider name) to the project(s) that currently call these events. I'm sure the OpenTelemetrySdkEventSource and OpenTelemetryEventSource could be merged into a single provider... |
I got a question about how to collect EventSource events on Linux. The only guide i could find is here: - https://docs.microsoft.com/dotnet/core/diagnostics/trace-perfcollect-lttng I found other references to LTT here: - open-telemetry/opentelemetry-dotnet#85 (comment)
…try#85) * Updated MassTransit instrumentation * fixed unit tests * Assert only sampled traces * Update CODEOWNERS
Replace all TODO and Debug.Write with the proper error logging
The text was updated successfully, but these errors were encountered: