|
|
|
@ -83,12 +83,13 @@ export function Panel({ options, data, width, height, timeRange, onChangeTimeRan
|
|
|
|
|
let additionalInfo; |
|
|
|
|
const additionalInfoConfig = options.gauge.additionalInfo; |
|
|
|
|
if (additionalInfoConfig.display) { |
|
|
|
|
// TODO: move `useMetric` handling to utils, as it's duplicated in gaugeOptions.ts
|
|
|
|
|
let value: number | undefined = undefined; |
|
|
|
|
if (!additionalInfoConfig.value?.useMetric) { |
|
|
|
|
value = additionalInfoConfig.value.value; |
|
|
|
|
} else { |
|
|
|
|
if (!_.isEmpty(additionalInfoConfig.value.metricName)) { |
|
|
|
|
const aggregatedValue = getLastMetricValue(grafanaSeriesList, additionalInfoConfig.value.metricName, 'Max'); |
|
|
|
|
const aggregatedValue = getLastMetricValue(grafanaSeriesList, additionalInfoConfig.value.metricName, 'Additional Info'); |
|
|
|
|
value = aggregatedValue !== null ? aggregatedValue : undefined; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|