How do you keep secrets out of Alertmanager and collector configs in Git?
BeginnerProductionObservability as Code, Security & Vendor Choices
Answer
Reference secrets from files or Kubernetes Secrets instead of inlining them:
receivers:
- name: slack-critical
slack_configs:
- api_url_file: /etc/alertmanager/secrets/slack-webhook/url
channel: "#incidents"
With the operator, AlertmanagerConfig uses apiURL: { name: slack-webhook, key: url } and alertmanagerSpec.secrets mounts Secrets. The OTel Collector supports ${env:DD_API_KEY} substitution. The Secrets themselves come from External Secrets Operator or Sealed Secrets. A Slack webhook URL in a public repo is abused within hours, so add secret scanning (gitleaks) to the pipeline.
More on Observability as Code, Security & Vendor Choices
What does "observability as code" cover, and why insist on it?BeginnerHow do you manage Grafana with Terraform?IntermediateHow do you validate Alertmanager configuration in CI?BeginnerWhat does a CI pipeline for Prometheus rules look like?IntermediateRaw dashboard JSON, Jsonnet/Grafonnet or the Grafana Foundation SDK: which do you pick?AdvancedWhat are monitoring mixins and how do you consume them?Advanced