Przeglądaj źródła

Rename some variables

pull/838/head
Slavi Pantaleev 5 lat temu
rodzic
commit
18e31526a8
4 zmienionych plików z 11 dodań i 5 usunięć
  1. +2
    -0
      group_vars/matrix_servers
  2. +5
    -1
      roles/matrix-prometheus/defaults/main.yml
  3. +2
    -2
      roles/matrix-prometheus/tasks/setup.yml
  4. +2
    -2
      roles/matrix-prometheus/templates/prometheus.yml.j2

+ 2
- 0
group_vars/matrix_servers Wyświetl plik

@@ -1405,6 +1405,8 @@ matrix_prometheus_enabled: false
# Prometheus' HTTP port to the local host.
matrix_prometheus_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:9090' }}"

matrix_prometheus_scraper_node_enabled: "{{ matrix_prometheus_node_exporter_enabled }}"

######################################################################
#
# /matrix-prometheus


+ 5
- 1
roles/matrix-prometheus/defaults/main.yml Wyświetl plik

@@ -26,9 +26,13 @@ matrix_prometheus_systemd_wanted_services_list: []
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:9090"), or empty string to not expose.
matrix_prometheus_container_http_host_bind_port: ''

# Tells whether the "node" scraper configuration is enabled.
# This configuration aims to scrape the current node (this server).
matrix_prometheus_scraper_node_enabled: false

# Target addresses for the "node" scraper configuration.
# Unless you define this as a non-empty list, it gets populated at runtime with the IP address of `matrix-prometheus-node-exporter` and port 9100.
matrix_prometheus_endpoint_node_targets: []
matrix_prometheus_scraper_node_targets: []

# Default prometheus configuration template which covers the generic use case.
# You can customize it by controlling the various variables inside it.


+ 2
- 2
roles/matrix-prometheus/tasks/setup.yml Wyświetl plik

@@ -37,8 +37,8 @@
register: matrix_docker_network_info

- set_fact:
matrix_prometheus_endpoint_node_targets: ["{{ matrix_docker_network_info.network.IPAM.Config[0].Gateway }}:9100"]
when: "matrix_prometheus_enabled|bool and matrix_prometheus_node_exporter_enabled|bool and matrix_prometheus_endpoint_node_targets|length == 0"
matrix_prometheus_scraper_node_targets: ["{{ matrix_docker_network_info.network.IPAM.Config[0].Gateway }}:9100"]
when: "matrix_prometheus_enabled|bool and matrix_prometheus_scraper_node_enabled|bool and matrix_prometheus_scraper_node_targets|length == 0"

- name: Ensure prometheus.yml installed
copy:


+ 2
- 2
roles/matrix-prometheus/templates/prometheus.yml.j2 Wyświetl plik

@@ -33,8 +33,8 @@ scrape_configs:
- targets: ['matrix-synapse:{{ matrix_synapse_metrics_port }}']
{% endif %}

{% if matrix_prometheus_node_exporter_enabled %}
{% if matrix_prometheus_scraper_node_enabled %}
- job_name: node
static_configs:
- targets: {{ matrix_prometheus_endpoint_node_targets|to_json }}
- targets: {{ matrix_prometheus_scraper_node_targets|to_json }}
{% endif %}

Ładowanie…
Anuluj
Zapisz