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:
@@ -40,7 +40,7 @@ export function getQueryHints(query: string, series?: any[], datasource?: Promet
|
||||
counterNameMetric =
|
||||
metricMetadataKeys.find((metricName) => {
|
||||
// Only considering first type information, could be non-deterministic
|
||||
const metadata = metricsMetadata[metricName][0];
|
||||
const metadata = metricsMetadata[metricName];
|
||||
if (metadata.type.toLowerCase() === 'counter') {
|
||||
const metricRegex = new RegExp(`\\b${metricName}\\b`);
|
||||
if (query.match(metricRegex)) {
|
||||
|
||||
Reference in New Issue
Block a user