Skip to content
Fabrice Bacchella edited this page Jun 4, 2026 · 1 revision

Monitoring LogHub

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.

Native JMX

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 to rmi but it can also be jmxmp if the required jar is installed.
  • jmx.providerPackages, set the attributes jmx.remote.protocol.provider.pkgs used to resolve custom JMX provider
  • jmx.serviceUrl, an optional explicit JMX URL.
  • jmx.sslContext
  • jmx.sslParams
  • jmx.withSsl, will activate SSL on JMX.

When configured, you can connect using standard JMX tools like jconsole or VisualVM.

Jolokia (JMX over HTTP)

The loghub-jolokia module provides a bridge between JMX and HTTP, allowing you to access JMX metrics via JSON.

Setup

Ensure that the loghub-jolokia.jar is available in your classpath or in the plugins' folder.

Configuration

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).

Usage

You can query metrics using HTTP GET or POST requests. For example: GET http://<host>:<http.port>/jolokia/read/java.lang:type=Memory/HeapMemoryUsage

Prometheus

The loghub-prometheus module allows Prometheus to scrape LogHub metrics. It translates internal Dropwizard metrics into the Prometheus exposition format.

Setup

Ensure that the loghub-prometheus.jar is available in your classpath or in the plugins' folder.

Configuration

To enable the Prometheus scraper, set the following properties:

  • http.prometheus.withExporter: Set to true to enable the /prometheus endpoint.
  • http.prometheus.withJvmMetrics: Set to true to export standard JVM metrics (CPU, Memory, Threads, etc.).
  • http.prometheus.withOpenTelemetry: Set to true if you want to push metrics using the OTLP protocol.

Scraping

Once enabled, Prometheus can be configured to scrape LogHub at: http://<host>:<http.port>/prometheus

OpenTelemetry Integration

If using OpenTelemetry export, additional properties are available:

  • http.prometheus.openTelemetry.endpoint
  • http.prometheus.openTelemetry.headers
  • http.prometheus.openTelemetry.interval
  • http.prometheus.openTelemetry.protocol
  • http.prometheus.openTelemetry.resourceAttributes
  • http.prometheus.openTelemetry.serviceInstanceId
  • http.prometheus.openTelemetry.serviceName
  • http.prometheus.openTelemetry.serviceNamespace
  • http.prometheus.openTelemetry.serviceVersion
  • http.prometheus.openTelemetry.timeoutSeconds

Clone this wiki locally