(this IHostApplicationBuilder builder)
| 32 | } |
| 33 | |
| 34 | public static IHostApplicationBuilder ConfigureOpenTelemetry(this IHostApplicationBuilder builder) |
| 35 | { |
| 36 | builder.Logging.AddOpenTelemetry(logging => |
| 37 | { |
| 38 | logging.IncludeFormattedMessage = true; |
| 39 | logging.IncludeScopes = true; |
| 40 | }); |
| 41 | |
| 42 | builder.Services.AddOpenTelemetry() |
| 43 | .WithMetrics(metrics => |
| 44 | { |
| 45 | metrics.AddAspNetCoreInstrumentation() |
| 46 | .AddHttpClientInstrumentation() |
| 47 | .AddRuntimeInstrumentation(); |
| 48 | }) |
| 49 | .WithTracing(tracing => |
| 50 | { |
| 51 | tracing.AddAspNetCoreInstrumentation() |
| 52 | // Uncomment the following line to enable gRPC instrumentation (requires the OpenTelemetry.Instrumentation.GrpcNetClient package) |
| 53 | //.AddGrpcClientInstrumentation() |
| 54 | .AddHttpClientInstrumentation(); |
| 55 | }); |
| 56 | |
| 57 | builder.AddOpenTelemetryExporters(); |
| 58 | |
| 59 | return builder; |
| 60 | } |
| 61 | |
| 62 | private static IHostApplicationBuilder AddOpenTelemetryExporters(this IHostApplicationBuilder builder) |
| 63 | { |
no test coverage detected