Skip to content

Metrics for successful and unsuccessful outgoing publishes #354

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

Closed
slayful opened this issue Mar 27, 2018 · 17 comments
Closed

Metrics for successful and unsuccessful outgoing publishes #354

slayful opened this issue Mar 27, 2018 · 17 comments

Comments

@slayful
Copy link
Contributor

slayful commented Mar 27, 2018

Hey there! This is a feature request I'd be willing to create PR for.

As it stands now, when you're publishing a message and it is successful, the published counter in MetricsCollector will be incremented.
I'd like to add publishFailed counter, which will be incremented if and when publishing attempt fails.

This will allow users to easily create reports of publishing success rates and help them determine if the number messages they're not publishing are a significant enough to increase resiliency of their programs.

I'd like to find out if this is a feature that would be a welcome addition and if the way I'd like to add it would meet your expectations.

@michaelklishin
Copy link
Contributor

Unfortunately it's not obvious how to know if a publishing attempt failed. Not all failures result in timely I/O exceptions.

@michaelklishin
Copy link
Contributor

@acogoluegnes we can count (I/O and other) exceptions on publish attempts and negative publisher acknowledgements. This would not account for publishes that technically were written to the socket but were never acknowledged because connection went down right after. WDYT?

Having two categories is a better idea than lumping everything together, given that there's at least one other category which it or may not be possible to reliably count.

@michaelklishin michaelklishin changed the title Include failed publishing attempts in Metrics Metrics for unsuccessful outgoing publishes Mar 27, 2018
@michaelklishin
Copy link
Contributor

michaelklishin commented Mar 27, 2018

Another question is whether returned (unroutable) messages should count for "unsuccessful". Again, I think it should be a separate category just like it is in the broker.

@acogoluegnes
Copy link
Contributor

acogoluegnes commented Mar 28, 2018

Sounds reasonable to me. If we sum up:

  • publish exceptions (failures/exceptions in basicPublish)
  • publisher acks (ConfirmListener#handleAck)
  • publisher nacks (ConfirmListener#handleNack)
  • unroutable deliveries (ReturnListener#handleReturn)

We may add new methods to MetricsCollector, but then the change would need to go into 6.0.0. We may also create a new interface, e.g. PublishingMetricsCollector that the current collector implementations would implement and release this in the 5.x branch as there would be no breaking changes (not really sure about that actually, but it's worth investigating). With the latter, the metrics collecting logic may be tricky, as we would need to juggle with new interfaces.

@michaelklishin
Copy link
Contributor

I took the liberty to edit @acogoluegnes' comment to clarify some proposed metric names.

@michaelklishin michaelklishin added this to the 6.0.0 milestone Mar 28, 2018
slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Apr 10, 2018
slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Apr 10, 2018
slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Apr 10, 2018
slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Apr 10, 2018
slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Apr 10, 2018
@slayful
Copy link
Contributor Author

slayful commented Apr 17, 2018

@michaelklishin, @acogoluegnes I've implemented the first and most basic type of failure, would you mind giving it a look?
I was thinking that after addressing the CR for ths PR, we could merge it and I could add the other types in other PRs to keep them on the smaller side, how's that sound?

@michaelklishin
Copy link
Contributor

@slayful thank you, we will next week. It just so happens that both Java client maintainers on the core team are on PTO this week. Having follow-up PRs with other improvements (even if they depend on this one) is what we'd prefer.

@slayful
Copy link
Contributor Author

slayful commented Apr 18, 2018

Thanks @michaelklishin! :)

slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Apr 23, 2018
slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Apr 23, 2018
@slayful
Copy link
Contributor Author

slayful commented Apr 23, 2018

Seems like we could merge #357 and I could add the other types of failures.

slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Apr 23, 2018
slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Apr 23, 2018
slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Apr 24, 2018
Metrics for multiple acks and nacks are unsupported in this naive approach.
slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Apr 24, 2018
acogoluegnes added a commit that referenced this issue Apr 25, 2018
Track publishing failures in metrics

References #354
slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Jun 2, 2018
slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Jun 2, 2018
slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Jun 2, 2018
slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Jun 2, 2018
slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Jun 2, 2018
slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Jun 2, 2018
slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Jun 2, 2018
slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Jun 3, 2018
slayful added a commit to slayful/rabbitmq-java-client that referenced this issue Jun 3, 2018
@slayful
Copy link
Contributor Author

slayful commented Jun 3, 2018

#360 is ready for a second review. :)

@michaelklishin
Copy link
Contributor

@slayful thank you!

acogoluegnes added a commit that referenced this issue Jun 4, 2018
@slayful
Copy link
Contributor Author

slayful commented Jun 4, 2018

Thank you for merging and helping me do this. We'd love to start monitoring our publishing rates, so please don't mind me asking, do you have an idea when will it be part of a release?

@michaelklishin
Copy link
Contributor

Release plans for 6.0 haven't been discussed yet but I think a month or so is realistic. We certainly can release a milestone some time this week.

@acogoluegnes
Copy link
Contributor

We can indeed release a milestone in the next few days. We still have a few things to address in 6.0.

@acogoluegnes
Copy link
Contributor

Note I created a follow-up issue to handle multiple publisher confirms in metrics.

@acogoluegnes acogoluegnes changed the title Metrics for unsuccessful outgoing publishes Metrics for successful and unsuccessful outgoing publishes Jun 8, 2018
@acogoluegnes
Copy link
Contributor

@slayful 6.0.0.M1 is out: https://groups.google.com/d/msg/rabbitmq-users/yGsBB8Rom2w/leIkIwv7AgAJ

@slayful
Copy link
Contributor Author

slayful commented Jun 8, 2018

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants