Class MoreMeterBinders
java.lang.Object
com.linecorp.armeria.common.metric.MoreMeterBinders
Provides useful
MeterBinder
s to monitor various Armeria components.-
Method Summary
Modifier and TypeMethodDescriptionstatic MeterBinder
certificateMetrics
(File keyCertChainFile, MeterIdPrefix meterIdPrefix) static MeterBinder
certificateMetrics
(InputStream keyCertChainFile, MeterIdPrefix meterIdPrefix) static MeterBinder
certificateMetrics
(Iterable<? extends X509Certificate> certificates, MeterIdPrefix meterIdPrefix) Returns a newMeterBinder
to observe the specifiedX509Certificate
's validity.static MeterBinder
certificateMetrics
(X509Certificate certificate, MeterIdPrefix meterIdPrefix) Returns a newMeterBinder
to observe the specifiedX509Certificate
's validity.static MeterBinder
eventLoopMetrics
(EventLoopGroup eventLoopGroup, MeterIdPrefix meterIdPrefix) Returns a newMeterBinder
to observe Netty'sEventLoopGroup
s.static MeterBinder
eventLoopMetrics
(EventLoopGroup eventLoopGroup, String name) Returns a newMeterBinder
to observe Netty'sEventLoopGroup
s.
-
Method Details
-
eventLoopMetrics
Returns a newMeterBinder
to observe Netty'sEventLoopGroup
s. The following stats are currently exported per registeredMeterIdPrefix
.- "event.loop.workers" (gauge) - the total number of Netty's event loops
- "event.loop.pending.tasks" (gauge) - the total number of IO tasks waiting to be run on event loops
-
eventLoopMetrics
@UnstableApi public static MeterBinder eventLoopMetrics(EventLoopGroup eventLoopGroup, MeterIdPrefix meterIdPrefix) Returns a newMeterBinder
to observe Netty'sEventLoopGroup
s. The following stats are currently exported per registeredMeterIdPrefix
.- "event.loop.workers" (gauge) - the total number of Netty's event loops
- "event.loop.pending.tasks" (gauge) - the total number of IO tasks waiting to be run on event loops
-
certificateMetrics
@UnstableApi public static MeterBinder certificateMetrics(X509Certificate certificate, MeterIdPrefix meterIdPrefix) Returns a newMeterBinder
to observe the specifiedX509Certificate
's validity. The following stats are currently exported per registeredMeterIdPrefix
.- "tls.certificate.validity" (gauge) - 1 if TLS certificate is in validity period, 0 if certificate is not in validity period
- "tls.certificate.validity.days" (gauge) - Duration in days before TLS certificate expires, which becomes -1 if certificate is expired
- Parameters:
certificate
- the certificate to monitormeterIdPrefix
- the prefix to use for all metrics
-
certificateMetrics
@UnstableApi public static MeterBinder certificateMetrics(Iterable<? extends X509Certificate> certificates, MeterIdPrefix meterIdPrefix) Returns a newMeterBinder
to observe the specifiedX509Certificate
's validity. The following stats are currently exported per registeredMeterIdPrefix
.- "tls.certificate.validity" (gauge) - 1 if TLS certificate is in validity period, 0 if certificate is not in validity period
- "tls.certificate.validity.days" (gauge) - Duration in days before TLS certificate expires, which becomes -1 if certificate is expired
- Parameters:
certificates
- the certificates to monitormeterIdPrefix
- the prefix to use for all metrics
-
certificateMetrics
@UnstableApi public static MeterBinder certificateMetrics(File keyCertChainFile, MeterIdPrefix meterIdPrefix) throws CertificateException Returns a newMeterBinder
to observe theX509Certificate
's validity in the PEM formatFile
. The following stats are currently exported per registeredMeterIdPrefix
.- "tls.certificate.validity" (gauge) - 1 if TLS certificate is in validity period, 0 if certificate is not in validity period
- "tls.certificate.validity.days" (gauge) - Duration in days before TLS certificate expires, which becomes -1 if certificate is expired
- Parameters:
keyCertChainFile
- the certificates to monitormeterIdPrefix
- the prefix to use for all metrics- Throws:
CertificateException
-
certificateMetrics
@UnstableApi public static MeterBinder certificateMetrics(InputStream keyCertChainFile, MeterIdPrefix meterIdPrefix) throws CertificateException Returns a newMeterBinder
to observe theX509Certificate
's validity in the PEM formatInputStream
. The following stats are currently exported per registeredMeterIdPrefix
.- "tls.certificate.validity" (gauge) - 1 if TLS certificate is in validity period, 0 if certificate is not in validity period
- "tls.certificate.validity.days" (gauge) - Duration in days before TLS certificate expires, which becomes -1 if certificate is expired
- Parameters:
keyCertChainFile
- the certificates to monitormeterIdPrefix
- the prefix to use for all metrics- Throws:
CertificateException
-