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

Bring back inbox/outbox metrics #357

Closed
jeremydmiller opened this issue May 16, 2023 · 3 comments
Closed

Bring back inbox/outbox metrics #357

jeremydmiller opened this issue May 16, 2023 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@jeremydmiller
Copy link
Member

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 jeremydmiller added this to the Post 1.0 milestone Jun 8, 2023
@dgrozenok
Copy link

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

@jeremydmiller jeremydmiller modified the milestones: Post 1.0, 3.0 Oct 14, 2024
@jeremydmiller jeremydmiller added the enhancement New feature or request label Oct 14, 2024
@jeremydmiller
Copy link
Member Author

Sorry Denys, these are getting bounced back to 4.0:(

Also, add this back to the docs:

| wolverine-inbox-count        | [Observable Gauge](https://opentelemetry.io/docs/reference/specification/metrics/api/#asynchronous-gauge) | Samples the number of pending envelopes in the durable inbox (likely to change)                                                                                                                                                                                                        |
| wolverine-outbox-count       | Observable Gauge                                                                                          | Samples the number of pending envelopes in the durable outbox (likely to change)                                                                                                                                                                                                       |
| wolverine-scheduled-count    | Observable Gauge                                                                                          | Samples the number of pending scheduled envelopes in the durable inbox (likely to change)                                                                                                                                                                                              |

@jeremydmiller jeremydmiller modified the milestones: 3.0, 4.0 Oct 16, 2024
@jeremydmiller
Copy link
Member Author

Picking this up a bit today.

  • Bury this into each IMessageStore. Use tenant database names if necessary
  • Add a UpdateMetricsPeriod to DurabilitySettings with a default value of 5 seconds.
  • New class that uses a timer for non-database things like RavenDb?
  • Utilize DurabilityAgent for databases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants