Skip to content
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

Automatically register the metics of PooledByteBufAllocator.DEFAULT #5916

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,26 @@

import com.google.common.collect.ImmutableList;

import com.linecorp.armeria.common.Flags;
import com.linecorp.armeria.common.annotation.UnstableApi;
import com.linecorp.armeria.internal.common.util.CertificateUtil;

import io.micrometer.core.instrument.binder.MeterBinder;
import io.micrometer.core.instrument.binder.netty4.NettyAllocatorMetrics;
import io.netty.buffer.PooledByteBufAllocator;
import io.netty.channel.EventLoopGroup;

/**
* Provides useful {@link MeterBinder}s to monitor various Armeria components.
*/
public final class MoreMeterBinders {

static {
// Bind the default Netty allocator metrics to the default MeterRegistry.
new NettyAllocatorMetrics(PooledByteBufAllocator.DEFAULT)
.bindTo(Flags.meterRegistry());
}

/**
* Returns a new {@link MeterBinder} to observe Netty's {@link EventLoopGroup}s. The following stats are
* currently exported per registered {@link MeterIdPrefix}.
Expand Down
Loading