-
Notifications
You must be signed in to change notification settings - Fork 12
Monitoring
LogHub provides several ways to monitor its internal state and performance metrics. It uses a core metrics system that can be exported through various protocols.
LogHub exposes many internal components (Receivers, Senders, Pipelines) as MBeans. You can enable native JMX access by configuring the following properties in your configuration file:
-
jmx.hostname, the hostname that will be used for RMI communication. -
jmx.jaasName, the JAAS security name -
jmx.listen, the jmx IP that jmx management binds to. -
jmx.port, the listening port for jmx management. -
jmx.protocol, the protocol to be used to listen on jmx, default tormibut it can also bejmxmpif the required jar is installed. -
jmx.providerPackages, set the attributesjmx.remote.protocol.provider.pkgsused to resolve custom JMX provider -
jmx.serviceUrl, an optional explicit JMX URL. jmx.sslContextjmx.sslParams-
jmx.withSsl, will activate SSL on JMX.
When configured, you can connect using standard JMX tools like jconsole or VisualVM.
The loghub-jolokia module provides a bridge between JMX and HTTP, allowing you to access JMX metrics via JSON.
Ensure that the loghub-jolokia.jar is available in your classpath or in the plugins' folder.
Jolokia is automatically enabled when the http.port property is set and the module is present. It exposes an endpoint at /jolokia.
-
http.jolokia.policyLocation: (Optional) Path to a Jolokia access policy XML file (e.g.,jolokia-access.xml).
You can query metrics using HTTP GET or POST requests. For example:
GET http://<host>:<http.port>/jolokia/read/java.lang:type=Memory/HeapMemoryUsage
The loghub-prometheus module allows Prometheus to scrape LogHub metrics. It translates internal Dropwizard metrics into the Prometheus exposition format.
Ensure that the loghub-prometheus.jar is available in your classpath or in the plugins' folder.
To enable the Prometheus scraper, set the following properties:
-
http.prometheus.withExporter: Set totrueto enable the/prometheusendpoint. -
http.prometheus.withJvmMetrics: Set totrueto export standard JVM metrics (CPU, Memory, Threads, etc.). -
http.prometheus.withOpenTelemetry: Set totrueif you want to push metrics using the OTLP protocol.
Once enabled, Prometheus can be configured to scrape LogHub at:
http://<host>:<http.port>/prometheus
If using OpenTelemetry export, additional properties are available:
http.prometheus.openTelemetry.endpointhttp.prometheus.openTelemetry.headershttp.prometheus.openTelemetry.intervalhttp.prometheus.openTelemetry.protocolhttp.prometheus.openTelemetry.resourceAttributeshttp.prometheus.openTelemetry.serviceInstanceIdhttp.prometheus.openTelemetry.serviceNamehttp.prometheus.openTelemetry.serviceNamespacehttp.prometheus.openTelemetry.serviceVersionhttp.prometheus.openTelemetry.timeoutSeconds