Jump to content

Cassandra/PrometheusJmxExporter

From Wikitech

The Prometheus JMX Exporter is a JVM agent that creates an HTTP listener to export MBean metrics for Prometheus.

Source

Wikimedia maintains a Github branch of the repository, with the Maven pom.xml patched to deploy the jar to archiva.wikimedia.org.

Deployment

The agent is deployed from https://gerrit.wikimedia.org/r/#/admin/projects/operations/software/prometheus_jmx_exporter via Scap.

Updating the deploy repo

The deploy repository makes use of git-fat to sync the jar file to a working copy from Archiva, as necessary. If you need to deploy a new version of the strategy, the basic steps are:

  1. Build, and deploy to Archiva with Maven.
    $ cat ~/.m2/settings.xml
    <settings>
      <servers>
        <server>
          <id>wikimedia.releases</id>
          <username>archiva-deploy</username>
          <password>PASSWORD_GOES_HERE</password>
        </server>
        <server>
          <id>wikimedia.snapshots</id>
          <username>archiva-deploy</username>
          <password>PASSWORD_GOES_HERE</password>
        </server>
      </servers>
    </settings>
    $ mvn deploy
    ...
    
  2. Update the operations/software/prometheus_jmx_exporter with the jar
    $ cp /path/to/exporter/jmx_prometheus_javaagent/target/jmx_prometheus_javaagent-<version>.jar lib/
    $ git add lib/jmx_prometheus_javaagent-<version>.jar
    $ git commit -m 'Adding jmx_prometheus_javaagent-<version>.jar via git-fat'
    
    Note: Make sure that the jar you add to git is the same one uploaded in #1 (checksums should be matching). See Adding an artifact to your project for additional information.
  3. Deploy to the Cassandra nodes (see https://doc.wikimedia.org/mw-tools-scap/)