1631786ce2
Add push contracts, provider delivery and channel diagnostics. Link email channels to services and document migration and validation. Ref: IT-1074
16 lines
658 B
C#
16 lines
658 B
C#
namespace HrynCo.NotificationService.Worker.Services.Push;
|
|
|
|
using System.Diagnostics.Metrics;
|
|
|
|
public static class PushDeliveryMetrics
|
|
{
|
|
private static readonly Meter Meter = new("HrynCo.NotificationService.Push", "1.0");
|
|
private static readonly Counter<long> Outcomes = Meter.CreateCounter<long>("push.provider.outcomes");
|
|
private static readonly Counter<long> Retries = Meter.CreateCounter<long>("push.provider.retries");
|
|
|
|
public static void RecordOutcome(bool succeeded) =>
|
|
Outcomes.Add(1, new KeyValuePair<string, object?>("outcome", succeeded ? "accepted" : "failed"));
|
|
|
|
public static void RecordRetry() => Retries.Add(1);
|
|
}
|