mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Prometheus: Add info that using Loki as Prometheus data source is no longer supported and might stop working (#34650)
* Add information that Loki as Prometheus data source is not supported * Fix ugly error when loki as prometheus used * Refactor, add test * Fix type error * Fix test by passing missing method * Update public/app/plugins/datasource/prometheus/query_hints.ts * Remove optionality in prop
This commit is contained in:
@@ -127,3 +127,24 @@ export function getQueryHints(query: string, series?: any[], datasource?: Promet
|
||||
|
||||
return hints;
|
||||
}
|
||||
|
||||
export function getInitHints(datasource: PrometheusDatasource): QueryHint[] {
|
||||
const hints = [];
|
||||
// Hint if using Loki as Prometheus data source
|
||||
if (datasource.directUrl.includes('/loki') && !datasource.languageProvider.metrics.length) {
|
||||
hints.push({
|
||||
label: `Using Loki as a Prometheus data source is no longer supported. You must use the Loki data source for your Loki instance.`,
|
||||
type: 'INFO',
|
||||
});
|
||||
}
|
||||
|
||||
// Hint for big disabled lookups
|
||||
if (datasource.lookupsDisabled) {
|
||||
hints.push({
|
||||
label: `Labels and metrics lookup was disabled in data source settings.`,
|
||||
type: 'INFO',
|
||||
});
|
||||
}
|
||||
|
||||
return hints;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user