Prometheus: Type and flavor configuration (#56496)

* Adding two new fields to the data JSON in the prometheus datasource configuration: prometheusType, and prometheusVersion.
* Version field will attempt to auto-detect via buildinfo API when prometheus Type is selected
This commit is contained in:
Galen Kistler
2022-10-24 09:26:32 -05:00
committed by GitHub
parent 8d0e24a622
commit 7ecbc98b3e
21 changed files with 383 additions and 75 deletions

View File

@@ -19,7 +19,7 @@ import { DataSourcePluginCategory, ThunkDispatch, ThunkResult } from 'app/types'
import * as api from '../api';
import { DATASOURCES_ROUTES } from '../constants';
import { trackDataSourceCreated, trackDataSourceTested } from '../tracking';
import { nameExits, findNewName } from '../utils';
import { findNewName, nameExits } from '../utils';
import { buildCategories } from './buildCategories';
import { buildNavModel } from './navModel';
@@ -231,8 +231,8 @@ export function loadDataSourcePlugins(): ThunkResult<void> {
};
}
export function updateDataSource(dataSource: DataSourceSettings): ThunkResult<void> {
return async (dispatch) => {
export function updateDataSource(dataSource: DataSourceSettings) {
return async (dispatch: (dataSourceSettings: ThunkResult<Promise<DataSourceSettings>>) => DataSourceSettings) => {
await api.updateDataSource(dataSource);
await getDatasourceSrv().reload();
return dispatch(loadDataSource(dataSource.uid));