Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.
heiko-braun edited this page Nov 6, 2014 · 4 revisions

Using RHQ Metrics with Wildfly

Important
This document talks about the new RHQ Metrics backend. Not plain RHQ.

The monitor subsystem can be configured to use RHQ Metrics for storing the metric data. In these section we’ll walk through the necessary steps to install and configure the subsystem and related components to create a simple end-to-end solution.

Getting Started

Install RHQ Metrics

Check out RHQ Metrics master branch from GitHub and start the RHQ Metrics server

$ git clone https://github.com/rhq-project/rhq-metrics
$ cd rhq-metrics
$ ./start.sh

This will download, build and start the RHQ Metrics server.

Important
This will download a WildFly 8.1 server to your local maven repository if not yet there and then start it with default parameters. Those may clash with an already running WildFly on your system.
Tip
If you only want to try the WildFly monitor, you can just use the WildFly server of RHQ Metrics.

Subsystem Configuration

In order to leverage RHQ Metrics you need to configure the storage adapter (rhq) and point it to the database you intend to use. In this example we are RHQ metrics deployed locally on Wildfly (http://http://localhost:8080/rhq-metrics/metrics):

<subsystem xmlns="urn:org.rhq.metrics:wildfly-monitor:1.0">

  <storage-adapter
    name="rhq"
    url="http://http://localhost:8080/rhq-metrics/metrics" 
  />
   
  <server-monitor name="default" enabled="true" num-threads="2">

        <data-input name="heap"
                    seconds="20"
                    resource="/core-service=platform-mbean/type=memory"
                    attribute="heap-memory-usage#used"/>

        <data-input name="non-heap"
                    seconds="20"
                    resource="/core-service=platform-mbean/type=memory"
                    attribute="non-heap-memory-usage#used"/>

        <data-input name="thread-count"
                    minutes="1"
                    resource="/core-service=platform-mbean/type=threading"
                    attribute="thread-count"/>

    </server-monitor>

    <diagnostics
            name="console"
            enabled="true" seconds="10"/>
</subsystem>

Using the RHQ Metric UI

Go to http://localhost:8080 and select metrics to be displayed from the list on the left. If the list is empty, wait a while until some data is sent to the server and click on the refresh button

Screenshot of RHQ Metrics Console

Grafana Dashboards

If you want to use Grafana with RHQ Metrics, have a look at a blog post describing the setup.

Trouble Shooting

The wildfly monitor and related components are in it’s early stages. If you run into problems or have further suggestions, please let us know.