Dropwizard metrics not reporting metrics from eventbus

220 views
Skip to first unread message

Germán Schnyder

unread,
Mar 3, 2016, 9:37:47 AM3/3/16
to vert.x
Hi all, i´m currently working on a project that uses Vertx 3 as it underlying event bus framework and we are trying to gather metrics from subscribed handlers.

This is plainly not working for us, dropwizard is only reporting the number of handlers but not the metrics of each one as expected (and as shown in the documentation).

For example (only showing interesting code):

DropwizardMetricsOptions metricsOptions = new DropwizardMetricsOptions()
.setEnabled(true)
.addMonitoredEventBusHandler(new Match().setValue("my-address"));
VertxOptions options = new VertxOptions()
.setMetricsOptions(metricsOptions);

And later:

JsonObject eventBusMetrics = metricsService.getMetricsSnapshot(vertx.eventBus());

eventBusMetrics shows all kind of metrics, but about handlers i only get the counter:

"handlers": {
"type": "counter",
"count": 108
},


Any clue on this ? I've tried several approaches (like regex instead of exact address) but i only get the counter. I can gather all they other types of metrics without any issues (like HTTP).

I've also confirmed that i'm calling send() method against the same exact address that i put to dropwizard configuration. But, again, this doesn´t work even with ".*" regex.

Regards

Germán

Rishi Sharma

unread,
Jun 20, 2017, 8:31:00 AM6/20/17
to vert.x
Looking for an update on this. 
I wanted to monitor each individual events on the eventbus and their throughput.
In my current implementation, I am using  Drop wizard for the metrics as JMX data is essential too.

Thanks, Rishi

Thomas SEGISMONT

unread,
Jun 20, 2017, 8:44:01 AM6/20/17
to ve...@googlegroups.com
If you need JMX reporting then add

setJmxEnabled(true)

to the metricsOptions.

There are tests in the module for handler matching so if you still can't see the metrics please share a small reproducer on GitHub

Thanks

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/e870ad6d-ccd3-4013-bd8a-706fe2d6c7fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rishi Sharma

unread,
Jun 20, 2017, 11:43:13 AM6/20/17
to vert.x
Hi Thomas,

I am able to get the JMX data with setJmxEnabled(true) option.

But I am not able to get the events which are registered on the eventbus, as Germán stated, I am only receiving the counters not the events.
I want to monitors individual events. the code looks exactly like the same what Germán added.

Thanks, Rishi
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.

Julien Viet

unread,
Jun 20, 2017, 12:39:30 PM6/20/17
to ve...@googlegroups.com
what do you mean by “monitor individual events” ?

Rishi Sharma

unread,
Jun 21, 2017, 12:56:54 AM6/21/17
to vert.x
With individual event I mean something like : 

vertx.eventbus.<address>.processingTime

which hawkular does provide not drop wizard. I am trying to accomplish this using Drop wizard.

Thomas SEGISMONT

unread,
Jun 21, 2017, 11:36:09 AM6/21/17
to ve...@googlegroups.com
Ha I see. Hawkular and Dropwizard metrics are different modules and they do not expose the exact same metrics (sometimes just the name is different).

Vert.x Dropwizard has a timer named "handlers.<myaddress>" which tells you the rate at which message are being processed.


To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.

Rishi Sharma

unread,
Jun 21, 2017, 11:55:26 AM6/21/17
to vert.x
Right, But when I am trying to see the metrics using

EventBus eventBus = vertx.eventBus(); 
JsonObject metrics = metricsService.getMetricsSnapshot(eventBus); 
metrics.getJsonObject("handlers");

I am not getting  <myaddress> timer metrics.
Is their any other way to retrieve this data, which I am missing?

Thomas SEGISMONT

unread,
Jun 21, 2017, 12:23:20 PM6/21/17
to ve...@googlegroups.com

To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.

Rishi Sharma

unread,
Jun 21, 2017, 12:44:08 PM6/21/17
to vert.x
Okay! I will try to create and share a reproducer. 
While I am creating it. can you suggest an small example on how can I retrieve handler.<myaddress> metrics.
It'll help me on having a second look on my code.

Thomas SEGISMONT

unread,
Jun 22, 2017, 4:16:40 AM6/22/17
to ve...@googlegroups.com
This should do:

MetricsService metricsService = MetricsService.create(vertx);
JsonObject metrics = metricsService.getMetricsSnapshot(vertx.eventBus());
JsonObject handlerMetric = metrics.getJsonObject("handlers.foo");

Handler foo should be registered before you take the event bus metrics snapshot.

To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.

Rishi Sharma

unread,
Jun 22, 2017, 5:16:41 AM6/22/17
to vert.x
in that case Thomas, Let say I have deployed a worker verticle A from my current vertx instance.
in verticle A I am regitering some 10 events on the eventbus.
so after this deployment I can try  metrics.getJsonObject("handlers.foo");  and it shall give me the desired metrics.
Is my understanding correct?

Thomas SEGISMONT

unread,
Jun 22, 2017, 9:01:07 AM6/22/17
to ve...@googlegroups.com
What do you mean with "regitering some 10 events on the eventbus"? Just sending messages or registering handlers? Only handler registration will trigger metrics creation.

Please share the code, it's better to get a common understanding.

To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages