Prometheus: Improve autocomplete performance and remove disabling of dynamic label lookup (#30199)

* processLabels: Use Sets instead of Array

* Add and update comment

* Limit autocomplete items to 10000

* Remove lookup treshold, limit display of items

* Update tests

* Add test

* Update public/app/plugins/datasource/prometheus/language_provider.ts
This commit is contained in:
Ivana Huckova
2021-01-14 15:45:45 +01:00
committed by GitHub
parent d10dbc70a1
commit a05596848d
5 changed files with 68 additions and 77 deletions

View File

@@ -209,9 +209,9 @@ class PromQueryField extends React.PureComponent<PromQueryFieldProps, PromQueryF
let hint = hints.length > 0 ? hints[0] : null;
// Hint for big disabled lookups
if (!hint && !datasource.lookupsDisabled && datasource.languageProvider.lookupsDisabled) {
if (!hint && datasource.lookupsDisabled) {
hint = {
label: `Dynamic label lookup is disabled for datasources with more than ${datasource.languageProvider.lookupMetricsThreshold} metrics.`,
label: `Labels and metrics lookup was disabled in data source settings.`,
type: 'INFO',
};
}