MAINTENANCE NOTICE
This snap is under maintenance mode. Only critical bug will be handled. See the Migration
guide for more details on how to migrate to the new solution:
Overview
Prometheus Juju Exporter is a snap that collects statistics about machines deployed by a juju controller and exports them as Prometheus metrics.
The snap runs as a daemon service, crawling through every Juju model it finds and collecting information about deployed machines. Resulting metrics contain numeric representation 1
(UP) or 0
(DOWN) for each machine deployed by the controller. In addition, each machine (metric) has labels that help to uniquely identify it:
Compatibility matrix
Due to the limitations of libjuju's [1] cross-version support, channels and versions are used in the snap to accommodate different juju controller versions. Generally speaking, install the snap channel that matches the version of the Juju controller.
For example, in a Juju cloud with a version 2.9 controller, users must install the snap from the 2.9/stable
channel:
sudo snap install --channel 2.9/stable prometheus-juju-exporter
A more exhaustive version mapping table is available in the project's README file [2].
Configuration
To configure the snap for your own environment, create a config.yaml
file in the $SNAP_DATA
(refer to Snap Environment Variables [3] linked below) directory.
Example configuration:
customer: # information about the targeted cloud
name: "example_customer"
cloud_name: "example_cloud"
juju: # these are usually found under ~/.local/share/juju
# The endpoint and CA certificate of the targeted controller
controller_endpoint: ""
controller_cacert: "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n"
# Credentials of a juju user. The minimum privileges of the user should be:
# `login` access to the controller and `admin` access to its model, as well as
# `admin` access to any other model monitored by this exporter
username: "example_user"
password: "example_password"
exporter:
port: 9748 # optional, defaults to 5000
collect_interval: 15
# parameters affecting the detection of machine types (physical or virtual)
detection:
# Interface names to consider when detecting machine type.
# Takes a single regex string as input. The default value '' is
# equivalent to '.*'.
match_interfaces: ''^(en[os]|eth)\d+|enp\d+s\d+|enx[0-9a-f]+”
# The list of MAC address prefixes to be considered as virtual machines.
virt_macs: ["52:54:00", "fa:16:3e", "06:f1:3a", "00:0d:3a", "00:50:56"]
The machine type detection algorithm will classify a machine as virtual if any MAC address included in the virt_macs
prefix list matches the MAC address of any of the interfaces selected by the match_interfaces
regex. If no such match is found, the machine is considered to be a physical machine.
Viewing metrics
The exported Prometheus metrics can be viewed directly by accessing the port specified in config.yaml
of the machine on which the charm is deployed. For example, curl http://192.168.5.10:5000
With a successful Prometheus integration, the exported metrics will be scraped from the endpoint and displayed as time series data.
Links
Thank you for your report. Information you provided will help us investigate further.
There was an error while sending your report. Please try again later.
You are about to open
Do you wish to proceed?
Snaps are applications packaged with all their dependencies to run on all popular Linux distributions from a single build. They update automatically and roll back gracefully.
Snaps are discoverable and installable from the Snap Store, an app store with an audience of millions.
On Arch Linux, snap can be installed from the Arch User Repository (AUR). The manual build process is the Arch-supported install method for AUR packages, and you’ll need the prerequisites installed before you can install any AUR package. You can then install snap with the following:
git clone https://aur.archlinux.org/snapd.git
cd snapd
makepkg -si
Once installed, the systemd unit that manages the main snap communication socket needs to be enabled:
sudo systemctl enable --now snapd.socket
If AppArmor is enabled in your system, enable the service which loads AppArmor profiles for snaps:
sudo systemctl enable --now snapd.apparmor.service
To enable classic snap support, enter the following to create a symbolic link between /var/lib/snapd/snap
and /snap
:
sudo ln -s /var/lib/snapd/snap /snap
Either log out and back in again, or restart your system, to ensure snap’s paths are updated correctly.
To install Prometheus Juju Exporter, simply use the following command:
sudo snap install prometheus-juju-exporter
Browse and find snaps from the convenience of your desktop using the snap store snap.
Interested to find out more about snaps? Want to publish your own application? Visit snapcraft.io now.
Get to know Canonical, the company behind the products.
The world's favourite Linux OS for servers, desktops and IoT.
One subscription for security maintenance, support, FIPS and other compliance certifications.
The app store for Linux: secure packages and ultra-reliable updates.
A pure-container hypervisor. Run system containers and VMs at scale.
Build a bare metal cloud with super fast server provisioning.
Upgrades, maintenance, support, and fully managed options for long-term, low-cost infra.
Software-defined storage that lowers your total cost of ownership.
App portability for K8s on VMware, Amazon, Azure, Google, Oracle, IBM and bare metal.
Deploy, integrate and manage applications at any scale, on any infrastructure.
Stream Android applications to any device.
The software collaboration platform behind Ubuntu.
Optimised Ubuntu for public clouds.
Spin up Ubuntu VMs on Windows, Mac and Linux.
Control and customise your cloud instances.
Systems management and security patching for Ubuntu.
Simplify and standardise complex network configuration.
AI and MLOps at any scale, on any cloud.
Deploy a fully functional cloud in minutes.