You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2019/05/19 00:49:31 UTC
[pulsar] 16/26: For functions metrics in prometheus also remove
TYPE (#4081)
This is an automated email from the ASF dual-hosted git repository.
mmerli pushed a commit to branch branch-2.3
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit f497feb1054c1a211672e90f5f3196405db8325e
Author: Matteo Merli <mm...@apache.org>
AuthorDate: Sat Apr 20 17:44:21 2019 -0700
For functions metrics in prometheus also remove TYPE (#4081)
---
.../instance/stats/PrometheusTextFormat.java | 21 ---------------------
1 file changed, 21 deletions(-)
diff --git a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/stats/PrometheusTextFormat.java b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/stats/PrometheusTextFormat.java
index 52d756d..f7a205c 100644
--- a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/stats/PrometheusTextFormat.java
+++ b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/stats/PrometheusTextFormat.java
@@ -37,12 +37,6 @@ public class PrometheusTextFormat {
*/
while (mfs.hasMoreElements()) {
Collector.MetricFamilySamples metricFamilySamples = mfs.nextElement();
- writer.write("# TYPE ");
- writer.write(metricFamilySamples.name);
- writer.write(' ');
- writer.write(typeString(metricFamilySamples.type));
- writer.write('\n');
-
for (Collector.MetricFamilySamples.Sample sample : metricFamilySamples.samples) {
writer.write(sample.name);
if (sample.labelNames.size() > 0) {
@@ -66,21 +60,6 @@ public class PrometheusTextFormat {
}
}
- private static String typeString(Collector.Type t) {
- switch (t) {
- case GAUGE:
- return "gauge";
- case COUNTER:
- return "counter";
- case SUMMARY:
- return "summary";
- case HISTOGRAM:
- return "histogram";
- default:
- return "untyped";
- }
- }
-
private static void writeEscapedLabelValue(Writer writer, String s) throws IOException {
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);