Skip to content

Commit

Permalink
add httpclient instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsonax committed Jun 3, 2024
1 parent ee33839 commit 6f3d6d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CleanAspCore/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
builder.AddAuthServices();
builder.AddAppServices();
builder.AddOpenTelemetryServices();

builder.Services.AddHttpClient();
builder.Services.AddValidatorsFromAssembly(Assembly.GetExecutingAssembly(), includeInternalTypes: true);
builder.Services.AddDbContext<HrContext>();

Expand Down
2 changes: 2 additions & 0 deletions CleanAspCore/Telemetry/AppConfigurationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ internal static void AddOpenTelemetryServices(this WebApplicationBuilder builder
.AddSource(Instrumentation.ActivitySource.Name)
.AddProcessor(new EnrichSpanProcessor())
.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddEntityFrameworkCoreInstrumentation())
.WithMetrics(metrics => metrics
.AddHttpClientInstrumentation()
.AddAspNetCoreInstrumentation()
.AddMeter(Instrumentation.Meter.Name));

Expand Down

0 comments on commit 6f3d6d0

Please sign in to comment.