From 9e9102b14a42b0bdf5efbb0b02bba8ec1e4c5153 Mon Sep 17 00:00:00 2001 From: Cijo Thomas Date: Thu, 29 Sep 2022 16:23:30 -0700 Subject: [PATCH] Add runtime metrics to cartservice (#393) --- src/cartservice/src/Startup.cs | 5 +++++ src/cartservice/src/cartservice.csproj | 1 + 2 files changed, 6 insertions(+) diff --git a/src/cartservice/src/Startup.cs b/src/cartservice/src/Startup.cs index bafff3e2d9..6449897327 100644 --- a/src/cartservice/src/Startup.cs +++ b/src/cartservice/src/Startup.cs @@ -8,6 +8,7 @@ using Microsoft.Extensions.Hosting; using cartservice.cartstore; using cartservice.services; +using OpenTelemetry.Metrics; using OpenTelemetry.Trace; namespace cartservice; @@ -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()); diff --git a/src/cartservice/src/cartservice.csproj b/src/cartservice/src/cartservice.csproj index 33ba96d038..13e578df43 100644 --- a/src/cartservice/src/cartservice.csproj +++ b/src/cartservice/src/cartservice.csproj @@ -14,6 +14,7 @@ +