vert.xmicrometer

Turn off Vert.x internal metrics


I have used Java Flight Recorder to profile my application based on Vert.x

And I see a lot of io.micrometer.core.instrument.ImmutableTag

In the stacktrace there's no any line with my classes, all of that is Vert.x classes. Looks like Vert.x creating internal metrics.

How I can turn it off to save my performance?

Thanks

The stacktrace:

    Stack Trace Count   Percentage
byte[] io.netty.util.internal.PlatformDependent.allocateUninitializedArray(int) 2866    16.6 %
byte[] io.netty.buffer.UnpooledUnsafeHeapByteBuf.allocateArray(int) 2866    16.6 %
byte[] io.netty.buffer.UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeHeapByteBuf.allocateArray(int)    1899    11 %
void io.netty.buffer.UnpooledHeapByteBuf.<init>(ByteBufAllocator, int, int) 1717    9.96 %
void io.netty.buffer.UnpooledUnsafeHeapByteBuf.<init>(ByteBufAllocator, int, int)   1717    9.96 %
void io.netty.buffer.UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeHeapByteBuf.<init>(UnpooledByteBufAllocator, int, int)  1717    9.96 %
ByteBuf io.netty.buffer.UnpooledByteBufAllocator.newHeapBuffer(int, int)    1717    9.96 %
ByteBuf io.netty.buffer.AbstractByteBufAllocator.heapBuffer(int, int)   1717    9.96 %
ByteBuf io.netty.buffer.AbstractByteBufAllocator.heapBuffer(int)    1717    9.96 %
ByteBuf io.vertx.core.buffer.impl.PartialPooledByteBufAllocator.heapBuffer(int) 1630    9.46 %
ByteBuf io.netty.handler.ssl.SslHandler$SslEngineType$3.allocateWrapBuffer(SslHandler, ByteBufAllocator, int, int)  1630    9.46 %
ByteBuf io.netty.handler.ssl.SslHandler.allocateOutNetBuf(ChannelHandlerContext, int, int)  1630    9.46 %
void io.netty.handler.ssl.SslHandler.wrap(ChannelHandlerContext, boolean)   1615    9.37 %
void io.netty.handler.ssl.SslHandler.wrapAndFlush(ChannelHandlerContext)    1615    9.37 %
void io.netty.handler.ssl.SslHandler.flush(ChannelHandlerContext)   1615    9.37 %
void io.netty.channel.AbstractChannelHandlerContext.invokeFlush0()  1614    9.36 %
void io.netty.channel.AbstractChannelHandlerContext.invokeFlush()   1614    9.36 %
ChannelHandlerContext io.netty.channel.AbstractChannelHandlerContext.flush()    1614    9.36 %
ChannelHandlerContext io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.flush() 1614    9.36 %
void io.netty.channel.ChannelOutboundHandlerAdapter.flush(ChannelHandlerContext)    1614    9.36 %
void io.netty.channel.CombinedChannelDuplexHandler.flush(ChannelHandlerContext) 1614    9.36 %
void io.netty.channel.AbstractChannelHandlerContext.invokeFlush0()  1614    9.36 %
void io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(Object, ChannelPromise) 1614    9.36 %
void io.netty.channel.AbstractChannelHandlerContext.write(Object, boolean, ChannelPromise)  1614    9.36 %
ChannelFuture io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(Object, ChannelPromise)  1614    9.36 %
void io.vertx.core.net.impl.ConnectionBase.write(Object, Boolean, ChannelPromise)   1614    9.36 %
void io.vertx.core.net.impl.ConnectionBase.writeToChannel(Object, boolean, ChannelPromise)  1614    9.36 %
void io.vertx.core.net.impl.ConnectionBase.writeToChannel(Object, ChannelPromise)   1611    9.35 %
void io.vertx.core.net.impl.ConnectionBase.writeToChannel(Object, FutureListener)   1611    9.35 %
void io.vertx.core.http.impl.Http1xClientConnection.beginRequest(Http1xClientConnection$Stream, HttpRequestHead, boolean, ByteBuf, boolean, boolean, Handler)   1611    9.35 %
void io.vertx.core.http.impl.Http1xClientConnection.access$700(Http1xClientConnection, Http1xClientConnection$Stream, HttpRequestHead, boolean, ByteBuf, boolean, boolean, Handler) 1611    9.35 %
void io.vertx.core.http.impl.Http1xClientConnection$StreamImpl.writeHead(HttpRequestHead, boolean, ByteBuf, boolean, boolean, Handler)  1611    9.35 %
void io.vertx.core.http.impl.Http1xClientConnection$StreamImpl.writeHead(HttpRequestHead, boolean, ByteBuf, boolean, StreamPriority, boolean, Handler)  1587    9.21 %
void io.vertx.core.http.impl.HttpClientRequestImpl.doWrite(ByteBuf, boolean, boolean, Handler)  1587    9.21 %
void io.vertx.core.http.impl.HttpClientRequestImpl.write(ByteBuf, boolean, Handler) 1587    9.21 %
Future io.vertx.core.http.impl.HttpClientRequestImpl.end(Buffer)    1586    9.2 %
void io.vertx.ext.web.client.impl.HttpContext.lambda$handleCreateRequest$4(Buffer, HttpClientRequest)   1586    9.2 %
void io.vertx.ext.web.client.impl.HttpContext$$Lambda$2555+0x0000000801d2b6e0.609573634.handle(Object)  1586    9.2 %
void io.vertx.core.impl.future.FutureImpl$1.onSuccess(Object)   1586    9.2 %
void io.vertx.core.impl.future.FutureBase.emitSuccess(Object, Listener) 1586    9.2 %
boolean io.vertx.core.impl.future.FutureImpl.tryComplete(Object)    1586    9.2 %
boolean io.vertx.core.impl.future.PromiseImpl.tryComplete(Object)   1586    9.2 %
void io.vertx.core.Promise.complete(Object) 1586    9.2 %
void io.vertx.ext.web.client.impl.HttpContext.handleSendRequest()   1586    9.2 %
void io.vertx.ext.web.client.impl.HttpContext.execute() 1586    9.2 %
void io.vertx.ext.web.client.impl.HttpContext.next()    1586    9.2 %
void io.vertx.ext.web.client.impl.HttpContext.fire(ClientPhase) 1586    9.2 %
void io.vertx.ext.web.client.impl.HttpContext.sendRequest(HttpClientRequest)    1586    9.2 %
void io.vertx.ext.web.client.impl.HttpContext.lambda$handleCreateRequest$6(AsyncResult) 1586    9.2 %
void io.vertx.ext.web.client.impl.HttpContext$$Lambda$2645+0x0000000801d470c8.1735593864.handle(Object) 1586    9.2 %
void io.vertx.core.impl.future.FutureImpl$3.onSuccess(Object)   1586    9.2 %
void io.vertx.core.impl.future.FutureBase.emitSuccess(Object, Listener) 1586    9.2 %
void io.vertx.core.impl.future.FutureImpl.addListener(Listener) 1585    9.19 %
void io.vertx.core.impl.future.PromiseImpl.addListener(Listener)    1585    9.19 %
Future io.vertx.core.impl.future.FutureImpl.onComplete(Handler) 1585    9.19 %
Future io.vertx.core.impl.future.PromiseImpl.onComplete(Handler)    1585    9.19 %
void io.vertx.ext.web.client.impl.HttpContext.handleCreateRequest() 1585    9.19 %
void io.vertx.ext.web.client.impl.HttpContext.execute() 1585    9.19 %
void io.vertx.ext.web.client.impl.HttpContext.next()    1585    9.19 %
void io.vertx.ext.web.client.impl.HttpContext.fire(ClientPhase) 1585    9.19 %
void io.vertx.ext.web.client.impl.HttpContext.createRequest(RequestOptions) 1585    9.19 %
void io.vertx.ext.web.client.impl.HttpContext.handlePrepareRequest()    1585    9.19 %
void io.vertx.ext.web.client.impl.HttpContext.execute() 1585    9.19 %
void io.vertx.ext.web.client.impl.HttpContext.next()    1585    9.19 %

Solution

  • If you don't want these allocations, you must turn-off Vert.x Micrometrer Metrics:

    Vertx vertx = Vertx.vertx(new VertxOptions()
      .setMetricsOptions(new MicrometerMetricsOptions()
        .setEnabled(false)));