File tree Expand file tree Collapse file tree 4 files changed +10
-2
lines changed Expand file tree Collapse file tree 4 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 55 <NoWarn >$(NoWarn);NU1507</NoWarn >
66 </PropertyGroup >
77 <ItemGroup >
8+ <PackageVersion Include =" Azure.Monitor.OpenTelemetry.Exporter" Version =" 1.4.0" />
89 <PackageVersion Include =" Basic.CompilerLog.Util" Version =" 0.9.9" />
910 <PackageVersion Include =" AwesomeAssertions" Version =" $(AwesomeAssertionsVersion)" />
1011 <PackageVersion Include =" BenchmarkDotNet" Version =" $(BenchmarkDotNetPackageVersion)" />
161162 <PackageVersion Include =" Microsoft.Build.Utilities.Core" Version =" $(MicrosoftBuildMinimumVersion)" />
162163 <PackageVersion Include =" Microsoft.NET.StringTools" Version =" $(MicrosoftBuildMinimumVersion)" />
163164 </ItemGroup >
164- </Project >
165+ </Project >
Original file line number Diff line number Diff line change 11// Licensed to the .NET Foundation under one or more agreements.
22// The .NET Foundation licenses this file to you under the MIT license.
33
4+ using Azure . Monitor . OpenTelemetry . Exporter ;
45using System . CommandLine ;
56using System . CommandLine . Parsing ;
67using System . Diagnostics ;
@@ -59,6 +60,7 @@ static Program()
5960 . AddHttpClientInstrumentation ( )
6061 . AddRuntimeInstrumentation ( )
6162 . AddOtlpExporter ( )
63+ . AddAzureMonitorMetricExporter ( o => o . ConnectionString = Telemetry . Telemetry . ConnectionString )
6264 . Build ( ) ;
6365 tracerProvider = Sdk . CreateTracerProviderBuilder ( )
6466 . ConfigureResource ( r =>
@@ -68,6 +70,10 @@ static Program()
6870 . AddSource ( Activities . s_source . Name )
6971 . AddHttpClientInstrumentation ( )
7072 . AddOtlpExporter ( )
73+ . AddAzureMonitorTraceExporter ( o => {
74+ o . ConnectionString = Telemetry . Telemetry . ConnectionString ;
75+ o . EnableLiveMetrics = false ;
76+ } )
7177 . SetSampler ( new AlwaysOnSampler ( ) )
7278 . Build ( ) ;
7379 ( var s_parentActivityContext , var s_activityKind ) = DeriveParentActivityContextFromEnv ( ) ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public class Telemetry : ITelemetry
1414 private static FrozenDictionary < string , object ? > _commonProperties = new TelemetryCommonProperties ( ) . GetTelemetryCommonProperties ( ) ;
1515 private Task ? _trackEventTask ;
1616
17- private const string ConnectionString = "InstrumentationKey=74cc1c9e-3e6e-4d05-b3fc-dde9101d0254" ;
17+ public static string ConnectionString = "InstrumentationKey=74cc1c9e-3e6e-4d05-b3fc-dde9101d0254" ;
1818
1919 public bool Enabled { get ; }
2020
Original file line number Diff line number Diff line change 5050 </ItemGroup >
5151
5252 <ItemGroup >
53+ <PackageReference Include =" Azure.Monitor.OpenTelemetry.Exporter" />
5354 <PackageReference Include =" Microsoft.Extensions.FileSystemGlobbing" />
5455 <PackageReference Include =" Microsoft.VisualStudio.SolutionPersistence" />
5556 <PackageReference Include =" Newtonsoft.Json" />
You can’t perform that action at this time.
0 commit comments