Skip to content

A Quickstart for using Prometheus, Jaeger, and Grafana to monitor JBoss EAP/Wildfly application server instances

License

Notifications You must be signed in to change notification settings

redhat-appdev-practice/eap-telemetry-quickstart

Repository files navigation

Overview

This repository is a quick start for running Prometheus, Jaeger, and Grafana using podman. The configuration files are set up to monitor JBoss EAP/Wildlfy Enterprise Java Application Servers. Collecting the metrics is intended to be used with various tuning guides in order to improve performance of applications running on the application server(s).

Prerequisites

  • Podman >= 4.0
  • Bourne/Bourne-again compatible shell
  • yq
  • One or more JBoss EAP/Wildfly instances configured such that the management interface is accessible
  • OPTIONAL: A node_exporter running on the target system to monitor OS metrics

Getting Started

  1. Clone this repository
  2. Edit the prometheus.yml file and change the targets for metrics collection.
    • scrape_configs:
      # this is the configuration to poll metrics from WildFly 15
      - job_name: 'metrics'
        metrics_path: /metrics
        scrape_interval: 5s
        static_configs:
          - targets:
              - '192.168.100.10:9990'
              - '192.168.100.15:9990'
              - '192.168.100.20:9990'
      # this is the configuration to poll metrics from the host OS if `node_exporter` is installed
      - job_name: 'host'
        metrics_path: /metrics
        scrape_interval: 5s
        static_configs:
          - targets:
            # Add hosts to collect OS metrics and the appropriate port
            - '192.168.100.10:9100'
            - '192.168.100.15:9100'
            - '192.168.100.20:9100'
            - '192.168.100.60:9100'
            - '192.168.100.70:9100'
    • Each target should be the IP and port of the management interface for the JBoss EAP/Wildlfy instances which have metrics enabled
    • The scrape_interval can be adjusted as desired
    • If your hostnames or IP addresses are not very friendly to read, you can use a relabel_configs section to map those to more readable names:
      scrape_configs:
      # this is the configuration to poll metrics from WildFly 15
      - job_name: 'metrics'
        metrics_path: /metrics
        scrape_interval: 5s
        static_configs:
          - targets:
            # Add hosts to collect JBoss metrics and the appropriate port
            - '192.168.100.10:9990'
            - '192.168.100.15:9990'
            - '192.168.100.20:9990'
        relabel_configs:
        - source_labels: [__address__]    # The address configured in the targets above
          separator: ':'
          regex: '192\.168\.100\.10:(.*)' # The regular expression to match with
          replacement: 'jboss01'          # The replacement (including any capture groups)
          target_label: instance          # The label where the new value will be placed
        - source_labels: [__address__]
          separator: ':'
          regex: '192\.168\.100\.15:(.*)'
          replacement: 'jboss02'
          target_label: instance
        - source_labels: [__address__]
          separator: ':'
          regex: '192\.168\.100\.20:(.*)'
          replacement: 'jboss03'
          target_label: instance
  3. If necessary, the scrape configuration can include basic auth credentials for the targets
    • scrape_configs:
      # this is the configuration to poll metrics from WildFly 15
      - job_name: 'metrics'
        metrics_path: /metrics
        scrape_interval: 5s
        static_configs:
          - targets:
              - '192.168.100.10:9990'
              - '192.168.100.15:9990'
              - '192.168.100.20:9990'
        basic_auth:
          username: '<username>'
          password: '<password>'
  4. Once the prometheus configuration has been updated, start the monitoring stack
    • ./monitoring.sh
  5. Navigate to the Grafana console using http://localhost:3000/
  6. Log in with the default admin:admin credentials
    • It is fine to change the default credentials if desired. Keep in mind that those credentials are stored in the podman volume and will be reset if that volume is deleted.
  7. Click on Dashboards

You can now start creating visualizations using the Prometheus datasource

Alerting

If you wish to have a test configuration for alerting using Prometheus, then you can also enable AlertManager.

  1. Edit alertmanager.yml and configure your alert routes and connections based on documentation HERE
  2. Update the running pod by running the monitoring.sh script with the -a argument ./monitoring.sh -a

Included Dashboards

This quick-start includes from pre-configured dashboards for various metrics. Examples of those dashboards are shown below:

  • JBoss EAP Dashboard JBoss EAP Dashboard
  • Linux OS Dashboard Linux OS Dashboard
  • HAProxy Dashboard HAProxy Dashboard

About

A Quickstart for using Prometheus, Jaeger, and Grafana to monitor JBoss EAP/Wildfly application server instances

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages