openstack-ansible-ops/cluster_metrics
Melvin Hillsman 9e706b13a3 Add prometheus_client as optional output
Currently the only outputs plugin used is influxdb. This adds
prometheus_client outputs plugin and its directives as options.
The telegraf.conf.j2 template has been updated to check for the
outputs_prometheus_client variable and two other related variables.
New variable names and default values are shown in vars.yml.

Change-Id: I8d9380a4cc2ea58b4ad98b9fc964d45ff82090ed
Signed-off-by: Melvin Hillsman <mrhillsman@gmail.com>
2017-06-12 11:24:20 -05:00
..
etc implement minimal metric collection 2016-09-09 13:08:38 -05:00
files Added kvm_virsh to telegraf plugins 2017-01-10 18:02:49 +00:00
grafana-dashboards Fixing counter based graphs inside the Swift dashboard 2017-04-25 10:41:04 -05:00
handlers implement minimal metric collection 2016-09-09 13:08:38 -05:00
kapacitor_files Added kapacitor scripts 2017-01-26 22:10:45 +00:00
templates Add prometheus_client as optional output 2017-06-12 11:24:20 -05:00
ansible.cfg implement minimal metric collection 2016-09-09 13:08:38 -05:00
playbook-grafana.yml Use apt_repository update_cache feature 2016-11-04 16:51:31 +00:00
playbook-influx-db.yml Merge "Adding influx relay to make the existing monitoring stack highly available" 2016-11-17 13:40:58 +00:00
playbook-influx-telegraf.yml Telegraf playbook fixes 2017-05-09 15:40:13 -05:00
playbook-kapacitor.yml Added kapacitor scripts 2017-01-26 22:10:45 +00:00
playbook-metrics-lb.yml Adding influx relay to make the existing monitoring stack highly available 2016-11-10 15:54:56 +00:00
readme.rst Adding Swift Proxy Server Dashboard 2017-04-13 16:19:09 -05:00
vars.yml Add prometheus_client as optional output 2017-06-12 11:24:20 -05:00

readme.rst

Gather and visualize cluster wide metrics

date

2016-09-01

tags

openstack, ansible

category

*openstack, *nix

About this repository

This set of playbooks will deploy InfluxDB, Telegraf, Grafana and Kapacitor for the purpose of collecting metrics on an OpenStack cluster.

Process

Clone the OPS repo

cd /opt
git clone https://git.openstack.org/openstack/openstack-ansible-ops

Copy the env.d files into place

cd openstack-ansible-ops/cluster_metrics
cp etc/env.d/cluster_metrics.yml /etc/openstack_deploy/env.d/

Add the export to update the inventory file location

export ANSIBLE_INVENTORY=/opt/openstack-ansible/playbooks/inventory/dynamic_inventory.py

If you are running the HA Proxy you should run the following playbook as well to enable the grafana port 8089

openstack-ansible playbook-metrics-lb.yml

Create the containers

openstack-ansible /opt/openstack-ansible/playbooks/lxc-containers-create.yml -e container_group=cluster-metrics

Install InfluxDB

openstack-ansible playbook-influx-db.yml

Install Influx Telegraf

If you wish to install telegraf and point it at a specific target, or list of targets, set the influx_telegraf_targets variable in the user_variables.yml file as a list containing all targets that telegraf should ship metrics to.

openstack-ansible playbook-influx-telegraf.yml --forks 100

Install grafana

If you're proxy'ing grafana you will need to provide the full root_path when you run the playbook add the following -e grafana_root_url='https://cloud.something:8443/grafana/'

openstack-ansible playbook-grafana.yml -e galera_root_user=root -e galera_address='127.0.0.1'

Once that last playbook is completed you will have a functioning InfluxDB, Telegraf, and Grafana metric collection system active and collecting metrics. Grafana will need some setup, however functional dashboards have been provided in the grafana-dashboards directory.

Install Kapacitor

openstack-ansible playbook-kapacitor.yml

OpenStack Swift PRoxy Server Dashboard

Once the telegraf daemon is installed onto each host, the Swift proxy-server can be instructed to forward statsd metrics to telegraf. The following configuration enabled the metric generation and need to be added to the user_variables.yml:

swift_proxy_server_conf_overrides:
  DEFAULT:
    log_statsd_default_sample_rate: 10
    log_statsd_metric_prefix: "{{ inventory_hostname }}.swift"
    log_statsd_host: localhost
    log_statsd_port: 8125

Rewrite the swift proxy server configuration with :

cd /opt/openstack-ansible/playbooks
openstack-ansible os-swift-setup.yml --tags swift-config --forks 2