How to expose mBeans of a JMX target with Prometheus JMX exporter via TIBCO Hawk RedTail

How to expose mBeans of a JMX target with Prometheus JMX exporter via TIBCO Hawk RedTail

book

Article ID: KB0071726

calendar_today

Updated On:

Products Versions
TIBCO Operational Intelligence Hawk RedTail 7.1, 7.2

Description

How to expose mBeans of a JMX target with Prometheus JMX exporter via TIBCO Hawk RedTail

Resolution

Prerequisite: JMX_URL must be available and accessible 
       - For example: "service:jmx:rmi:///jndi/rmi://localhost:9000/jmxrmi"

Steps:

1. Download the jmx_prometheus_httpserver-0.17.2.jar from https://github.com/prometheus/jmx_exporter

2. Create a directory and place the downloaded jar in it.

3. Create config.yaml file with below sample contents. Make sure that you have updated correct jmxUrl and rules/patterns
      jmxUrl: "service:jmx:rmi:///jndi/rmi://localhost:9000/jmxrmi"
      rules:
      - pattern: ".*"

4. Run the command below to start jmx_prometheus_exporter:
    java -jar jmx_prometheus_httpserver-0.17.2.jar <hostIP>:<hostPort> config.yaml
    For example:
    java -jar jmx_prometheus_httpserver-0.17.2.jar localhost:1234 config.yaml
     
5.Now try to access http://<hostIP>:<hostPort>/metrics URL from browser, for instance, http://localhost:12345/metrics. You will see this endpoint reflecting respective metrics in Prometheus format.

6. Register as Prometheus Metrics from Hawk RedTail:

- Login to HRT UI
- Go to Exporters --> Prometheus Metrics
- Click on + New Metrics 
- Provide JMX_Prometheus URL, for instance, localhost:1234
- Click on Validate
- Click on Create Prometheus Metrics.
- Check the Health Status of Metrics
- Go to Respective Hawk Agent and you can see microagent and method are created with Job Name
- Try to invoke a Hawk method which can be used to create Rulebase

Issue/Introduction

How to expose mBeans of a JMX target with Prometheus JMX exporter via TIBCO Hawk RedTail