Coder Social home page Coder Social logo

jmxfetch's Introduction

Build Status

JMXFetch

JMXFetch is the new tool to collect metrics from JMX Servers in order to be sent to Datadog (http://www.datadoghq.com) It is called by the Datadog Agent (https://github.com/Datadog/datadog-agent) and sends metrics back to the Agent using the Java dogstatsd library.

How to contribute code?

First of all and most importantly, thank you for sharing.

If you want to submit code, please fork this repository and submit pull requests against the master branch.

Please note that the Agent is licensed for simplicity's sake under a simplified BSD license, as indicated in the LICENSE file. Exceptions are marked with LICENSE-xxx where xxx is the component name. If you do not agree with the licensing terms and wish to contribute code nonetheless, please email us at [email protected] before submitting your pull request.

Building from source

JMXFetch uses Maven for its build system.

In order to generate the jar artifact, simply run the mvn clean compile assembly:single command in the cloned directory.

The distribution will be created under target/.

Once the jar is created, you can update the one in the Datadog Agent repo.

Coding standards

JMXFetch uses Checkstyle with Google Java Style to enforce coding standards.

To perform a Checkstyle analysis and outputs violations, run:

mvn checkstyle::check

Checkstyle analysis is automatically executed prior to compiling the code, testing.

Generated code

JMXFetch uses Lombok to modify classes and generate additional code at runtime. You may need to enable annotation processors to compile in your IDE.

Testing

To run unit test, issue the following command:

mvn test

Testing Deployments

You can test the deployment by using the Nexus3 OSS image. To do so you need to:

  • Use the local endpoints in the pom.xml:
...
    <distributionManagement>
        <snapshotRepository>
          <id>nexus</id>
          <url>http://localhost:8081/repository/maven-snapshots/</url>
        </snapshotRepository>
        <repository>
            <id>nexus</id>
            <url>http://localhost:8081/repository/maven-releases/</url>
        </repository>
    </distributionManagement>
...
    <build>
        <plugins>
            ...
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                ...
                <configuration>
                    <serverId>nexus</serverId>
                    <nexusUrl>http://localhost:8081/repository/maven-releases/</nexusUrl>
                    <autoReleaseAfterClose>false</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>
...
  • Start the Nexus 3 container:
docker run --rm -d \
  --name nexus3 \
  -p 8081:8081 \
  -e INSTALL4J_ADD_VM_PARAMS='-Xms512m -Xmx512m -XX:MaxDirectMemorySize=512m -Djava.util.prefs.userRoot=/nexus-data/javaprefs' \
  sonatype/nexus3
docker exec -it nexus3 cat /nexus-data/admin.password
  • Export those values for the build:
export GPG_KEY="<Key ID for signing the artifact>"
export GPG_PASSPHRASE="<Password for the private key of $GPG_KEY>"
export SONATYPE_USER="admin"
export SONATYPE_PASS="<Password for Nexus admin from previous step>"
  • Run the deploy with the appropriate skipStaging flag:
mvn -DskipTests -DskipStaging=true -DperformRelease=true --settings settings.xml clean deploy

If you do this correctly, the artifact will be available in the Nexus container at http://localhost:8081/#browse/browse:maven-releases.

Note: If you are trying to redeploy the same version of the artifact to the local Nexus repository, you will need to change the Deployment Policy for maven-releases to Allow redeploy in the UI otherwise the subsequent publishes will fail.

Running:

Get help on usage:
java -jar jmxfetch-0.44.2-jar-with-dependencies.jar --help

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.