prometheus-openstack-exporter config service filtering

This change disables services in the Prometheus openstack-exporter
if they are not enabled in the deployment. Such behaviour allows
to avoid warnings and errors in the log files and keep the
log file contents clean and informative.

Change-Id: I4dcac976620a5f451e3d273183199aefe400994a
This commit is contained in:
Justinas Balciunas 2020-07-27 13:29:42 +00:00
parent 21f5a02604
commit 9fc98be11a
2 changed files with 7 additions and 1 deletions

View File

@ -244,3 +244,9 @@ prometheus_alertmanager_extra_volumes: "{{ prometheus_extra_volumes }}"
prometheus_openstack_exporter_extra_volumes: "{{ prometheus_extra_volumes }}"
prometheus_elasticsearch_exporter_extra_volumes: "{{ prometheus_extra_volumes }}"
prometheus_blackbox_exporter_extra_volumes: "{{ prometheus_extra_volumes }}"
prometheus_openstack_exporter_disabled_volume: "{{ '--disable-service.volume' if not enable_cinder | bool else '' }}"
prometheus_openstack_exporter_disabled_dns: "{{ '--disable-service.dns' if not enable_designate | bool else '' }}"
prometheus_openstack_exporter_disabled_object: "{{ '--disable-service.object-store' if not enable_swift | bool else '' }}"
prometheus_openstack_exporter_disabled_lb: "{{ '--disable-service.load-balancer --disable-metric=neutron-loadbalancers --disable-metric=neutron-loadbalancers_not_active' if not enable_octavia | bool else '' }}"
prometheus_openstack_exporter_disabled_items: "{{ [prometheus_openstack_exporter_disabled_volume, prometheus_openstack_exporter_disabled_dns, prometheus_openstack_exporter_disabled_object, prometheus_openstack_exporter_disabled_lb|trim]|join(' ')|trim }}"

View File

@ -1,5 +1,5 @@
{
"command": "/opt/openstack-exporter/openstack-exporter --endpoint-type={{ prometheus_openstack_exporter_endpoint_type }} --os-client-config=/etc/openstack/clouds.yml --web.listen-address={{ api_interface_address | put_address_in_context('url') }}:{{ prometheus_openstack_exporter_port }} default",
"command": "/opt/openstack-exporter/openstack-exporter --endpoint-type={{ prometheus_openstack_exporter_endpoint_type }} --os-client-config=/etc/openstack/clouds.yml --web.listen-address={{ api_interface_address | put_address_in_context('url') }}:{{ prometheus_openstack_exporter_port }} default {{ prometheus_openstack_exporter_disabled_items }}",
"config_files": [
{
"source": "{{ container_config_directory }}/clouds.yml",