Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kairosdb/jmxreporter
Universal tool to report JMX metrics to any backend supported by Metrics4j
https://github.com/kairosdb/jmxreporter
Last synced: about 1 month ago
JSON representation
Universal tool to report JMX metrics to any backend supported by Metrics4j
- Host: GitHub
- URL: https://github.com/kairosdb/jmxreporter
- Owner: kairosdb
- License: apache-2.0
- Created: 2019-12-17T02:44:30.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-30T16:12:51.000Z (8 months ago)
- Last Synced: 2024-05-02T10:38:12.904Z (8 months ago)
- Language: Java
- Size: 26.4 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JMXReporter
Universal tool to report JMX metrics to any backend supported by Metrics4j.Yes that is right, say you are running Kafka and want to report JMX metrics to
InfluxDB or Graphite or both at the same time. This tool is for you.The main purpose of this tool was to showcase the power of Metrics4j. JMXReporter
is very simple in what it does, it registers JMX metrics as sources for Metrics4j
so they can be reported.## Getting Started
1. Download the JMXReporter jar file.
1. For your JMX application (say Kafka) add JMXReporter to the java command line
as a javaagent (-javaagent:path_to_jxmreporter_jar)
1. Place the following simple metrics4j.conf file in the applications classpath. Or specify the location with -DMETRICS4J_CONFIG=/path/to/metrics4j.conf
```hocon
metrics4j: {
_dump-file: "dump.conf"
plugins: {
jmx: {
_class: "org.kairosdb.metrics4j.plugins.JMXReporter"
type-map: {
#If some message beans are not showing up you may need to map them to a native type
#java.lang.Object: "long"
}
#Identifies what attributes to put in the class name in the config file.
class-name-attributes: ["type", "name"]
}
}
}
```Run your application and when it shuts down Metrics4j will create the file dump.conf
that shows all the JMX sources that were found. With some applications shutdown
may happen too quickly and the dump file may not be created. The dump file is also
written out after the application has ran for 1 minute.Replace the simple metrics4j.conf file with the one from the dump and then follow
the Metrics4j documentation to add a trigger, formatter and sink so it can
send off your JMX metrics. https://github.com/kairosdb/metrics4jNote: Because all of the JMX metrics are created as custom sources in metrics4j
you don't need to define a collector in your metrics4j.conf file.Checkout the wiki page for samples as I test this with various applications:
https://github.com/kairosdb/JMXReporter/wiki