rollout Alloy to replace prometheus_node_exporter
With the new network we need to deploy a push based solution in order to get metrics into prometheus
This commit is contained in:
parent
29af58ff94
commit
10388c8333
12 changed files with 69 additions and 205 deletions
44
roles/alloy/defaults/main.yaml
Normal file
44
roles/alloy/defaults/main.yaml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
alloy_config_default: |
|
||||
prometheus.remote_write "default" {
|
||||
endpoint {
|
||||
url = "https://metrics.hamburg.ccc.de/api/v1/write"
|
||||
basic_auth {
|
||||
username = "chaos"
|
||||
password = "{{ metrics__chaos_password }}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
prometheus.relabel "chaosknoten_common" {
|
||||
forward_to = [prometheus.remote_write.default.receiver]
|
||||
rule {
|
||||
target_label = "org"
|
||||
replacement = "ccchh"
|
||||
}
|
||||
rule {
|
||||
target_label = "site"
|
||||
replacement = "wieske"
|
||||
}
|
||||
rule {
|
||||
source_labels = ["instance"]
|
||||
target_label = "instance"
|
||||
regex = "([^:]+)"
|
||||
replacement = "${1}.hosts.hamburg.ccc.de"
|
||||
action = "replace"
|
||||
}
|
||||
}
|
||||
|
||||
logging {
|
||||
level = "info"
|
||||
}
|
||||
|
||||
prometheus.exporter.unix "local_system" {
|
||||
enable_collectors = ["systemd"]
|
||||
}
|
||||
|
||||
prometheus.scrape "scrape_metrics" {
|
||||
targets = prometheus.exporter.unix.local_system.targets
|
||||
forward_to = [prometheus.relabel.chaosknoten_common.receiver]
|
||||
}
|
||||
|
||||
alloy_config_additional: ""
|
||||
|
|
@ -45,4 +45,6 @@
|
|||
- name: Setup Alloy
|
||||
ansible.builtin.import_role:
|
||||
name: grafana.grafana.alloy
|
||||
vars:
|
||||
alloy_config: "{{ alloy_config_default ~ alloy_config_additional }}"
|
||||
become: true
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
dependencies:
|
||||
- role: distribution_check
|
||||
vars:
|
||||
distribution_check__distribution_support_spec:
|
||||
- name: Debian
|
||||
major_versions:
|
||||
- "11"
|
||||
- "12"
|
||||
- "13"
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
- name: make sure the `prometheus-node-exporter` package is installed
|
||||
ansible.builtin.apt:
|
||||
name: prometheus-node-exporter
|
||||
state: present
|
||||
allow_change_held_packages: true
|
||||
update_cache: true
|
||||
become: true
|
||||
|
||||
- name: make sure `prometheus-node-exporter.service` is started and ansibled
|
||||
ansible.builtin.systemd:
|
||||
name: prometheus-node-exporter.service
|
||||
state: started
|
||||
enabled: true
|
||||
become: true
|
||||
Loading…
Add table
Add a link
Reference in a new issue