Application capable to export hardware sensor data from Ironic nodes to a Prometheus Server.
Go to file
Ilya Etingof 46e50fb56f Move timestamp registry to a sharable 'header' module
The timestamp registry is going to be used by other parsers
in the future. Thus it seems reasonable to move if from ipmi
to something sharable.

Conceptually, `timestamp_registry` operates on Oslo message
header - perhaps we can have a dedicated parser module for
such common things - 'header'.

Change-Id: I2ba2f0ae28f09dbccd818c82005d47c7a515dfd4
2019-09-09 16:53:39 +02:00
doc Release Notes support 2019-07-24 09:50:32 +02:00
ironic_prometheus_exporter Move timestamp registry to a sharable 'header' module 2019-09-09 16:53:39 +02:00
releasenotes Support for metrics description 2019-09-09 09:02:49 -03:00
.gitignore Release Notes support 2019-07-24 09:50:32 +02:00
.gitreview Migrate to opendev infra 2019-07-11 12:50:32 +02:00
.stestr.conf Initial version for Prometheus File Driver 2019-03-26 09:55:27 +01:00
.zuul.yaml Release Notes support 2019-07-24 09:50:32 +02:00
CONTRIBUTING.md Initial commit 2019-03-19 17:25:52 +01:00
DCO Initial commit 2019-03-19 17:25:52 +01:00
LICENSE Initial commit 2019-03-19 17:25:52 +01:00
README.rst Migrate to opendev infra 2019-07-11 12:50:32 +02:00
requirements.txt Migrate to opendev infra 2019-07-11 12:50:32 +02:00
setup.cfg build universal wheels 2019-07-26 06:08:02 -04:00
setup.py Migrate to opendev infra 2019-07-11 12:50:32 +02:00
test-requirements.txt Updates for Prometheus Exporter 2019-04-08 13:24:34 +02:00
tox.ini Release Notes support 2019-07-24 09:50:32 +02:00

README.rst

Ironic Prometheus Exporter

Overview

Tool to expose hardware sensor data in the Prometheus format through an HTTP endpoint.

The hardware sensor data come from bare metal machines deployed using OpenStack Bare Metal Service (ironic).

Installation

1 - Install ironic-prometheus-exporter :

$ pip install --user ironic-prometheus-exporter

2- Verify if the driver is installed :

$ pip install entry_point_inspector --user <user>
$ epi group show oslo.messaging.notify.drivers
  • Output in case of a successful instalation: prometheus_exporter is listed in the Name column and the Error column should be empty.
  • Output in case of an unsuccessful instalation: prometheus_exporter is listed in the Name column and the Error column will have more information.

Configuration

After install the driver you will need to update the ironic.conf and add the following information:

[conductor]
send_sensor_data=true

[oslo_messaging_notifications]
driver = prometheus_exporter
transport_url = fake://
location=/tmp/ironic_prometheus_exporter

Running exporter application

The Flask Application is responsible to merge all the metrics files present in the directory set in [oslo_messaging_notifications]/location.

Note

If you want to deploy in production please check the Flask documentation

To run the Flask Application follow the steps listed below: 1 - open the repository directory :

$ cd ironic-prometheus-exporter/

2- set the FLASK_* environment variables and the location of the ironic.conf file. :

$ export IRONIC_CONFIG=/etc/ironic/ironic.conf
$ export FLASK_APP=ironic_prometheus_exporter/app/exporter.py
$ export FLASK_RUN_HOST=$HOST_IP
$ export FLASK_RUN_PORT=5000

3- run the Flask Application :

$ python -m flask run &

Running under uWSGI

Reproduce the Steps 1 and 2 (You don't need to set FLASK_APP variable) and run the command below: :

$ uwsgi --plugin python --http-socket ${FLASK_RUN_HOST}:${FLASK_RUN_PORT} --module ironic_prometheus_exporter.app.wsgi:application

Contributing