-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prometheus data format #43
Conversation
Codecov Report
@@ Coverage Diff @@
## master #43 +/- ##
============================================
- Coverage 33.87% 33.81% -0.06%
+ Complexity 1290 1288 -2
============================================
Files 213 213
Lines 13685 13717 +32
Branches 1094 1101 +7
============================================
+ Hits 4636 4639 +3
- Misses 8745 8767 +22
- Partials 304 311 +7
Continue to review full report at Codecov.
|
metrics-prometheus/src/main/java/com/alibaba/metrics/prometheus/DubboMetricsExports.java
Outdated
Show resolved
Hide resolved
metrics-prometheus/src/main/java/com/alibaba/metrics/prometheus/DubboMetricsExports.java
Outdated
Show resolved
Hide resolved
metrics-prometheus/src/main/java/com/alibaba/metrics/prometheus/DubboMetricsExports.java
Outdated
Show resolved
Hide resolved
metrics-prometheus/src/main/java/com/alibaba/metrics/prometheus/DubboMetricsExports.java
Outdated
Show resolved
Hide resolved
metrics-prometheus/src/main/java/com/alibaba/metrics/prometheus/DubboMetricsExports.java
Outdated
Show resolved
Hide resolved
metrics-prometheus/src/main/java/com/alibaba/metrics/prometheus/DubboMetricsExports.java
Outdated
Show resolved
Hide resolved
metrics-prometheus/src/main/java/com/alibaba/metrics/prometheus/DubboMetricsExports.java
Outdated
Show resolved
Hide resolved
Map<Long, Long> bucket = entry.getValue(); | ||
for (Map.Entry<Long, Long> entry1 : bucket.entrySet()) { | ||
samples.add(sampleBuilder.createSample(metricName, suffix, Arrays.asList("bucket"), Arrays.asList(entry1.getKey().toString()), entry1.getValue())); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one more bucket called +Infinity
. see the test output for Prometheus Histogram.
# HELP test_prom_histogram test histogram
# TYPE test_prom_histogram histogram
test_prom_histogram_bucket{le="10.0",} 20.0
test_prom_histogram_bucket{le="100.0",} 172.0
test_prom_histogram_bucket{le="500.0",} 830.0
test_prom_histogram_bucket{le="1000.0",} 1615.0
test_prom_histogram_bucket{le="+Inf",} 1615.0
Note that in Prometheus the value is accumulated for each bucket, however in Alibaba metrics, the value is not. It may be necessary to adapt to prometheus logic.
No description provided.