Skip to content

Commit

Permalink
Added gRPC instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Enkidu93 committed Sep 21, 2023
1 parent 1902360 commit dd59f04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Serval.ApiServer/Serval.ApiServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.6.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.6.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.5.1-beta.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.5.1-beta.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.5.1-beta.1" />
</ItemGroup>

Expand Down
9 changes: 6 additions & 3 deletions src/Serval.ApiServer/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,12 @@ public void ConfigureServices(IServiceCollection services)
.AddOpenTelemetry()
.WithTracing(builder =>
{
builder.AddAspNetCoreInstrumentation().AddConsoleExporter();
builder.AddHttpClientInstrumentation().AddConsoleExporter();
builder.AddSource("MongoDB.Driver.Core.Extensions.DiagnosticSources").AddConsoleExporter();
builder
.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddGrpcClientInstrumentation()
.AddSource("MongoDB.Driver.Core.Extensions.DiagnosticSources")
.AddConsoleExporter();
});
}

Expand Down

0 comments on commit dd59f04

Please sign in to comment.