diff options
-rw-r--r-- | inventory/host_vars/ch-mon.yml | 19 | ||||
-rw-r--r-- | inventory/host_vars/ch-testvm-phoebe.yml | 77 | ||||
-rw-r--r-- | roles/monitoring/prometheus/server/defaults/main/main.yml | 5 | ||||
-rw-r--r-- | roles/monitoring/prometheus/server/templates/prometheus.yml.j2 | 6 |
4 files changed, 103 insertions, 4 deletions
diff --git a/inventory/host_vars/ch-mon.yml b/inventory/host_vars/ch-mon.yml index b93dbd05..b03648d0 100644 --- a/inventory/host_vars/ch-mon.yml +++ b/inventory/host_vars/ch-mon.yml @@ -347,3 +347,22 @@ monitoring_landingpage_service_extra_directives: auth_request_set $username $upstream_http_x_username; proxy_set_header X-WEBAUTH-USER $username; proxy_set_header Authorization ""; + + + +prometheus_server_remote_write_destinations: + test-at-home: + url: "http://192.168.32.43/prometheus/api/v1/write" + basic_auth: + username: remote + password_file: /etc/prometheus/prometheus-remote.secret + write_relabel_configs: + - source_labels: ['__name__'] + regex: 'go_gc_.*' + action: 'drop' + - source_labels: ['job'] + regex: 'alertmanager' + action: 'drop' + +prometheus_server_secret_files: + remote: remote diff --git a/inventory/host_vars/ch-testvm-phoebe.yml b/inventory/host_vars/ch-testvm-phoebe.yml index d15e4142..16f849d0 100644 --- a/inventory/host_vars/ch-testvm-phoebe.yml +++ b/inventory/host_vars/ch-testvm-phoebe.yml @@ -39,3 +39,80 @@ network: address: "{{ network_zones.iot.prefix | ansible.utils.ipaddr(network_zones.iot.offsets[inventory_hostname]) }}" ntp_variant: systemd-timesyncd + + +#### +spreadspace_apt_repo_components: + - prometheus + + +prometheus_scrape_endpoint: "{{ network.primary.address | ansible.utils.ipaddr('address') }}:9999" + +prometheus_exporters_extra: [] +prometheus_exporters_default: + - node + +prometheus_exporter_node_version: 1.8.2 + +prometheus_server_version: 2.54.1 +prometheus_alertmanager_version: 0.27.0 + +prometheus_server: ch-testvm-phoebe +prometheus_server_jobs: + - node + +prometheus_zone_name: test@home + + +prometheus_server_storage: + type: lvm + vg: "{{ host_name }}" + lv: prometheus + size: 5G + fs: ext4 + +prometheus_server_external_labels: + environment: test-at-home + monitor: "{{ inventory_hostname }}" + +prometheus_server_alertmanager: + url: "127.0.0.1:9093" + path_prefix: "/alertmanager/" + basic_auth: + username: server + password: server + scrape_instance: "{{ inventory_hostname }}" + +prometheus_server_web_external_url: "http://{{ network.primary.address | ansible.utils.ipaddr('address') }}/prometheus/" + +prometheus_server_auth_users: + server: server + proxy: proxy + remote: remote + +prometheus_server_selfscraping_auth: + username: server + password: server + +prometheus_server_remote_write_receiver: yes + + +prometheus_alertmanager_web_external_url: "http://{{ network.primary.address | ansible.utils.ipaddr('address') }}/alertmanager/" + +prometheus_alertmanager_auth_users: + server: server + proxy: proxy + +prometheus_alertmanager_route: + receiver: empty + +prometheus_alertmanager_receivers: + - name: empty + + +monitoring_landingpage_hostnames: + - "_" +monitoring_landingpage_title: "test@home Monitoring Host" +monitoring_landingpage_services: + - prometheus + - alertmanager diff --git a/roles/monitoring/prometheus/server/defaults/main/main.yml b/roles/monitoring/prometheus/server/defaults/main/main.yml index 61bc4323..dd290e9e 100644 --- a/roles/monitoring/prometheus/server/defaults/main/main.yml +++ b/roles/monitoring/prometheus/server/defaults/main/main.yml @@ -77,8 +77,9 @@ prometheus_server_web_listen_address: 127.0.0.1:9090 prometheus_server_remote_write_receiver: no -# prometheus_server_remote_write_config: -# - url: "https://mon.example.com/prometheus/api/v1/write" +# prometheus_server_remote_write_destinations: +# example: +# url: "https://mon.example.com/prometheus/api/v1/write" # basic_auth: # username: remote # password_file: /etc/prometheus/prometheus-remote.secret diff --git a/roles/monitoring/prometheus/server/templates/prometheus.yml.j2 b/roles/monitoring/prometheus/server/templates/prometheus.yml.j2 index cf21dc80..d72a4815 100644 --- a/roles/monitoring/prometheus/server/templates/prometheus.yml.j2 +++ b/roles/monitoring/prometheus/server/templates/prometheus.yml.j2 @@ -96,8 +96,10 @@ scrape_configs: - targets: ['{{ config.url }}'] {% endfor %} {% endfor %} -{% if prometheus_server_remote_write_config is defined %} +{% if prometheus_server_remote_write_destinations is defined %} remote_write: - {{ prometheus_server_remote_write_config | to_nice_yaml(indent=2) | indent(2) }} +{% for name, config in prometheus_server_remote_write_destinations.items() %} + - {{ config | combine({'name': name }) | to_nice_yaml(indent=2) | indent(4) }} +{% endfor %} {% endif %} |