The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/public/app/features/alerting/unified/utils/settings.ts

18 lines
852 B

import { AlertmanagerChoice, GrafanaAlertingConfiguration } from 'app/plugins/datasource/alertmanager/types';
// if we have either "internal" or "both" configured this means the internal Alertmanager is receiving Grafana-managed alerts
export const isInternalAlertmanagerInterestedInAlerts = (config?: GrafanaAlertingConfiguration): boolean => {
if (!config) {
// The backend doesn't have a configuration record in a new Grafana instance until the user has interacted with the configuration page.
// For that reason, in case of no configuration, we assume that the internal Alertmanager is interested in alerts.
return true;
}
switch (config.alertmanagersChoice) {
case AlertmanagerChoice.Internal:
case AlertmanagerChoice.All:
return true;
case AlertmanagerChoice.External:
default:
return false;
}
};