File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 88using Microsoft . Extensions . Hosting ;
99using cartservice . cartstore ;
1010using cartservice . services ;
11+ using OpenTelemetry . Metrics ;
1112using OpenTelemetry . Trace ;
1213
1314namespace cartservice ;
@@ -49,6 +50,10 @@ public void ConfigureServices(IServiceCollection services)
4950 . AddHttpClientInstrumentation ( )
5051 . AddOtlpExporter ( ) ) ;
5152
53+ services . AddOpenTelemetryMetrics ( builder =>
54+ builder . AddRuntimeInstrumentation ( )
55+ . AddOtlpExporter ( ) ) ;
56+
5257 services . AddGrpc ( ) ;
5358 services . AddGrpcHealthChecks ( )
5459 . AddCheck ( "Sample" , ( ) => HealthCheckResult . Healthy ( ) ) ;
Original file line number Diff line number Diff line change 1414 <PackageReference Include =" OpenTelemetry.Instrumentation.GrpcNetClient" Version =" 1.0.0-rc9.4" />
1515 <PackageReference Include =" OpenTelemetry.Instrumentation.Http" Version =" 1.0.0-rc9.4" />
1616 <PackageReference Include =" OpenTelemetry.Instrumentation.StackExchangeRedis" Version =" 1.0.0-rc9.6" />
17+ <PackageReference Include =" OpenTelemetry.Instrumentation.Runtime" Version =" 1.0.0" />
1718 </ItemGroup >
1819
1920 <ItemGroup >
You can’t perform that action at this time.
0 commit comments