Merge "Configure Prometheus Pushgateway Options"

This commit is contained in:
Zuul 2022-04-21 16:37:33 +00:00 committed by Gerrit Code Review
commit 489d6bb3b1
3 changed files with 35 additions and 1 deletions

View File

@ -192,3 +192,9 @@ ceilometer_upgrade_params: ""
####################
ceilometer_prometheus_pushgateway_host: "127.0.0.1"
ceilometer_prometheus_pushgateway_port: "9091"
## Options
ceilometer_prometheus_pushgateway_options:
# timeout: 180
# max_retries: 5
# batch: no
# verify_ssl: no

View File

@ -12,5 +12,5 @@ sinks:
- gnocchi://
{% endif %}
{% if enable_ceilometer_prometheus_pushgateway | bool %}
- prometheus://{{ ceilometer_prometheus_pushgateway_host }}:{{ ceilometer_prometheus_pushgateway_port }}/metrics/job/openstack-telemetry
- prometheus://{{ ceilometer_prometheus_pushgateway_host }}:{{ ceilometer_prometheus_pushgateway_port }}/metrics/job/openstack-telemetry{% if ceilometer_prometheus_pushgateway_options %}/?{{ (ceilometer_prometheus_pushgateway_options|dict2items|rejectattr("value", "equalto", None)|list|items2dict).items() | map("join", "=") | join("&")}}{% endif %}
{% endif %}

View File

@ -0,0 +1,28 @@
---
features:
- |
Adds ability to configure the Prometheus pushgateway options of its URL.
Adds a new variable ``ceilometer_prometheus_pushgateway_options``. This is
a dictionary whose keys are the options to be set and its values contain
what to set them to.
These options and respective values are then added to the pushgateway's
URL, checking that no "None" value is being set.
For example, the following configurations:
.. code-block:: yaml
ceilometer_prometheus_pushgateway_host: "127.0.0.1"
ceilometer_prometheus_pushgateway_port: "9091"
ceilometer_prometheus_pushgateway_options:
timeout: 180
max_retries:
verify_ssl: yes
Result in the following URL:
``prometheus://127.0.0.1:9091/ \
metrics/job/openstack-telemetry/?timeout=180&verify_ssl=True``
`LP#1968597 <https://bugs.launchpad.net/kolla-ansible/+bug/1968597>`__