Search code examples
prometheus-alertmanager

Storing passwords in a separate file in Alertmanager


I have an Alertmanager setup that I want to commit to a repository to share publicly, so others can re-use it.

However, in Alertmanager config I have my tokens and passwords, which I do not want to make public.

Is there a way to set up an Alertmanager config in a way the passwords would be stored in another file or files set (which would be put under .gitignore), so Alertmanager would load them from these files?


Solution

  • Alertmanager doesn't support environment variables or configuration substitution itself.

    The best you can do is to store in repository configuration file with placeholders, and substitue them before applying changes from repository to your deployment.

    If you plan on using CI/CD for applying changes from git, most of the servers have ready functionality to substitute placeholders with predefined values or values from secret store, like Vault.