mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Adds Mimir to Alertmanager data source implementation (#50943)
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -10,6 +10,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',
|
||||
@@ -36,7 +42,7 @@ export const ConfigEditor = (props: Props) => {
|
||||
<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',
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user