Skip to content

Commit

Permalink
Updated note
Browse files Browse the repository at this point in the history
  • Loading branch information
heidmotron committed Sep 4, 2024
1 parent 0d7aefa commit d2bdafd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/preprocessors/timeseries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ export function createTimestampMap(timestamps: number[]): Map<number, number> {
return timestampToIndexMap;
}

// TODO: remove when Grafana 10 is the minimum supported version
function legenedFormatter(legend = "", labels: Labels) {
// nb: We're slightly divergent from `renderLegendFormat` available in v10+
// since they just repeat the key if a label value is undefined
const aliasRegex = /\{\{\s*(.+?)\s*\}\}/g;
return legend.replace(aliasRegex, (_, group) => (labels[group] ? labels[group] : "<undefined>"));
}

0 comments on commit d2bdafd

Please sign in to comment.