diff --git a/roles/alloy/README.md b/roles/alloy/README.md index dc151442..a3c8e558 100644 --- a/roles/alloy/README.md +++ b/roles/alloy/README.md @@ -9,11 +9,11 @@ Should work on Debian-based distributions. ## Required Arguments -- `alloy_config_default`: The default Alloy configuration. Recommended for configuration that hosts of a groupe share. +- `alloy_config_default`: The default Alloy configuration. Recomanded for configuration that hosts of a groupe share. ## Optional Arguments -- `alloy_config_additional`: Additional Alloy configuration appended to the default config. Recommended for per host configuration +- `alloy_config_additional`: Additional Alloy configuration appended to the default config. Recomanded for per host configuration - `alloy_cap_net_bind_service`: Grant Alloy the `CAP_NET_BIND_SERVICE` capability, allowing it to bind to privileged ports (<1024). ### Blackbox Exporter diff --git a/roles/alloy/defaults/main.yaml b/roles/alloy/defaults/main.yaml index a544ab7e..e98d555b 100644 --- a/roles/alloy/defaults/main.yaml +++ b/roles/alloy/defaults/main.yaml @@ -1,7 +1,49 @@ --- alloy_cap_net_bind_service: false -alloy_config_default: "" +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: "" alloy_blackbox_exporter_config_default: |