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

Observability/OpenTelemetry - native support

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: Feature Request
    • None
    • Dotnet Drivers
    • 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?

      Description:

      The goal is the have possibility to instrument MongoDB.Client simply by calling AddSource("MongoDB.Driver") on OpenTelemetry API. There should be not need to include any additional library/call any additional MongoDB, specific method.

       

       

      using var tracerProvider = Sdk.CreateTracerProviderBuilder()
                  .AddSource("MongoDB.Driver") // or other chosen during implementation
                  .AddConsoleExporter()
                  .Build();

       

      Required changes:

      New reference to System.Diagnostics.DiagnosticSource will be needed to achieve this. OpenTelemetry Under the hood relays on ActivitySource.

      Traces/spans should be implemented according to semantic convention.

      Current state:

      There is a possibility to do similar things by using MongoDB.Driver.Core.Extensions.DiagnosticSources nuget package. However it is against best practices/recommendation and force end-users to utilize additional package.

            Assignee:
            Unassigned Unassigned
            Reporter:
            pkiekowicz@splunk.com Piotr Kiełkowicz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: