prometheus openstack exporter #0

Supports: xenial bionic trusty yakkety
Add to new model

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/prometheus-openstack-exporter-charm

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/prometheus-openstack-exporter-charm
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 config 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 config prometheus-openstack-exporter schedulable-instance-size="1,2048,20"

If the cloud doesn't support cinder / nova volumes, set this to "False":

juju config prometheus-openstack-exporter use_nova_volumes="False"

Juju resources support

The charm support juju resources, which is handy in offline deployments. Prefetch the snap:

snap download prometheus-openstack-exporter

Provide downloaded snap (prometheus-openstack-exporter_25.snap) as a resource to the application:

juju deploy cs:prometheus-openstack-exporter \
--resource prometheus-openstack-exporter=prometheus-openstack-exporter_25.snap

Limitations

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

juju config 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
cpu-allocation-ratio
(float) Same as nova-cloud-controller
4
disk-allocation-ratio
(float) Similar to other allocation-ratios
1
extra-nrpe-args
(string) Additional arguments to set for the check_http Nagios nrpe check. E.g. if you wish to increase timeouts, set to '-w 20 -c 30'.
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
nagios_servicegroups
(string) Comma separated list of nagios servicegroups for the graphite check
juju
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_name: $OS_REGION_NAME, auth_url: '$OS_AUTH_URL' }"
port
(int) Port where the exporter listens
9183
ram-allocation-ratio
(float) Same as nova-cloud-controller
1
schedulable-instance-size
(string) Default "reference" instance size as: VCPU, RAM(MB), DISK(GB). E.g.: 1, 2048, 20
1, 2048, 20
snap_channel
(string) If install_method is set to "snap" this option controlls channel name. Supported values are: "stable", "candidate", "beta" and "edge"
stable
snap_proxy
(string) DEPRECATED. Use snap-http-proxy and snap-https-proxy model configuration settings. HTTP/HTTPS web proxy for Snappy to use when accessing the snap store.
snap_proxy_url
(string) DEPRECATED. Use snap-store-proxy model configuration setting. The address of a Snap Store Proxy to use for snaps e.g. http://snap-proxy.example.com
snapd_refresh
(string) How often snapd handles updates for installed snaps. The default (an empty string) is 4x per day. Set to "max" to check once per month based on the charm deployment date. You may also set a custom string as described in the 'refresh.timer' section here: https://forum.snapcraft.io/t/system-options/87
ssl_ca
(string) TLS CA certficate, to be added as OS_CACERT
use_nova_volumes
(string) Value that will be added to prometheus-openstack-exporter.yaml. Set to "False" for clouds which don't have Cinder / Nova volumes.
True