diff --git a/src/dotnet/App.Server/Module/AppServerModule.cs b/src/dotnet/App.Server/Module/AppServerModule.cs index 774ac96dd0..615b6066dd 100644 --- a/src/dotnet/App.Server/Module/AppServerModule.cs +++ b/src/dotnet/App.Server/Module/AppServerModule.cs @@ -237,6 +237,7 @@ protected override void InjectServices(IServiceCollection services) }); // OpenTelemetry + services.AddSingleton(); var openTelemetryEndpoint = Settings.OpenTelemetryEndpoint; if (openTelemetryEndpoint.IsNullOrEmpty()) return; @@ -244,7 +245,6 @@ protected override void InjectServices(IServiceCollection services) var (host, port) = openTelemetryEndpoint.ParseHostPort(4317); var openTelemetryEndpointUri = $"http://{host}:{port.Format()}".ToUri(); Log.LogInformation("OpenTelemetry endpoint: {OpenTelemetryEndpoint}", openTelemetryEndpointUri.ToString()); - services.AddSingleton(); services.AddOpenTelemetry() .WithMetrics(builder => builder // gcloud exporter doesn't support some of metrics yet: