Skip to main content

Jolokia Monitoring

📊 Jolokia Monitoring & JMX Integration

📡 Overview

MAPS Messaging integrates with Jolokia, a JMX-over-HTTP bridge that allows you to monitor and interact with internal server metrics and Java Management Extensions (JMX) remotely. This is useful for debugging, live metric inspection, and integration with monitoring platforms like Prometheus, Grafana, or custom dashboards.

Jolokia configuration is defined in jolokia.yaml.


⚙️ Basic Configuration

jolokia:
enable: false
config:
port: 8778
host: 0.0.0.0
backlog: 10
canonicalNaming: true
FieldDescription
enableEnables/disables Jolokia plugin.
portTCP port used by the Jolokia HTTP agent.
hostBind address (e.g., 0.0.0.0 for all interfaces).
backlogMax number of incoming connections to queue.
canonicalNamingControls JMX object naming style.

🧠 Advanced Monitoring Settings

    historyMaxEntries: 10
maxDepth: 7
maxCollectionSize: 200
allowDnsReverseLookup: false
cors: false
FieldDescription
historyMaxEntriesNumber of metric history snapshots to keep.
maxDepthRecursion depth for complex object serialization.
maxCollectionSizeMax size of arrays or collections returned via API.
allowDnsReverseLookupWhether to enable reverse DNS lookups.
corsEnable CORS access to the Jolokia endpoint.

🐞 Debugging & Error Handling

    debug: true
debugMaxEntries: 100
includeStackTrace: false
allowErrorDetails: false
serializeException: false

These fields control how much diagnostic information Jolokia will capture and expose.

⚠️ Set all debugging options to false in production to avoid sensitive data leakage.


🌍 Discovery Configuration

    discoveryEnabled: false
multicastGroup: 239.192.48.48
multicastPort: 24884
FieldDescription
discoveryEnabledEnables auto-discovery via multicast
multicastGroupMulticast group for Jolokia discovery protocol
multicastPortPort used for multicast announcements

🔐 SSL Configuration (Optional)

Jolokia supports optional SSL/TLS encryption:

#    keystore: my-keystore.jks
# serverCert: serverCertName
# serverKey: serverKeyName
# sslProtocol: TLSv1.2
# keyStoreType: JKS
# keyManagerAlgorithm: SunX509
# trustManagerAlgorithm: SunX509
# useSslClientAuthentication: false

You can configure secure sockets by uncommenting and setting the appropriate key/trust store details.

🛡️ Consider enabling sslProtocol, certificate validation, and secure ciphers for external monitoring setups.


🚀 Example Use Case

Expose live heap memory usage and thread metrics to Prometheus or Grafana:

  • Enable Jolokia on a secure port
  • Integrate with a Prometheus JMX exporter
  • Configure Grafana dashboards to pull metrics

✅ Best Practices

  • Enable Jolokia only on secure/internal interfaces.
  • Disable debugging and stack traces in production.
  • Use HTTPS + authentication to restrict access.
  • Integrate with observability tools via JMX bridges or exporters.
  • Avoid excessive history/maxCollectionSize settings to preserve performance.