Skip to content

A suite of instrumentation metric primitives for Java (JVM) that can be exposed through a JSON web services interface.

License

Notifications You must be signed in to change notification settings

seeemilyplay/client_java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prometheus JVM Client

It supports Java, Clojure, Scala, JRuby, and anything else that runs on the JVM.

Using

Assets

If you use Maven, you can simply reference the following assets:

  • The Client
    • groupId: io.prometheus
    • artifactId: client
    • version: 0.0.4
  • Hotspot 'jvmstat/perfdata' Metrics
    • groupId: io.prometheus.client.utility
    • artifactId: jvmstat
    • version: 0.0.4
  • Hotspot VM Metrics
    • groupId: io.prometheus.client.utility
    • artifactId: hotspot
    • version: 0.0.4
  • Exposition Servlet - Transferring Metrics to Prometheus Servers
    • groupId: io.prometheus.client.utility
    • artifactId: servlet
    • version: 0.0.4

Getting Started

There are canonical examples defined in the class definition Javadoc headers in the io.prometheus.client.metrics package.

Documentation

The client is canonically documented with Javadoc. Running the following will produce output local documentation in apidocs directories for you to read.

$ mvn package

If you use the Mavenized version of the Prometheus client, you can also instruct Maven to download the Javadoc and source artifacts.

Alternatively, you can also look at the generated Java Client Github Project Page, but the raw Javadoc in Java source in version control should be treated as the canonical form of documentation.

Maintenance of this Library

This suite is built and managed by Maven, and the artifacts are hosted on the Sonatype OSS Asset Repository.

All contributions to this library must follow, as far as practical, the prevalent patterns in the library for consistency and the following style guide: Google Java Style. Depending upon your development environment, you may be able to find an automatic formatter and adherence checker that follows these rules.

Building

$ mvn compile

Testing

$ mvn test

Please note that tests on Travis may be unreliable due to the absence of installed Maven artifacts. Ensure that the current snapshot version is deployed to Sonatype OSS Repository.

Deployment

These steps below are only useful if you are in a release engineering capacity and want to publicize these changes for external users. You will also need to have your local Maven setup correctly along with valid and public GPG key and adequate authorization on the Sonatype OSS Repository to submit new artifacts, be they staging or release ones.

You should read the Sonatype OSS Maven Repository Usage Guide before performing any of the following:

Staging

$  mvn clean deploy -DperformRelease=true

Release

$ mvn release:clean -DperformRelease=true
$ mvn release:prepare -DperformRelease=true
$ mvn release:perform -DperformRelease=true

Documentation

Documentation can also be released to the public via the Github Pages subproduct through the magic gh-pages branch for a Github project. Documentation is generated via the following command:

$ mvn javadoc:aggregate

It will need to be automatically merged into the gh-pages branch, but that is as simple as this:

$ git checkout master
$ mvn javadoc:aggregate
$ git checkout gh-pages
$ mv target/site/apidocs/ ./
$ git status
$ # Amend the branch as necessary.
$ git commit
$ git push

There is a Maven plugin to perform this work, but it is broken. The javadoc:aggregate step will emit documentation into target/site/apidocs. The reason that we use this aggregate step instead of bare javadoc is that we want one comprehensive Javadoc emission that includes all Maven submodules versus trying to manually concatenate this together.

Output documentation lives in the Java Client Github Project Page.

Contact

Build Status

About

A suite of instrumentation metric primitives for Java (JVM) that can be exposed through a JSON web services interface.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%