mirror of
https://github.com/RWejlgaard/pez-infra.git
synced 2026-11-01 03:21:02 +00:00
copenhagen-a came back from its Proxmox repave with no Alloy at all, so it's been unmonitored since. Nothing in this repo installs Alloy — every host got it from Grafana's onboarding one-liner, and the common role only bolted on a resilience drop-in if the unit already happened to exist. A rebuild silently loses monitoring. New alloy role owns the whole thing: the Grafana apt repo, the package, the config, the credentials drop-in and the resilience override. Runs on every host, so this can't happen again on the next repave. Moved the resilience drop-in out of common into the role that owns Alloy. The rendered config is byte-identical to what's on the hosts today apart from the managed-by header, so the only effect on the healthy hosts is one restart.
35 lines
755 B
Django/Jinja
35 lines
755 B
Django/Jinja
// Managed by Ansible (pez-infra) — alloy role.
|
|
|
|
remotecfg {
|
|
url = "{{ alloy_fleet_management_url }}"
|
|
id = "{{ alloy_collector_id }}"
|
|
poll_frequency = "60s"
|
|
attributes = encoding.from_json(coalesce(``, `{}`))
|
|
|
|
basic_auth {
|
|
username = "{{ alloy_fleet_management_username }}"
|
|
password = sys.env("GCLOUD_RW_API_KEY")
|
|
}
|
|
}
|
|
|
|
prometheus.remote_write "metrics_service" {
|
|
endpoint {
|
|
url = "{{ alloy_prometheus_url }}"
|
|
|
|
basic_auth {
|
|
username = "{{ alloy_prometheus_username }}"
|
|
password = sys.env("GCLOUD_RW_API_KEY")
|
|
}
|
|
}
|
|
}
|
|
|
|
loki.write "grafana_cloud_loki" {
|
|
endpoint {
|
|
url = "{{ alloy_loki_url }}"
|
|
|
|
basic_auth {
|
|
username = "{{ alloy_loki_username }}"
|
|
password = sys.env("GCLOUD_RW_API_KEY")
|
|
}
|
|
}
|
|
}
|