File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 ,
Original file line number Diff line number Diff line change 11using System . Diagnostics ;
22using System . Diagnostics . Metrics ;
3- using Azure . Monitor . OpenTelemetry . AspNetCore ;
43using Npgsql ;
54using OpenTelemetry ;
65using 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 [
Original file line number Diff line number Diff line change 5858{
5959 builder . AddCustomOpenTelemetry ( otelActivitySource , otelMeter ) ;
6060}
61- else
62- {
63- builder . Services . AddApplicationInsightsTelemetry ( ) ;
64- }
6561
6662builder . Services . Configure < AzureAdOptions > ( builder . Configuration . GetSection ( "AzureAd" ) ) ;
6763builder . Services . Configure < EmailOptions > ( builder . Configuration . GetSection ( "Email" ) ) ;
Original file line number Diff line number Diff line change 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" />
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" />
You can’t perform that action at this time.
0 commit comments