mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
prometheus: metadata: simplify the metrics-metadata format (#39411)
* prometheus: metadata: simplify the metrics-metadata format * fixed unit test * fixed tests
This commit is contained in:
@@ -53,7 +53,7 @@ export function addHistoryMetadata(item: CompletionItem, history: any[]): Comple
|
||||
function addMetricsMetadata(metric: string, metadata?: PromMetricsMetadata): CompletionItem {
|
||||
const item: CompletionItem = { label: metric };
|
||||
if (metadata && metadata[metric]) {
|
||||
const { type, help } = metadata[metric][0];
|
||||
const { type, help } = metadata[metric];
|
||||
item.documentation = `${type.toUpperCase()}: ${help}`;
|
||||
}
|
||||
return item;
|
||||
|
||||
Reference in New Issue
Block a user