[v9.0.x] Alerting: Adds Mimir to Alertmanager data source implementation (#51109)

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2022-06-20 13:14:09 +02:00
committed by GitHub
co-authored by Gilles De Mey
parent e487bfb460
commit 51344afeaf
4 changed files with 18 additions and 3 deletions
+8
View File
@@ -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",
@@ -8,6 +8,12 @@ import { AlertManagerDataSourceJsonData, AlertManagerImplementation } from './ty
export type Props = DataSourcePluginOptionsEditorProps<AlertManagerDataSourceJsonData>;
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',
@@ -32,7 +38,7 @@ export const ConfigEditor: React.FC<Props> = ({ options, onOptionsChange }) => {
<Select
width={40}
options={IMPL_OPTIONS}
value={options.jsonData.implementation || AlertManagerImplementation.cortex}
value={options.jsonData.implementation || AlertManagerImplementation.mimir}
onChange={(value) =>
onOptionsChange({
...options,
@@ -51,7 +51,7 @@ export class AlertManagerDatasource extends DataSourceApi<AlertManagerQuery, Ale
return {
status: 'error',
message:
'It looks like you have chosen Prometheus implementation, but detected a Cortex endpoint. Please update implementation selection and try again.',
'It looks like you have chosen Prometheus implementation, but detected a Mimir or Cortex endpoint. Please update implementation selection and try again.',
};
}
} catch (e) {}
@@ -65,7 +65,7 @@ export class AlertManagerDatasource extends DataSourceApi<AlertManagerQuery, Ale
return {
status: 'error',
message:
'It looks like you have chosen Cortex implementation, but detected a Prometheus endpoint. Please update implementation selection and try again.',
'It looks like you have chosen a Mimir or Cortex implementation, but detected a Prometheus endpoint. Please update implementation selection and try again.',
};
}
} catch (e) {}
@@ -280,6 +280,7 @@ export interface ExternalAlertmanagerConfig {
export enum AlertManagerImplementation {
cortex = 'cortex',
mimir = 'mimir',
prometheus = 'prometheus',
}