Fix histogram labels are absent (#5173)

This commit is contained in:
Gao Hongtao 2020-07-26 11:19:22 +08:00 committed by GitHub
parent 3a00d84766
commit 2a031dae77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -116,6 +116,7 @@ public class Context {
Histogram.HistogramBuilder hBuilder = Histogram.builder();
hBuilder.name(name).timestamp(now);
samples.forEach(textSample -> {
hBuilder.labels(textSample.getLabels());
if (textSample.getName().endsWith("_count")) {
hBuilder.sampleCount((long) convertStringToDouble(textSample.getValue()));
} else if (textSample.getName().endsWith("_sum")) {