-
Notifications
You must be signed in to change notification settings - Fork 489
Proposal: mimir.alertmanagerconfigs.kubernetes
component to handle prometheus operator's AlertmanagerConfig
CRD.
#4216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In summary, Prometheus Operator is able to support AlertManagerConfigs only because it is also deploying AlertManager, and has exclusive control over the configs. Agent is not going to be in charge of deploying workloads, and so is not going to have exclusive control of any alertmanager configs from external Alert Managers. I would vote that this CRD is not as good a match as the other Prometheus Operator CRDs we handle (ServiceMonitor, PodMonitor, Probe, and PrometheusRule), and we should not take this on. If anyone more familiar with the alertmanager/mimir codebases or apis has better context or other reasons this would work, I would love to hear them. |
Although, if we want to assume this component has full control over an AlertManager instance, and are ok overwriting everything else, we could make a component that:
That is a possibility, but it strikes me as a bit dangerous, and maybe not how we want to promote people configuring cloud alerting. |
I've actually made an attempt at implementing this but I haven't had the time to finish it. For anybody wanting to take this on feel free to have a look at https://github.com/pluralsh/grafana-agent/tree/alertmanager-configs and take any code that might be useful. |
FYI, this issue is somewhat of a duplicate of grafana/alloy#504. |
@captncraig @rfratto Is this already being worked on or is there a timeline for it? |
Yes, this is a duplicate of grafana/alloy#504. I will close this in favor of that one. We have not committed to implementing this in any particular milestone, but any contribution would be welcome. |
Background
Prometheus Operator introduced the
AlertmanagerConfig
CRD to manage alert manager routes and receivers.We should investigate the posibility of implementing this as a flow component similar to
mimir.rules.kubernetes
Proposal
It is not clear to me immediately if this is a simple task. The goal would be for a user to be able to sync alert manager configs to an local mimir instance or to Grafana Cloud.
What does prometheus operator do with these CRDs?
Prometheus operator deploys an instance of Alertmanager with a fully-manifested config. All relevant AlertManagerConfigs and config secrets are merged together at reconcile time to generate a config. code.
What APIs could we use?
Plain AlertManager does not have any apis for managing routes and things. It only has a reload endpoint. Mimir does have some potentially useful apis.
For
mimir.rules.kubernetes
, we are able to use the standard mimir apis for managing rules. Those apis have granularity to add, update, or delete individual rules, andmimir.rules.kubernetes
uses them to allow you to mix and match manually-added and crd-defined rules.Mimir's alertmanager apis though, only have "get" and "update" endpoints. That makes it much harder to manage routes dynamically. Either:
I really don't love either of those options. With rules, we have unique IDs and granular apis. With alertmanager configs, it feels much harder to replicate the same paradigm Prometheus Operator provides.
The text was updated successfully, but these errors were encountered: