-
Notifications
You must be signed in to change notification settings - Fork 24
/
OpenTelemetryMetric.cs
20 lines (16 loc) · 1.03 KB
/
OpenTelemetryMetric.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System.Diagnostics.Metrics;
namespace Tracing;
public static class OpenTelemetryMetric
{
// Identity metrics
private static readonly Meter IdentityMeter = new("Identity.Api");
public static readonly Counter<int> UserCreatedEventCounter = IdentityMeter.CreateCounter<int>("user.created.event.count");
// Order metrics
private static readonly Meter OrderMeter = new("Order.Api");
public static readonly Counter<int> OrderStartedEventCounter = OrderMeter.CreateCounter<int>("order.started.event.count");
public static readonly Counter<int> OrderLongRunningRequestCounter = OrderMeter.CreateCounter<int>("order.long.running.request.count");
public static readonly Histogram<long> OrderMethodDuration = OrderMeter.CreateHistogram<long>("order.method.duration", "milliseconds");
// Subscription metrics
private static readonly Meter StockMeter = new("Subscription.Api");
public static readonly UpDownCounter<int> StockCounter = StockMeter.CreateUpDownCounter<int>("subscription.stock.count");
}