/juju_exporter

Juju Prometheus exporter

Primary LanguageGoApache License 2.0Apache-2.0

Juju Prometheus Exporter

Simple Juju Prometheus exporter written in Golang. Exports metrics regarding the current status of the Juju agents for all machines, applications and units of a model. Uses the Go client to connect to Juju, so the Juju binaries are not required.

Juju exporter supports querying metrics for multiple Juju models with a single config file.

Usage

Releases

juju_exporter uses GitHub for releases.

Setup

Recommended: Create a Juju user named juju-exporter with read-only access to the model you want to export metrics from. With the juju CLI:

$ juju add-user juju-exporter
$ juju change-user-password juju-exporter
$ juju grant juju-exporter read $MODEL_NAME

Create a juju_exporter.yaml configuration file with the following contents (You can find most that information for your own deployment by running juju show-controller).

---
default: MODEL_1
models:
  MODEL_1:
    api-endpoints: [10.0.0.1:17070, 10.0.0.2:17070, 10.0.0.3:17070]
    model-uuid: MODEL_UUID_1
    username: juju-exporter
    password: super-safe-password
    ca-cert: |
      -----BEGIN CERTIFICATE-----
      <certificate contents>
      -----END CERTIFICATE-----
  MODEL_2:
    api-endpoints: [10.0.0.1:17070, 10.0.0.2:17070, 10.0.0.3:17070]
    model-uuid: MODEL_UUID_2
    username: juju-exporter
    password: super-safe-password
    ca-cert: |
      -----BEGIN CERTIFICATE-----
      <certificate contents>
      -----END CERTIFICATE-----

Query

Query metrics for MODEL_2:

  • curl http://localhost:9970/metrics?model=MODEL_2

Or query for the default model:

  • curl http://localhost:9970/metrics