Last active
December 3, 2022 12:12
-
-
Save wullemsb/70fae615a805dbfadbc51e53ea739101 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var api = ResourceBuilder.CreateEmpty() | |
| .AddService("Example-Service") | |
| .AddAttributes(new KeyValuePair<string, object>[] | |
| { | |
| new("development.environment",""), | |
| new("telemetry.sdk.name","dotnet"), | |
| new("telemetry.sdk.version","6.0.0"), | |
| }); | |
| builder.Services.AddOpenTelemetryTracing(b => | |
| { | |
| b.AddHttpClientInstrumentation(); | |
| b.AddAspNetCoreInstrumentation(); | |
| b.AddSqlClientInstrumentation(options => { | |
| options.SetDbStatementForText = true; | |
| }); | |
| b.SetResourceBuilder(api); | |
| b.AddAzureMonitorTraceExporter(options => | |
| { | |
| options.ConnectionString = Configuration.GetSection("ApplicationInsights").GetValue<string>("ConnectionString"); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment