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

Add support for metrics and tracing #8

Merged
merged 3 commits into from
Apr 4, 2024
Merged

Add support for metrics and tracing #8

merged 3 commits into from
Apr 4, 2024

Conversation

satabin
Copy link
Collaborator

@satabin satabin commented Mar 20, 2024

This allows to wrap any queue client into a client that tracks metrics and/or traces.

Regarding the metrics, we can discuss if and what other metrics we want to have built-in. I only defined a metrics that counts accesses to the queue system and the action and outcome. These metrics need to be built into the concrete client implementations.

I think that metrics like number of messages pushed or number of messages received do not need to be built in, as they are easily implemented on the resulting streams if needed. This gives freedom to user to define their message level metrics as they wish. This is debatable and I'd like to gather your thought here and what kind of metrics we would like to have on top of the one I defined here.

@satabin satabin added the enhancement New feature or request label Mar 20, 2024
@satabin satabin force-pushed the metrics branch 3 times, most recently from 3ea0674 to d13e3a8 Compare March 22, 2024 09:03
@satabin satabin marked this pull request as ready for review March 22, 2024 09:04
Components having metrics now take an instance of the `QueueMetrics`
class, which allows for instantiating the outcome handling closure only
once when the `QueueSubscriber` or `QueuePublisher` is created.
Copy link
Member

@AL333Z AL333Z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and clean.

Any idea whether it would be possibile to also expose metrics like max message age and num of messages from the application?

@satabin
Copy link
Collaborator Author

satabin commented Mar 29, 2024

Nice and clean.

Any idea whether it would be possibile to also expose metrics like max message age and num of messages from the application?

Sadly not all systems provide it. We can add a generic stats method, I need to check which ones are available to all queue systems.

@satabin satabin merged commit 86ac289 into main Apr 4, 2024
7 checks passed
@satabin satabin deleted the metrics branch April 4, 2024 08:39
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

Successfully merging this pull request may close these issues.

3 participants