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

[Cart] Added instrumentation for Asp.Net Core (http server) #394

Merged
merged 9 commits into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from 8 commits
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
2 changes: 1 addition & 1 deletion docs/metric_service_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Emoji Legend
| Service | Language | Instrumentation Libraries | Manual Metric Creation | Collector Agent Metric Transformation | Push Metrics | SLO Metrics | Multiple Manual Metric Instruments |
|-----------------|-----------------|---------------------------|------------------------|---------------------------------------|----------------|----------------|------------------------------------|
| Ad | Java | :construction: | :construction: | :construction: | :construction: | :construction: | :construction: |
| Cart | .NET | :construction: | :construction: | :construction: | :construction: | :construction: | :construction: |
| Cart | .NET | :100: | :construction: | :construction: | :construction: | :construction: | :construction: |
| Checkout | Go | :construction: | :construction: | :construction: | :construction: | :construction: | :construction: |
| Currency | C++ | :construction: | :construction: | :construction: | :construction: | :construction: | :construction: |
| Email | Ruby | :construction: | :construction: | :construction: | :construction: | :construction: | :construction: |
Expand Down
7 changes: 4 additions & 3 deletions src/cartservice/src/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ public void ConfigureServices(IServiceCollection services)
.AddHttpClientInstrumentation()
.AddOtlpExporter());

services.AddOpenTelemetryMetrics(builder =>
builder.AddRuntimeInstrumentation()
.AddOtlpExporter());
services.AddOpenTelemetryMetrics(builder =>
builder.AddRuntimeInstrumentation()
.AddAspNetCoreInstrumentation()
.AddOtlpExporter());
cijothomas marked this conversation as resolved.
Show resolved Hide resolved

services.AddGrpc();
services.AddGrpcHealthChecks()
Expand Down
2 changes: 1 addition & 1 deletion src/cartservice/src/cartservice.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageReference Include="Grpc.AspNetCore" Version="2.44.0" />
<PackageReference Include="Grpc.AspNetCore.HealthChecks" Version="2.46.0" />
<PackageReference Include="StackExchange.Redis" Version="2.5.43" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.3.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.3.1" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.0.0-rc9.4" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.0.0-rc9.4" />
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.0.0-rc9.4" />
Expand Down
2 changes: 1 addition & 1 deletion src/cartservice/src/cartstore/RedisCartStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private void EnsureRedisConnected()
redis.ConnectionRestored += (o, e) =>
{
isRedisConnectionOpened = true;
Console.WriteLine("Connection to redis was retored successfully");
Console.WriteLine("Connection to redis was restored successfully.");
};
redis.ConnectionFailed += (o, e) =>
{
Expand Down