Skip to content
Snippets Groups Projects
Verified Commit ce30873c authored by Thorben Günther's avatar Thorben Günther
Browse files

prometheus: Enable remote_write API

This is needed for receiving gitlab metrics.
parent f8dd682d
No related branches found
No related tags found
No related merge requests found
Pipeline #9465 passed
---
filesystem: btrfs
ipv4_address: 95.217.220.31
prometheus_domain: monitoring.archlinux.org
......@@ -3,6 +3,7 @@ gitlab_runner_exporter_port: '9252'
prometheus_domain: dashboards.archlinux.org
prometheus_mysqld_exporter_port: '9104'
prometheus_receive_only: false
dashboards_domain: dashboards.archlinux.org
# for d in $(curl -sf "https://crt.sh/?q=archlinux.org&output=json" "https://crt.sh/?q=pkgbuild.com&output=json" | jq -r ".[].name_value" | sort -u); do if curl -o /dev/null -sS "https://$d"; then echo $d; fi; done | grep -v "\@" | sort | sed "s/^/ - https:\/\//"
blackbox_targets:
......
......@@ -5,14 +5,12 @@
- name: install cert renewal hook
template: src=letsencrypt.hook.d.j2 dest=/etc/letsencrypt/renewal-hooks/deploy/prometheus owner=root group=root mode=0755
when: prometheus_receive_only
- name: create ssl cert
include_role:
name: certificate
vars:
domains: ["{{ prometheus_domain }}"]
when: prometheus_receive_only
- name: install prometheus configuration
template: src=prometheus.yml.j2 dest=/etc/prometheus/prometheus.yml owner=root group=prometheus mode=640
......@@ -25,7 +23,6 @@
- name: install prometheus web-config configuration
template: src=web-config.yml.j2 dest=/etc/prometheus/web-config.yml owner=root group=prometheus mode=640
notify: reload prometheus
when: prometheus_receive_only
- name: install prometheus alert configuration
copy: src=node.rules.yml dest=/etc/prometheus/node.rules.yml owner=root group=root mode=644
......@@ -37,6 +34,6 @@
- name: open firewall holes for prometheus
ansible.posix.firewalld: service=prometheus permanent=true state=enabled immediate=yes
when: configure_firewall and prometheus_receive_only
when: configure_firewall
tags:
- firewall
{% if prometheus_receive_only %}
PROMETHEUS_ARGS="--storage.tsdb.retention.time=365d --enable-feature=remote-write-receiver --web.config.file=/etc/prometheus/web-config.yml"
{% else %}
PROMETHEUS_ARGS="--storage.tsdb.retention.time=365d"
{% endif %}
......@@ -14,7 +14,7 @@ alerting:
- localhost:9093
remote_write:
- url: https://{{ prometheus_domain }}:9090/api/v1/write
- url: https://{{ dashboards_domain }}:9090/api/v1/write
write_relabel_configs:
- source_labels: [__name__]
regex: "archive_directory_size_bytes|archive_total_packages|rebuilderd_results|rebuilderd_workers|rebuilderd_queue_length|repository_directory_size_bytes|aur_.+"
......@@ -36,10 +36,10 @@ scrape_configs:
username: {{ vault_prometheus_user }}
password: {{ vault_prometheus_passwd }}
static_configs:
- targets: ['{{ prometheus_domain }}:9090']
- targets: ['{{ dashboards_domain }}:9090']
labels:
job: prometheus
instance: "{{ prometheus_domain }}"
instance: "{{ dashboards_domain }}"
- job_name: loki
static_configs:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment