Merge "make "external_labels" optional on prometheus.yml"

This commit is contained in:
Zuul 2022-07-21 13:26:04 +00:00 committed by Gerrit Code Review
commit db271bebad
4 changed files with 25 additions and 1 deletions

View File

@ -109,6 +109,12 @@ prometheus_services:
volumes: "{{ prometheus_libvirt_exporter_default_volumes + prometheus_libvirt_exporter_extra_volumes }}"
dimensions: "{{ prometheus_libvirt_exporter_dimensions }}"
####################
# Prometheus Server
####################
prometheus_external_labels:
# <labelname>: <labelvalue>
####################
# Database
####################

View File

@ -2,8 +2,12 @@ global:
scrape_interval: {{ prometheus_scrape_interval }}
scrape_timeout: 10s
evaluation_interval: 15s
{% if prometheus_external_labels %}
external_labels:
monitor: 'kolla'
{% for label, value in prometheus_external_labels.items() %}
{{ label }}: {{ value }}
{% endfor %}
{% endif %}
{% if prometheus_alert_rules.files is defined and prometheus_alert_rules.files | length > 0 %}
rule_files:

View File

@ -709,6 +709,12 @@ workaround_ansible_issue_8743: yes
#enable_prometheus_libvirt_exporter: "{{ enable_prometheus | bool and enable_nova | bool and nova_compute_virt_type in ['kvm', 'qemu'] }}"
#enable_prometheus_etcd_integration: "{{ enable_prometheus | bool and enable_etcd | bool }}"
# The labels to add to any time series or alerts when communicating with external systems (federation, remote storage, Alertmanager).
# prometheus_external_labels:
# <labelname>: <labelvalue>
# By default, prometheus_external_labels is empty
#prometheus_external_labels:
# List of extra parameters passed to prometheus. You can add as many to the list.
#prometheus_cmdline_extras:

View File

@ -0,0 +1,8 @@
---
fixes:
- |
Fixes `monitor: kolla` be added in `external_labels` by default.
Prometheus default config should not include environment-specific
details. In this patch, modify `external_labels` be optional, we
can add any `<labelname>: <labelvalue>` in `external_labels`.
`LP#1944699 <https://bugs.launchpad.net/kolla-ansible/+bug/1944699>`__