Skip to content

Commit 91b7d18

Browse files
liukun4515fstab
authored andcommitted
fix bug for tag
Signed-off-by: liukun4515 <[email protected]>
1 parent 248ac4b commit 91b7d18

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

simpleclient_graphite_bridge/src/main/java/io/prometheus/client/bridge/Graphite.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void push(CollectorRegistry registry) throws IOException {
6161
writer.write(m.replaceAll("_"));
6262
for (int i = 0; i < sample.labelNames.size(); ++i) {
6363
m.reset(sample.labelValues.get(i));
64-
writer.write("." + sample.labelNames.get(i) + "." + m.replaceAll("_"));
64+
writer.write(";" + sample.labelNames.get(i) + "=" + m.replaceAll("_"));
6565
}
6666
writer.write(" " + sample.value + " " + now + "\n");
6767
}

simpleclient_graphite_bridge/src/test/java/io/prometheus/client/bridge/GraphiteTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void run() {
5050
// Check result.
5151
String[] parts = result.toString().split(" ");
5252
assertEquals(3, parts.length);
53-
assertEquals("labels.l.fo_o", parts[0]);
53+
assertEquals("labels;l=fo_o", parts[0]);
5454
assertEquals("1.0", parts[1]);
5555
Integer.parseInt(parts[2]); // This shouldn't throw an exception.
5656
}

0 commit comments

Comments
 (0)