Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add runtime metrics to cartservice #393

Merged
merged 2 commits into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/cartservice/src/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using cartservice.cartstore;
using cartservice.services;
using OpenTelemetry.Trace;
using OpenTelemetry.Metrics;
cijothomas marked this conversation as resolved.
Show resolved Hide resolved

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