From 81a5436c1ec102ec93e8c3eb635e95e86ce626c6 Mon Sep 17 00:00:00 2001 From: Gilles De Mey Date: Mon, 20 Jun 2022 12:56:38 +0200 Subject: [PATCH] Alerting: Adds Mimir to Alertmanager data source implementation (#50943) --- pkg/services/ngalert/api/lotex_am.go | 8 ++++++++ .../app/plugins/datasource/alertmanager/ConfigEditor.tsx | 8 +++++++- public/app/plugins/datasource/alertmanager/DataSource.ts | 4 ++-- public/app/plugins/datasource/alertmanager/types.ts | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/pkg/services/ngalert/api/lotex_am.go b/pkg/services/ngalert/api/lotex_am.go index d78eb536ba5..f1bff2af68f 100644 --- a/pkg/services/ngalert/api/lotex_am.go +++ b/pkg/services/ngalert/api/lotex_am.go @@ -25,6 +25,14 @@ var endpoints = map[string]map[string]string{ "alerts": "/alertmanager/api/v2/alerts", "config": "/api/v1/alerts", }, + "mimir": { + "silences": "/alertmanager/api/v2/silences", + "silence": "/alertmanager/api/v2/silence/%s", + "status": "/alertmanager/api/v2/status", + "groups": "/alertmanager/api/v2/alerts/groups", + "alerts": "/alertmanager/api/v2/alerts", + "config": "/api/v1/alerts", + }, "prometheus": { "silences": "/api/v2/silences", "silence": "/api/v2/silence/%s", diff --git a/public/app/plugins/datasource/alertmanager/ConfigEditor.tsx b/public/app/plugins/datasource/alertmanager/ConfigEditor.tsx index 27598728a28..6458553f338 100644 --- a/public/app/plugins/datasource/alertmanager/ConfigEditor.tsx +++ b/public/app/plugins/datasource/alertmanager/ConfigEditor.tsx @@ -10,6 +10,12 @@ import { AlertManagerDataSourceJsonData, AlertManagerImplementation } from './ty export type Props = DataSourcePluginOptionsEditorProps; const IMPL_OPTIONS: SelectableValue[] = [ + { + value: AlertManagerImplementation.mimir, + icon: 'public/img/alerting/mimir_logo.svg', + label: 'Mimir', + description: `https://grafana.com/oss/mimir/. An open source, horizontally scalable, highly available, multi-tenant, long-term storage for Prometheus.`, + }, { value: AlertManagerImplementation.cortex, label: 'Cortex', @@ -36,7 +42,7 @@ export const ConfigEditor = (props: Props) => {