Skip to content

Commit

Permalink
Add runtime metrics to cartservice (#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
cijothomas committed Sep 29, 2022
1 parent b7595d6 commit 6d9b7ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cartservice/src/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Microsoft.Extensions.Hosting;
using cartservice.cartstore;
using cartservice.services;
using OpenTelemetry.Metrics;
using OpenTelemetry.Trace;

namespace cartservice;
Expand Down Expand Up @@ -49,6 +50,10 @@ public void ConfigureServices(IServiceCollection services)
.AddHttpClientInstrumentation()
.AddOtlpExporter());

services.AddOpenTelemetryMetrics(builder =>
builder.AddRuntimeInstrumentation()
.AddOtlpExporter());

services.AddGrpc();
services.AddGrpcHealthChecks()
.AddCheck("Sample", () => HealthCheckResult.Healthy());
Expand Down
1 change: 1 addition & 0 deletions src/cartservice/src/cartservice.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.0.0-rc9.4" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.0.0-rc9.4" />
<PackageReference Include="OpenTelemetry.Instrumentation.StackExchangeRedis" Version="1.0.0-rc9.6" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 6d9b7ce

Please sign in to comment.