Skip to content

Commit

Permalink
[gh-1322] Update container host to use connection string
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmind committed Jan 6, 2024
1 parent 3d750e0 commit 47c7b3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/Container.Manager/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ public void ConfigureServices(IServiceCollection services)
}

private void ConfigureAzureDependentServices(IServiceCollection services) {
var instrumentationKey = Environment.GetEnvironmentVariable("SHARPLAB_TELEMETRY_KEY");
if (instrumentationKey == null) {
Console.WriteLine("[WARN] AppInsights instrumentation key was not found.");
var connectionString = Environment.GetEnvironmentVariable("SHARPLAB_TELEMETRY_CONNECTION_STRING");
if (connectionString == null) {
Console.WriteLine("[WARN] AppInsights connection string was not found.");
return;
}

var configuration = new TelemetryConfiguration { InstrumentationKey = instrumentationKey };
var configuration = new TelemetryConfiguration { ConnectionString = connectionString };
services.AddSingleton(new TelemetryClient(configuration));
services.AddHostedService<ContainerCountMetricReporter>();
}
Expand Down

0 comments on commit 47c7b3b

Please sign in to comment.