Skip to content

Commit

Permalink
chore: register OtelMetrucs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexis-kochetov committed Apr 11, 2024
1 parent 8a6ab8b commit d2d5bb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dotnet/App.Server/Module/AppServerModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,14 @@ protected override void InjectServices(IServiceCollection services)
});

// OpenTelemetry
services.AddSingleton<OtelMetrics>();
var openTelemetryEndpoint = Settings.OpenTelemetryEndpoint;
if (openTelemetryEndpoint.IsNullOrEmpty())
return;

var (host, port) = openTelemetryEndpoint.ParseHostPort(4317);
var openTelemetryEndpointUri = $"http://{host}:{port.Format()}".ToUri();
Log.LogInformation("OpenTelemetry endpoint: {OpenTelemetryEndpoint}", openTelemetryEndpointUri.ToString());
services.AddSingleton<OtelMetrics>();
services.AddOpenTelemetry()
.WithMetrics(builder => builder
// gcloud exporter doesn't support some of metrics yet:
Expand Down

0 comments on commit d2d5bb5

Please sign in to comment.