prometheus: monaco: allow listing label names + values without a metric (#41233)

* prometheus: monaco: allow listing label names + values without a metric

* removed comment
This commit is contained in:
Gábor Farkas
2021-11-03 11:20:04 +01:00
committed by GitHub
parent 72ae3235fa
commit 91da1bbb79
2 changed files with 42 additions and 9 deletions

View File

@@ -138,7 +138,11 @@ const MonacoQueryField = (props: Props) => {
return Promise.resolve(result);
};
const dataProvider = { getSeries, getHistory, getAllMetricNames };
const getAllLabelNames = () => Promise.resolve(lpRef.current.getLabelKeys());
const getLabelValues = (labelName: string) => lpRef.current.getLabelValues(labelName);
const dataProvider = { getSeries, getHistory, getAllMetricNames, getAllLabelNames, getLabelValues };
const completionProvider = getCompletionProvider(monaco, dataProvider);
// completion-providers in monaco are not registered directly to editor-instances,