mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Link prometheus and loki datasources to an alertmanager (#39887)
* add config option for alertmanager linking * Add button for silencing a rule * use uid for alertmanager * move alertmanager link to separate function
This commit is contained in:
@@ -4,6 +4,7 @@ import { AlertingSettings, DataSourceHttpSettings } from '@grafana/ui';
|
||||
import { LokiOptions } from '../types';
|
||||
import { MaxLinesField } from './MaxLinesField';
|
||||
import { DerivedFields } from './DerivedFields';
|
||||
import { getAllAlertmanagerDataSources } from 'app/features/alerting/unified/utils/alertmanager';
|
||||
|
||||
export type Props = DataSourcePluginOptionsEditorProps<LokiOptions>;
|
||||
|
||||
@@ -25,6 +26,7 @@ const setDerivedFields = makeJsonUpdater('derivedFields');
|
||||
|
||||
export const ConfigEditor = (props: Props) => {
|
||||
const { options, onOptionsChange } = props;
|
||||
const alertmanagers = getAllAlertmanagerDataSources();
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -35,7 +37,11 @@ export const ConfigEditor = (props: Props) => {
|
||||
onChange={onOptionsChange}
|
||||
/>
|
||||
|
||||
<AlertingSettings<LokiOptions> options={options} onOptionsChange={onOptionsChange} />
|
||||
<AlertingSettings<LokiOptions>
|
||||
alertmanagerDataSources={alertmanagers}
|
||||
options={options}
|
||||
onOptionsChange={onOptionsChange}
|
||||
/>
|
||||
|
||||
<div className="gf-form-group">
|
||||
<div className="gf-form-inline">
|
||||
|
||||
@@ -38,6 +38,7 @@ export interface LokiQuery extends DataQuery {
|
||||
export interface LokiOptions extends DataSourceJsonData {
|
||||
maxLines?: string;
|
||||
derivedFields?: DerivedFieldConfig[];
|
||||
alertmanager?: string;
|
||||
}
|
||||
|
||||
export interface LokiStats {
|
||||
|
||||
Reference in New Issue
Block a user