Closed JohnyKnoxVeel closed 4 years ago
It looks like the script does not find the environments and therefore gives an error
You're not providing the OS_* variables in the environment to the systemd unit you are running, and without OpenStack credentials, the exporter is not much use.
prometheus-openstack-exporter.service - prometheus-openstack-exporter Loaded: loaded (/etc/systemd/system/prometheus-openstack-exporter.service; enabled; vendor preset: disabled) Active: active (running) since Sat 2019-10-05 12:20:34 PST; 4s ago Main PID: 18478 (python) Tasks: 2 Memory: 44.4M CGroup: /system.slice/prometheus-openstack-exporter.service └─18478 python /usr/local/bin/prometheus-openstack-exporter
Oct 05 12:20:35 localhost.localdomain sh[18478]: Error getting stats: Traceback (most recent call last): Oct 05 12:20:35 localhost.localdomain sh[18478]: File "/usr/local/bin/prometheus-openstack-exporter", line 145, in run Oct 05 12:20:35 localhost.localdomain sh[18478]: keystone, nova, neutron, cinder = get_clients() Oct 05 12:20:35 localhost.localdomain sh[18478]: File "/usr/local/bin/prometheus-openstack-exporter", line 80, in get_clients Oct 05 12:20:35 localhost.localdomain sh[18478]: "auth_url") Oct 05 12:20:35 localhost.localdomain sh[18478]: File "/usr/local/bin/prometheus-openstack-exporter", line 60, in get_credslist Oct 05 12:20:35 localhost.localdomain sh[18478]: return [env['OS%s' % name.upper()] for name in names] Oct 05 12:20:35 localhost.localdomain sh[18478]: File "/usr/lib64/python2.7/UserDict.py", line 23, in getitem Oct 05 12:20:35 localhost.localdomain sh[18478]: raise KeyError(key) Oct 05 12:20:35 localhost.localdomain sh[18478]: KeyError: 'OS_USERNAME'