How to start Metrics Enabled HTTP Server from a Verticle

31 views
Skip to first unread message

Du M

unread,
Oct 10, 2017, 10:13:10 AM10/10/17
to vert.x
Hi,

We're trying to start a HTTP Server inside a Verticle and would like to enable Metrics for it.

If we use the Vertx instance that is a member variable of Verticle, it does not have Metrics enabled. If we use following vertx instance  - 

Vertx vertx = Vertx.vertx(new VertxOptions().setMetricsOptions(

                           new DropwizardMetricsOptions().setEnabled(true)
                               
.addMonitoredHttpServerUri(new Match().setValue("/"))
                               
.addMonitoredHttpServerUri(new Match().setValue("/eventbus/*").setType(MatchType.REGEX))));



this instance does not seem to start the HTTP Server.


Any ideas?

Thomas SEGISMONT

unread,
Oct 10, 2017, 1:23:56 PM10/10/17
to ve...@googlegroups.com
You need both:

- a verticle creating the http server
- vertx options with metrics enabled

--
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/65efef53-c8ad-43dc-bdd0-e193babe551c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Du M

unread,
Oct 11, 2017, 3:52:10 AM10/11/17
to vert.x
Hi,

Thanks for reply.

How to do this?

I have tried following, none of them seem to work - 
  1. Create a new Vertx instance using Vertx.vertx() with Metrics Options in the verticle itself, and use it to start HTTP Server. This does not seem to start HTTP Server.
  2. Create a new Vertx instance using Vertx.vertx() with Metrics Options and execute it in Worker Threadpool, and use it to start HTTP Server. This gives exception below -


[vert.x-eventloop-thread-4] WARN io.netty.channel.nio.NioEventLoop - Unexpected exception in the selector loop.


java.io.IOException: Invalid argument


        at sun.nio.ch.KQueueArrayWrapper.kevent0(Native Method)


        at sun.nio.ch.KQueueArrayWrapper.poll(KQueueArrayWrapper.java:198)


        at sun.nio.ch.KQueueSelectorImpl.doSelect(KQueueSelectorImpl.java:117)


        at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)


        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)


        at io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:731)


        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:391)


        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873)


        at java.lang.Thread.run(Thread.java:748)




On Tuesday, 10 October 2017 22:53:56 UTC+5:30, Thomas Segismont wrote:
You need both:

- a verticle creating the http server
- vertx options with metrics enabled
2017-10-10 16:13 GMT+02:00 Du M <dumdumdu...@gmail.com>:
Hi,

We're trying to start a HTTP Server inside a Verticle and would like to enable Metrics for it.

If we use the Vertx instance that is a member variable of Verticle, it does not have Metrics enabled. If we use following vertx instance  - 

Vertx vertx = Vertx.vertx(new VertxOptions().setMetricsOptions(

                           new DropwizardMetricsOptions().setEnabled(true)
                               
.addMonitoredHttpServerUri(new Match().setValue("/"))
                               
.addMonitoredHttpServerUri(new Match().setValue("/eventbus/*").setType(MatchType.REGEX))));



this instance does not seem to start the HTTP Server.


Any ideas?

--
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+un...@googlegroups.com.

Thomas SEGISMONT

unread,
Oct 11, 2017, 4:28:00 AM10/11/17
to ve...@googlegroups.com
Without more details I can't say. Please put together a sample project on GitHub

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