Skip to content

Commit 64e3cb8

Browse files
savulchikbrian-brazil
authored andcommitted
Fix bug in CollectorRegistry#collectorNames method (#325)
The switch statement was missing breaks for SUMMARY and HISTOGRAM cases. Due to this bug wrong and duplicate collector names are produced for summaries and histograms.
1 parent fb4161a commit 64e3cb8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

simpleclient/src/main/java/io/prometheus/client/CollectorRegistry.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,13 @@ private List<String> collectorNames(Collector m) {
109109
names.add(family.name + "_count");
110110
names.add(family.name + "_sum");
111111
names.add(family.name);
112+
break;
112113
case HISTOGRAM:
113114
names.add(family.name + "_count");
114115
names.add(family.name + "_sum");
115116
names.add(family.name + "_bucket");
117+
names.add(family.name);
118+
break;
116119
default:
117120
names.add(family.name);
118121
}

0 commit comments

Comments
 (0)