-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
3ea0674
to
d13e3a8
Compare
otel4s/src/main/scala/com/commercetools/queue/otel4s/MeasuringQueuePusher.scala
Outdated
Show resolved
Hide resolved
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.
There was a problem hiding this 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?
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. |
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.