Update OpenTelemetry.cs

This commit is contained in:
2025-04-17 21:56:21 -04:00
parent 243717fb25
commit 4f976fb7af

View File

@@ -38,13 +38,13 @@ public static class OpenTelemetry
// Metrics provided by System.Net libraries
.AddMeter("System.Net.Http")
.AddMeter("System.Net.NameResolution")
.AddMeter("MongoDB.Driver.Core.Extensions.DiagnosticSources")
.AddPrometheusExporter());
// Add Tracing for ASP.NET Core and our custom ActivitySource and export to Jaeger
var tracingOtlpEndpoint = configuration["OTLP_ENDPOINT_URL"];
otel.WithTracing(tracing =>
{
tracing.AddSource("MongoDB.Driver.Core.Extensions.DiagnosticSources");
tracing.AddAspNetCoreInstrumentation();
tracing.AddHttpClientInstrumentation();
if (!string.IsNullOrWhiteSpace(tracingOtlpEndpoint))