wolverine icon indicating copy to clipboard operation
wolverine copied to clipboard

Bring back inbox/outbox metrics

Open jeremydmiller opened this issue 1 year ago • 1 comments

The metrics sampling for the inbox/outbox is gonna go all to hell with multi-tenancy. Just bring it back per database later.

See:

internal class MetricsCalculator : IDurabilityAction
{
    private readonly ObservableGauge<int> _incoming;
    private readonly ObservableGauge<int> _outgoing;
    private readonly ObservableGauge<int> _scheduled;

    public MetricsCalculator(Meter meter)
    {
        _incoming = meter.CreateObservableGauge(MetricsConstants.InboxCount, () => Counts.Incoming,
            MetricsConstants.Messages, "Inbox messages");
        _outgoing = meter.CreateObservableGauge(MetricsConstants.OutboxCount, () => Counts.Outgoing,
            MetricsConstants.Messages, "Outbox messages");
        _scheduled = meter.CreateObservableGauge(MetricsConstants.ScheduledCount, () => Counts.Scheduled,
            MetricsConstants.Messages, "Scheduled messages");
    }

    public PersistedCounts Counts { get; private set; } = new();

    public string Description { get; } = "Metrics collection of inbox and outbox";

    public async Task ExecuteAsync(IMessageDatabase database, IDurabilityAgent agent,
        IDurableStorageSession session)
    {
        var counts = await database.FetchCountsAsync();
        Counts = counts;
    }
}

jeremydmiller avatar May 16 '23 15:05 jeremydmiller

Would be great to have those metrics working. Need to monitor the inbox/outbox counters while troubleshooting the messages not being processed timely.

dgrozenok avatar Jan 22 '24 18:01 dgrozenok