Restructure solution layout by module
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Diagnostics.Metrics;
|
||||
|
||||
namespace StellaOps.Registry.TokenService.Observability;
|
||||
|
||||
public sealed class RegistryTokenMetrics : IDisposable
|
||||
{
|
||||
public const string MeterName = "StellaOps.Registry.TokenService";
|
||||
|
||||
private readonly Meter _meter;
|
||||
private bool _disposed;
|
||||
|
||||
public RegistryTokenMetrics()
|
||||
{
|
||||
_meter = new Meter(MeterName);
|
||||
TokensIssued = _meter.CreateCounter<long>("registry_token_issued_total", unit: "tokens", description: "Total tokens issued grouped by plan.");
|
||||
TokensRejected = _meter.CreateCounter<long>("registry_token_rejected_total", unit: "tokens", description: "Total token requests rejected grouped by reason.");
|
||||
}
|
||||
|
||||
public Counter<long> TokensIssued { get; }
|
||||
|
||||
public Counter<long> TokensRejected { get; }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_meter.Dispose();
|
||||
_disposed = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user