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
995dbb06e2
commit
c7d51af5b4
12 changed files with 69 additions and 205 deletions
|
|
@ -53,16 +53,7 @@ nginx__configurations:
|
|||
- name: metrics.hamburg.ccc.de
|
||||
content: "{{ lookup('ansible.builtin.file', 'resources/chaosknoten/grafana/nginx/metrics.hamburg.ccc.de.conf') }}"
|
||||
|
||||
alloy_config: |
|
||||
prometheus.remote_write "default" {
|
||||
endpoint {
|
||||
url = "https://metrics.hamburg.ccc.de/api/v1/write"
|
||||
basic_auth {
|
||||
username = "chaos"
|
||||
password = "{{ secret__metrics_chaos }}"
|
||||
}
|
||||
}
|
||||
}
|
||||
alloy_config_additional: |
|
||||
loki.write "default" {
|
||||
endpoint {
|
||||
url = "https://loki.hamburg.ccc.de/loki/api/v1/push"
|
||||
|
|
@ -98,9 +89,9 @@ alloy_config: |
|
|||
}
|
||||
rule {
|
||||
source_labels = ["__journal__hostname"]
|
||||
target_label = "host"
|
||||
target_label = "instance"
|
||||
regex = "([^:]+)"
|
||||
replacement = "${1}.hamburg.ccc.de"
|
||||
replacement = "${1}.hosts.hamburg.ccc.de"
|
||||
action = "replace"
|
||||
}
|
||||
}
|
||||
|
|
@ -111,30 +102,3 @@ alloy_config: |
|
|||
format_as_json = true
|
||||
labels = {component = "loki.source.journal", org = "ccchh"}
|
||||
}
|
||||
|
||||
logging {
|
||||
level = "info"
|
||||
}
|
||||
prometheus.exporter.unix "local_system" {
|
||||
enable_collectors = ["systemd"]
|
||||
}
|
||||
|
||||
prometheus.relabel "default" {
|
||||
forward_to = [prometheus.remote_write.default.receiver]
|
||||
rule {
|
||||
target_label = "org"
|
||||
replacement = "ccchh"
|
||||
}
|
||||
rule {
|
||||
source_labels = ["instance"]
|
||||
target_label = "host"
|
||||
regex = "([^:]+)"
|
||||
replacement = "${1}.hamburg.ccc.de"
|
||||
action = "replace"
|
||||
}
|
||||
}
|
||||
|
||||
prometheus.scrape "scrape_metrics" {
|
||||
targets = prometheus.exporter.unix.local_system.targets
|
||||
forward_to = [prometheus.relabel.default.receiver]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue