prometheus/web/ui/mantine-ui/src/lib/formatSeries.ts
Julius Volz 2bb14c5787 Lots of more progress on the new Mantine UI
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2024-03-07 13:16:54 +01:00

13 lines
348 B
TypeScript

import { escapeString } from "./escapeString";
export const formatSeries = (labels: { [key: string]: string }): string => {
if (labels === null) {
return "scalar";
}
return `${labels.__name__ || ""}{${Object.entries(labels)
.filter(([k]) => k !== "__name__")
.map(([k, v]) => `${k}="${escapeString(v)}"`)
.join(", ")}}`;
};