mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-03 18:07:27 -08:00
2bb14c5787
Signed-off-by: Julius Volz <julius.volz@gmail.com>
13 lines
348 B
TypeScript
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(", ")}}`;
|
|
};
|