Closed Gmerold closed 4 months ago
Thanks for the proposal, @Gmerold!
In the alertmanager charm we have intentionally avoided modeling the configuration file in the charm, and users are currently expected to provide the entire alertmanager configuration using two config option: config_file
and templates_file
.
Taking that information from relation data instead of a config option should not be too difficult, and would be somewhat analogous to the "config-builder" charms we already have, such as scrape-config and scrape-target. The proposed new relation could be another supported method for building alertmanager's configuration.
Some things to consider:
-web.config.file="" [EXPERIMENTAL] Path to configuration file that can enable TLS or authentication.
. Need to think what would be the implications if a cli arg we're already using becomes available as a config file entry as well.WDYT?
Thanks for replying Leon. In general, I agree with all your points.
As for the considerations you've mentioned:
Blocked
and let the operator resolve the conflict. @balbirthomas @rbarry82 thoughts?
Another special case may be worth considering. If Alertmanager exposes a relation interface that allows it to accept its entire configuration file and a set of notification templates is there also a need for conflict resolution or alternatively is only one such relation allowed ? I mean if two client charms are related to Alertmanager using this configuration relation interface that provides a config files, how should Alertmanger handle conflicts in two different configuration files ? More generally how should Alertmanager merge multiple configuration files (and notification templates) ? Note Prometheus charm does not support obtaining entire configuration file over relation data but only a very small subset i.e. "Static Scrape Jobs" and for this subset Prometheus ensures that Job names do not conflict.
I think this is not relevant anymore, so closing; please feel free to reopen it though!
Enhancement Proposal
Hello,
On behalf of the Telco team, I'd like to propose adding an interface similar to Prometheus's prometheus_remote_write, which would allow configuring the Alertmanager through the relation data. Main reason for this change is the fact, that Magma uses an external component, called alertmanager-configurer, to update Alertmanager with the configuration created via Magma NMS (GUI). Additionally, we believe that such change would add to the overall flexibility of the alertmanager-k8s charm.
From the implementation perspective, this would work just like in the Prometheus - consumer of the
remote-write
relation would push the config to the relation data bag and the charm would simply save this config to thealertmanager.yml
file and reload the service.Thanks in advance for looking into this and let the discussion begin.
BR, Bartek