Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-3124

Support Activity and DiagnosticsSource

    • Type: Icon: New Feature New Feature
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Diagnostics
    • Fully Compatible
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      The current diagnostics support include performance counters and trace source. .NET Core has moved towards the Activity and DiagnosticSource APIs to provide robust diagnostics and tracing. See:

      https://github.com/dotnet/diagnostics/blob/master/documentation/diagnostics-planing.md

      https://github.com/dotnet/runtime/blob/master/src/libraries/System.Diagnostics.DiagnosticSource/src/ActivityUserGuide.md

      https://github.com/dotnet/runtime/blob/master/src/libraries/System.Diagnostics.DiagnosticSource/src/DiagnosticSourceUsersGuide.md

      https://devblogs.microsoft.com/aspnet/observability-asp-net-core-apps/

      Would this team consider a PR that added a new event subscriber that conforms to these guidelines and enables Activity and DiagnosticListener-based tracing? This would then enable a number of scenarios, including plugging into Activity-based observability tools.

      I have a small PoC as an example of what the code looks like:

      https://github.com/jbogard/nsb-diagnostics-poc/blob/master/MongoDB.Driver.Core.Extensions.SystemDiagnostics/DiagnosticsActivityEventSubscriber.cs

            Assignee:
            Unassigned Unassigned
            Reporter:
            jimmy.bogard@gmail.com Jimmy Bogard
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: