Git Product home page Git Product logo

prometheus-jfr-exporter's Introduction

Prometheus JFR Exporter Build Status

a collector that scrapes JFR events from a JVM target at runtime for Prometheus to use

Obtaining the Exporter

You can obtain a agent jar by downloading a prebuilt artifact or building from source.

[Option 1] Using a Prebuilt JAR

Download the prebuilt jar from the release page.

$ wget https://github.com/tabjy/prometheus-jfr-exporter/releases/latest/download/prometheus-jfr-exporter-1.0-SNAPSHOT-all.jar

[Option 2] Building from Source

Requirements

This project references libraries from JDK Misson Control project, which is not published on Maven Central. In order to build from source, gradle expects to find JMC artifacts in Maven Local. Follow offical instructions to build JMC.

After packaging JMC, run the following command in JMC root directory to install artifacts to Maven Local.

$ mvn install -DskipTests -Dspotbugs.skip=true

Building Instructions

  • Clone this repository to local.
    $ git clone https://github.com/tabjy/prometheus-jfr-exporter.git
  • Run gradle to build a fat jar.
    $ cd prometheus-jfr-exporter
    $ ./gradlew shadowJar
  • Find the built jar in build/libs directory.
    $ ls build/libs/prometheus-jfr-exporter*.jar

Running a Exporter

JFR Prometheus Exporter accesses recordings using JMX connections. Before running this program, make sure you have another JVM instance running and listening for JMX connections.

Usage

$ java -jar ./prometheus-jfr-exporter-1.0-SNAPSHOT-all.jar -h
Usage of Prometheus JFR exporter:
  program <[jmxHostname]:[jmxPort]> [[httpHostname]:[httpPort]] [option...]

Options:
  -eventConfiguration <path>  a location where a .jfc configuration can be found
  -disk [bool]                set this recording to continuously flush to the disk repository
  -dumpOnExit [bool]          set this recording to dump to disk when the JVM exits
  -maxAge <time>              how far back data is kept in the disk repository
  -maxSize <size>             how much data is kept in the disk repository
  -name <name>                a human-readable name (for example, "My Recording")

Example

$ java -jar ./prometheus-jfr-exporter-1.0-SNAPSHOT-all.jar localhost:9091 0.0.0.0:8080

By default, the exporter endpoint will be running on http://0.0.0.0:8080/metrics with default.jfc event configuration.

Testing

// TODO

License

This project is licensed under the GNU GENERAL PUBLIC LICENSE (Version 3).

prometheus-jfr-exporter's People

Contributors

tabjy avatar

Stargazers

陈振阳 avatar Heinrich Spreiter avatar  avatar Suresh avatar Thilo-Alexander Ginkel avatar rong fengliang avatar NightOwl avatar Jie Kang avatar Dustin Kut avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.