File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
samples/Sentry.Samples.OpenTelemetry.AzureFunctions Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 1+ using Microsoft . Extensions . DependencyInjection ;
12using Microsoft . Extensions . Hosting ;
23using Microsoft . Extensions . Logging ;
3- using OpenTelemetry ;
44using OpenTelemetry . Trace ;
55using Sentry . OpenTelemetry ;
66
7- using var tracerProvider = Sdk . CreateTracerProviderBuilder ( )
8- . AddSentry ( ) // <-- Configure OpenTelemetry to send traces to Sentry
9- . AddHttpClientInstrumentation ( ) // From OpenTelemetry.Instrumentation.Http... adds automatic tracing for outgoing HTTP requests
10- . Build ( ) ;
11-
127var host = new HostBuilder ( )
138 . ConfigureFunctionsWorkerDefaults ( )
9+ . ConfigureServices ( services =>
10+ {
11+ services . AddOpenTelemetry ( ) . WithTracing ( builder =>
12+ {
13+ builder
14+ . AddSentry ( ) // <-- Configure OpenTelemetry to send traces to Sentry
15+ . AddHttpClientInstrumentation ( ) ; // From OpenTelemetry.Instrumentation.Http... adds automatic tracing for outgoing HTTP requests
16+ } ) ;
17+ } )
1418 . ConfigureLogging ( logging =>
1519 {
1620 logging . AddSentry ( options =>
Original file line number Diff line number Diff line change 1010 <PackageReference Include =" Microsoft.Azure.Functions.Worker.Extensions.Http" Version =" 3.0.13" />
1111 <PackageReference Include =" Microsoft.Azure.Functions.Worker.Extensions.Timer" Version =" 4.2.0" />
1212 <PackageReference Include =" Microsoft.Azure.Functions.Worker.Sdk" Version =" 2.0.0" />
13- <PackageReference Include =" OpenTelemetry" Version =" 1.13.0" />
14- <PackageReference Include =" OpenTelemetry.Instrumentation.Http" Version =" 1.13.0" />
13+ <PackageReference Include =" OpenTelemetry" Version =" 1.14.0" />
14+ <PackageReference Include =" OpenTelemetry.Extensions.Hosting" Version =" 1.14.0" />
15+ <PackageReference Include =" OpenTelemetry.Instrumentation.Http" Version =" 1.14.0" />
1516 </ItemGroup >
1617
1718 <ItemGroup >
You can’t perform that action at this time.
0 commit comments