Alerting: Filter rules list (#32818)

This commit is contained in:
Nathan Rodman
2021-04-15 04:53:40 -07:00
committed by GitHub
parent ffe90b7abf
commit 345d9f93fe
12 changed files with 312 additions and 17 deletions

View File

@ -24,6 +24,7 @@ export interface DataSourcePickerProps {
mixed?: boolean;
dashboard?: boolean;
metrics?: boolean;
type?: string | string[];
annotations?: boolean;
variables?: boolean;
alerting?: boolean;
@ -108,9 +109,10 @@ export class DataSourcePicker extends PureComponent<DataSourcePickerProps, DataS
}
getDataSourceOptions() {
const { tracing, metrics, mixed, dashboard, variables, annotations, pluginId, alerting, filter } = this.props;
const { alerting, tracing, metrics, mixed, dashboard, variables, annotations, pluginId, type, filter } = this.props;
const options = this.dataSourceSrv
.getList({
alerting,
tracing,
metrics,
dashboard,
@ -118,8 +120,8 @@ export class DataSourcePicker extends PureComponent<DataSourcePickerProps, DataS
variables,
annotations,
pluginId,
alerting,
filter,
type,
})
.map((ds) => ({
value: ds.name,

View File

@ -60,6 +60,9 @@ export interface GetDataSourceListFilters {
/** apply a function to filter */
filter?: (dataSource: DataSourceInstanceSettings) => boolean;
/** Only returns datasources matching the specified types (ie. Loki, Prometheus) */
type?: string | string[];
}
let singletonInstance: DataSourceSrv;