SzymonPobiega / NServiceBus.Router

Cross-transport, cross-site and possibly cross-cloud router component for NServiceBus
MIT License
5 stars 10 forks source link

Instrumenting metrics? #20

Open kjersti opened 4 years ago

kjersti commented 4 years ago

I am looking to instrument our router instance with some metrics. I was able to get a hook into the prerouting context using a Rule. Is there something similar for failures?

SzymonPobiega commented 4 years ago

Hi

No. There is no hook in the failure handling. What kinds of events would be interesting for you?

kjersti commented 4 years ago

Initially, I wanted a counter for errors, as well as the counter for incoming messages. I was able to configure a gauge metrics by implementing a module that queries the poison queue on a regular interval, but I'm not sure if this is the best way to implement it.

If you have any ideas or comments, I am open to that. I am willing to help with the work if needed.

Btw, this tool is great, very helpful for us in a phase where we are transitioning from one transport to another. Thanks! :)

SzymonPobiega commented 4 years ago

Hi @kjersti . I did some research and it seems that EventCounters are the way to implement such things. I will be working on adding the counters to the router. My ideas for counters are following:

Do you have any other ideas for counters that could be useful?