mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Revert "Prometheus: Add Victoria metrics to Prometheus type dropdown in datasource config" (#67150)
Revert "Prometheus: Add Victoria metrics to Prometheus type dropdown in datasource config (#66984)"
This reverts commit 7cb4d65584.
This commit is contained in:
@@ -77,15 +77,4 @@ export const PromFlavorVersions: { [index: string]: Array<{ value?: string; labe
|
||||
{ value: '1.13.0', label: '1.13.x' },
|
||||
{ value: '1.14.0', label: '> 1.13.x' },
|
||||
],
|
||||
VictoriaMetrics: [
|
||||
{ value: '1.23.0', label: '< 1.24.0' },
|
||||
{ value: '1.24.0', label: '>= 1.24.x' },
|
||||
{ value: '1.30.0', label: '1.3x' },
|
||||
{ value: '1.40.0', label: '1.4x' },
|
||||
{ value: '1.50.0', label: '1.5x' },
|
||||
{ value: '1.60.0', label: '1.6x' },
|
||||
{ value: '1.70.0', label: '1.7x' },
|
||||
{ value: '1.80.0', label: '1.8x' },
|
||||
{ value: '1.90.0', label: '>= 1.9x' },
|
||||
],
|
||||
};
|
||||
|
||||
@@ -56,7 +56,6 @@ const prometheusFlavorSelectItems: PrometheusSelectItemsType = [
|
||||
{ value: PromApplication.Cortex, label: PromApplication.Cortex },
|
||||
{ value: PromApplication.Mimir, label: PromApplication.Mimir },
|
||||
{ value: PromApplication.Thanos, label: PromApplication.Thanos },
|
||||
{ value: PromApplication.VictoriaMetrics, label: PromApplication.VictoriaMetrics },
|
||||
];
|
||||
|
||||
type Props = Pick<DataSourcePluginOptionsEditorProps<PromOptions>, 'options' | 'onOptionsChange'>;
|
||||
@@ -119,37 +118,32 @@ const setPrometheusVersion = (
|
||||
// This will save the current state of the form, as the url is needed for this API call to function
|
||||
onUpdate(options)
|
||||
.then((updatedOptions) => {
|
||||
// Not seeing version info in buildinfo response from VictoriaMetrics, and Cortex doesn't support yet, users will need to manually select version
|
||||
if (
|
||||
updatedOptions.jsonData.prometheusType !== PromApplication.VictoriaMetrics &&
|
||||
updatedOptions.jsonData.prometheusType !== PromApplication.Cortex
|
||||
) {
|
||||
getBackendSrv()
|
||||
.get(`/api/datasources/uid/${updatedOptions.uid}/resources/version-detect`)
|
||||
.then((rawResponse: PromBuildInfoResponse) => {
|
||||
const rawVersionStringFromApi = rawResponse.data?.version ?? '';
|
||||
if (rawVersionStringFromApi && semver.valid(rawVersionStringFromApi)) {
|
||||
const parsedVersion = getVersionString(rawVersionStringFromApi, updatedOptions.jsonData.prometheusType);
|
||||
// If we got a successful response, let's update the backend with the version right away if it's new
|
||||
if (parsedVersion) {
|
||||
onUpdate({
|
||||
...updatedOptions,
|
||||
jsonData: {
|
||||
...updatedOptions.jsonData,
|
||||
prometheusVersion: parsedVersion,
|
||||
},
|
||||
}).then((updatedUpdatedOptions) => {
|
||||
onOptionsChange(updatedUpdatedOptions);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
unableToDeterminePrometheusVersion();
|
||||
getBackendSrv()
|
||||
.get(`/api/datasources/uid/${updatedOptions.uid}/resources/version-detect`)
|
||||
.then((rawResponse: PromBuildInfoResponse) => {
|
||||
const rawVersionStringFromApi = rawResponse.data?.version ?? '';
|
||||
if (rawVersionStringFromApi && semver.valid(rawVersionStringFromApi)) {
|
||||
const parsedVersion = getVersionString(rawVersionStringFromApi, updatedOptions.jsonData.prometheusType);
|
||||
// If we got a successful response, let's update the backend with the version right away if it's new
|
||||
if (parsedVersion) {
|
||||
onUpdate({
|
||||
...updatedOptions,
|
||||
jsonData: {
|
||||
...updatedOptions.jsonData,
|
||||
prometheusVersion: parsedVersion,
|
||||
},
|
||||
}).then((updatedUpdatedOptions) => {
|
||||
onOptionsChange(updatedUpdatedOptions);
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(unableToDeterminePrometheusVersion);
|
||||
}
|
||||
} else {
|
||||
unableToDeterminePrometheusVersion();
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(unableToDeterminePrometheusVersion);
|
||||
.catch((error) => {
|
||||
unableToDeterminePrometheusVersion(error);
|
||||
});
|
||||
};
|
||||
|
||||
export const PromSettings = (props: Props) => {
|
||||
|
||||
@@ -173,8 +173,6 @@ export class PrometheusDatasource
|
||||
this._isDatasourceVersionGreaterOrEqualTo('2.0.0', PromApplication.Mimir) ||
|
||||
// https://github.com/cortexproject/cortex/discussions/4542
|
||||
this._isDatasourceVersionGreaterOrEqualTo('1.11.0', PromApplication.Cortex) ||
|
||||
//https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.24.0
|
||||
this._isDatasourceVersionGreaterOrEqualTo('1.24.0', PromApplication.VictoriaMetrics) ||
|
||||
// https://github.com/thanos-io/thanos/pull/3566
|
||||
//https://github.com/thanos-io/thanos/releases/tag/v0.18.0
|
||||
this._isDatasourceVersionGreaterOrEqualTo('0.18.0', PromApplication.Thanos)
|
||||
@@ -994,7 +992,6 @@ export class PrometheusDatasource
|
||||
[PromApplication.Mimir]: '/public/app/plugins/datasource/prometheus/img/mimir_logo.svg',
|
||||
[PromApplication.Prometheus]: '/public/app/plugins/datasource/prometheus/img/prometheus_logo.svg',
|
||||
[PromApplication.Thanos]: '/public/app/plugins/datasource/prometheus/img/thanos_logo.svg',
|
||||
[PromApplication.VictoriaMetrics]: '/public/app/plugins/datasource/prometheus/img/vm_logo.svg',
|
||||
};
|
||||
|
||||
const COLORS: Record<PromApplication, BadgeColor> = {
|
||||
@@ -1002,7 +999,6 @@ export class PrometheusDatasource
|
||||
[PromApplication.Mimir]: 'orange',
|
||||
[PromApplication.Prometheus]: 'red',
|
||||
[PromApplication.Thanos]: 'purple', // Purple hex taken from thanos.io
|
||||
[PromApplication.VictoriaMetrics]: 'black',
|
||||
};
|
||||
|
||||
const AppDisplayNames: Record<PromApplication, string> = {
|
||||
@@ -1010,7 +1006,6 @@ export class PrometheusDatasource
|
||||
[PromApplication.Mimir]: 'Mimir',
|
||||
[PromApplication.Prometheus]: 'Prometheus',
|
||||
[PromApplication.Thanos]: 'Thanos',
|
||||
[PromApplication.VictoriaMetrics]: 'VictoriaMetrics',
|
||||
};
|
||||
|
||||
const application = this.datasourceConfigurationPrometheusFlavor ?? buildInfo.application;
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.5 KiB |
Reference in New Issue
Block a user