prometheus openstack exporter #2

Description

This is an exporter that exposes information gathered from Openstack
for use by the Prometheus monitoring system.

Overview

This charm provides openstack-exporter services for prometheus

Build

The fully built charm needs the following source branch
* https://git.launchpad.net/~canonical-bootstack/bootstack-ops/+git/charm-prometheus-openstack-exporter

To build the charm, do:

Prepare the environment

mkdir -p layers charms/xenial
export JUJU_REPOSITORY=$PWD/charms

Clone the repositories

pushd layers
git clone https://git.launchpad.net/bootstack-ops/~canonical-bootstack/+git/charm-prometheus-openstack-exporter
popd

Build the charm, and symlink for juju-1 compatibility

charm build layers/charm-prometheus-openstack-exporter
ln -s ../builds/prometheus-openstack-exporter charms/xenial

Usage

With the OpenStack nova-compute and neutron-gateway charms:

juju deploy local:xenial/prometheus-openstack-exporter

This charm supports relating to keystone, but keystone-credentials
interface seems to be flaky, and hard to remove-relation, so the
charm works around this by adding 'os-credentials' setting as a YAML
dict (see setting description hints)

juju set prometheus-openstack-exporter os-credentials="{ ... }"

juju add-relation prometheus-openstack-exporter swift-storage-z1
juju add-relation prometheus-openstack-exporter swift-storage-z2
juju add-relation prometheus-openstack-exporter swift-storage-z3
juju add-relation prometheus prometheus-openstack-exporter

Configuration Options

If you want to change the default instance size used as reference for number of
schedulable vms:

juju set prometheus-openstack-exporter schedulable-instance-size="1,2048,20"

Limitations

This charm needs some configuration to be manually copied from
nova-cloud-controller settings (as nova api doesn't expose it)

juju set prometheus-openstack-exporter cpu-allocation-ratio=4.0 ram-allocation-ratio=1.0 disk-allocation-ratio=1.0

Configuration

cache-refresh-interval
(int) Time in seconds between cache refresh
300
nagios_servicegroups
(string) Comma separated list of nagios servicegroups for the graphite check
juju
cpu-allocation-ratio
(float) Same as nova-cloud-controller
4
snap_channel
(string) If install_method is set to "snap" this option controlls channel name. Supported values are: "stable", "candidate", "beta" and "edge"
stable
disk-allocation-ratio
(float) Similar to other allocation-ratios
1
snap_proxy
(string) HTTP/HTTPS web proxy for Snappy to use when accessing the snap store.
nagios_context
(string) A string that will be prepended to instance name to set the host name in nagios. So for instance the hostname would be something like: juju-myservice-0 If you're running multiple environments with the same services in them this allows you to differentiate between them.
juju
ssl_ca
(string) TLS CA certficate, to be added as OS_CACERT
ram-allocation-ratio
(float) Same as nova-cloud-controller
1
os-credentials
(string) YAML string with admin user to use to query openstack APIs, e.g. "{ username: $OS_USERNAME, password: $OS_PASSWORD, tenant_name: $OS_TENANT_NAME, region: $OS_REGION_NAME, auth_url: '$OS_AUTH_URL' }"
schedulable-instance-size
(string) Default "reference" instance size as: VCPU, RAM(MB), DISK(GB). E.g.: 1, 2048, 20
1, 2048, 20
port
(int) Port where the exporter listens
9183