Monitoring Petals ESB with Prometheus

compared with
Version 6 by Pierre Souquet
on Sep 27, 2018 17:31.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (15)

View Page History
* Metrics are available at *[http://localhost:8585/metrics|http://localhost:8484/metrics*]*

h32. Alternate jmx_exporter install: as HTTP server


h3.

* Download [jmx_prometheus_httpserver|https://mvnrepository.com/artifact/io.prometheus.jmx/jmx_prometheus_httpserver]. Be careful about the confusing version number, check the date to have the last version.
* Adapt the *prometheus-jmx.yaml* config file to connect by RMI. You can use either *jmxUrl* or *hostPort*, *username* and *password* are mandatory. {code}


h21. Configuring jmx agent


h2.

Jmx agent can be configured in its yaml config file.

* Metrics format: {code}<metric name>{<label name>=<label value>, ...}{code}

h2. Configuration samples :

The following samples are produced monitoring a Petals ESB single container topology hosting 3 components (SOAP, REST and Camel).
Raw metrics can be hard to exploit, as the exporter automatically creates metrics:

Wildcard pattern rule:
{code}
rules:
- pattern: ".*"
{code}


Raw metrics sample:
{code}
{code}

In this case, we cannot know later in Prometheus where the metrics originated or which Petals ESB container is concerned. By adding a few generic rules, we can add label and control the metric names:.

h3. Adding generic rules

Generic rules samples :
{code}
MessageExchangeProcessorThreadPoolQueuedRequestsMax{component="petals-bc-soap",container="petals_sample_0",type="monitoring",} 0.0
MessageExchangeProcessorThreadPoolQueuedRequestsMax{component="petals-se-camel",container="petals_sample_0",type="monitoring",} 0.0
MessageExchangeProcessorThreadPoolQueuedRequestsMax{component="petals-bc-rest",container="petals_sample_0",type="monitoring",} 0.0A
{code}

h3. Adding specific rules

And you can go further by adding rules for specific MBeans: MBeans. Here we will
* group&nbsp;*SystemCpuLoad* and&nbsp;*ProcessCpuLoad* as a single metric.
* rename&nbsp;*MessageExchangeProcessorThreadPoolQueuedRequestsMax*&nbsp;into a shorter metric, while keeping the full name as label and helper.
{code}
- pattern: 'java.lang<type=OperatingSystem><>SystemCpuLoad: (.*)'
value: "$1"
labels:
tpye: type: OperatingSystem
target: "process"
container: "petals_sample_0"
{code}
CpuLoad{container="petals_sample_0",target="system",type="OperatingSystem",} 0.10234667681404555
CpuLoad{container="petals_sample_0",target="process",tpye="OperatingSystem",} CpuLoad{container="petals_sample_0",target="process",type="OperatingSystem",} 2.655985589352835E-4

MEPTP_QueuedRequests_Max{component="petals-bc-soap",container="petals_sample_0",mbean="MessageExchangeProcessorThreadPoolQueuedRequestsMax",type="monitoring",} 0.0
{code}

You can mix generic and specific patterns, but remember that they are applied in order, so *always put specific rules first \!*