Skip to content

Commit 91df8ab

Browse files
Remove application insights
1 parent 935e814 commit 91df8ab

4 files changed

Lines changed: 0 additions & 32 deletions

File tree

api.Tests/appsettings.Test.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
"OpenTelemetry": {
3333
"Enabled": false
3434
},
35-
"ApplicationInsights": {
36-
"ConnectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://example.invalid/"
37-
},
3835
"Analysis": {
3936
"AnalysisGroupTimeoutMinutes": 60,
4037
"AnalysisGroupTimeoutCheckIntervalSeconds": 60,

api/Configurations/OpenTelemetryConfiguration.cs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Diagnostics;
22
using System.Diagnostics.Metrics;
3-
using Azure.Monitor.OpenTelemetry.AspNetCore;
43
using Npgsql;
54
using OpenTelemetry;
65
using OpenTelemetry.Exporter;
@@ -56,28 +55,6 @@ Meter meter
5655
.AddProcessInstrumentation();
5756
});
5857

59-
// Conditionally connect to Azure Monitor
60-
var azureMonitorExportEnabled =
61-
builder.Configuration.GetValue<bool?>("OpenTelemetry:AzureMonitorExportEnabled")
62-
?? false;
63-
64-
if (azureMonitorExportEnabled)
65-
{
66-
var applicationInsightsConnectionString = builder.Configuration[
67-
"ApplicationInsights:ConnectionString"
68-
];
69-
70-
if (!string.IsNullOrEmpty(applicationInsightsConnectionString))
71-
{
72-
builder
73-
.Services.AddOpenTelemetry()
74-
.UseAzureMonitor(o =>
75-
{
76-
o.ConnectionString = applicationInsightsConnectionString;
77-
});
78-
}
79-
}
80-
8158
// Connect to OpenTelemetry OTLP exporter if endpoint is provided, used for local aspire dashboard
8259
var openTelemetryEndpoint = builder.Configuration["OpenTelemetry:OtelExporterOtlpEndpoint"];
8360
var openTelemetryProtocolSetting = builder.Configuration[

api/Program.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@
5858
{
5959
builder.AddCustomOpenTelemetry(otelActivitySource, otelMeter);
6060
}
61-
else
62-
{
63-
builder.Services.AddApplicationInsightsTelemetry();
64-
}
6561

6662
builder.Services.Configure<AzureAdOptions>(builder.Configuration.GetSection("AzureAd"));
6763
builder.Services.Configure<EmailOptions>(builder.Configuration.GetSection("Email"));

api/api.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
<ItemGroup>
1717
<PackageReference Include="Azure.Storage.Blobs" Version="12.27.0" />
1818
<PackageReference Include="BitMiracle.LibTiff.NET" Version="2.4.660" />
19-
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="3.1.0" />
2019
<PackageReference Include="Microsoft.Data.Sqlite" Version="10.0.10" />
2120
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.10" />
2221
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.10" />
@@ -31,7 +30,6 @@
3130
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.5.0" />
3231
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.10" />
3332
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.10" />
34-
<PackageReference Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.4.0" />
3533
<PackageReference Include="Npgsql.OpenTelemetry" Version="10.0.2" />
3634
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.15.3" />
3735
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.15.3" />

0 commit comments

Comments
 (0)