Skip to content

Feature request: override secret censoring during marshaling to YAML #1985

Open
@DuskEagle

Description

@DuskEagle

What did you do?

I am looking for a way to programmatically generate Alertmanager configurations. I imported github.com/prometheus/alertmanager/config into my project and used it to generate an Alertmanager config, which I then marshaled into a YAML string and wrote out to a Kubernetes ConfigMap.

What did you expect to see? What did you see instead?

I expected a working Alertmanager config, but all the API keys for my receivers had been marshaled into the string "<secret>". It would be great if there was a way to override this custom marshaling and get a working Alertmanager config with API keys and other secrets uncensored. They would still need to be censored by default, for places like the Alertmanager UI.

Other approaches

If secrets could be passed into the Alertmanager config using file locations, rather than directly as strings, then there would be no need to override the secret marhsaling behaviour. e.g.

slack_configs:
- api_url: /path/to/api_url

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions