You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2022/07/16 13:35:28 UTC

[pulsar] branch master updated: Rename Pulsar schema metrics to specify OpenMetrics (#16610)

This is an automated email from the ASF dual-hosted git repository.

penghui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 24c62c13767 Rename Pulsar schema metrics to specify OpenMetrics (#16610)
24c62c13767 is described below

commit 24c62c137670fcaff69ae91be30d2b531470ee03
Author: ZhangJian He <sh...@gmail.com>
AuthorDate: Sat Jul 16 21:35:22 2022 +0800

    Rename Pulsar schema metrics to specify OpenMetrics (#16610)
---
 .../broker/service/schema/SchemaRegistryStats.java   | 10 +++++-----
 .../broker/service/schema/SchemaServiceTest.java     |  6 +++---
 site2/docs/reference-metrics.md                      | 20 ++++++++++----------
 3 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryStats.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryStats.java
index 042fa86d7ad..fd285ab7574 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryStats.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryStats.java
@@ -59,16 +59,16 @@ class SchemaRegistryStats implements AutoCloseable, Runnable {
     }
 
     private SchemaRegistryStats(ScheduledExecutorService scheduler) {
-        this.deleteOpsFailedCounter = Counter.build("pulsar_schema_del_ops_failed_count", "-")
+        this.deleteOpsFailedCounter = Counter.build("pulsar_schema_del_ops_failed_total", "-")
                 .labelNames(NAMESPACE).create().register();
-        this.getOpsFailedCounter = Counter.build("pulsar_schema_get_ops_failed_count", "-")
+        this.getOpsFailedCounter = Counter.build("pulsar_schema_get_ops_failed_total", "-")
                 .labelNames(NAMESPACE).create().register();
-        this.putOpsFailedCounter = Counter.build("pulsar_schema_put_ops_failed_count", "-")
+        this.putOpsFailedCounter = Counter.build("pulsar_schema_put_ops_failed_total", "-")
                 .labelNames(NAMESPACE).create().register();
 
-        this.compatibleCounter = Counter.build("pulsar_schema_compatible_count", "-")
+        this.compatibleCounter = Counter.build("pulsar_schema_compatible_total", "-")
                 .labelNames(NAMESPACE).create().register();
-        this.incompatibleCounter = Counter.build("pulsar_schema_incompatible_count", "-")
+        this.incompatibleCounter = Counter.build("pulsar_schema_incompatible_total", "-")
                 .labelNames(NAMESPACE).create().register();
 
         this.deleteOpsLatency = this.buildSummary("pulsar_schema_del_ops_latency", "-");
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/SchemaServiceTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/SchemaServiceTest.java
index 6c5eddc731a..91d7706655e 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/SchemaServiceTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/SchemaServiceTest.java
@@ -116,11 +116,11 @@ public class SchemaServiceTest extends MockedPulsarServiceBaseTest {
         String metricsStr = output.toString(StandardCharsets.UTF_8);
         Multimap<String, PrometheusMetricsTest.Metric> metrics = PrometheusMetricsTest.parseMetrics(metricsStr);
 
-        Collection<PrometheusMetricsTest.Metric> delMetrics = metrics.get("pulsar_schema_del_ops_failed_count");
+        Collection<PrometheusMetricsTest.Metric> delMetrics = metrics.get("pulsar_schema_del_ops_failed_total");
         Assert.assertEquals(delMetrics.size(), 0);
-        Collection<PrometheusMetricsTest.Metric> getMetrics = metrics.get("pulsar_schema_get_ops_failed_count");
+        Collection<PrometheusMetricsTest.Metric> getMetrics = metrics.get("pulsar_schema_get_ops_failed_total");
         Assert.assertEquals(getMetrics.size(), 0);
-        Collection<PrometheusMetricsTest.Metric> putMetrics = metrics.get("pulsar_schema_put_ops_failed_count");
+        Collection<PrometheusMetricsTest.Metric> putMetrics = metrics.get("pulsar_schema_put_ops_failed_total");
         Assert.assertEquals(putMetrics.size(), 0);
 
         Collection<PrometheusMetricsTest.Metric> deleteLatency = metrics.get("pulsar_schema_del_ops_latency_count");
diff --git a/site2/docs/reference-metrics.md b/site2/docs/reference-metrics.md
index 0d85f3f42b4..1ac4afd3dc0 100644
--- a/site2/docs/reference-metrics.md
+++ b/site2/docs/reference-metrics.md
@@ -533,16 +533,16 @@ All the schema metrics are labelled with the following labels:
 
 - *cluster*: `cluster=${pulsar_cluster}`. `${pulsar_cluster}` is the cluster name that you have configured in the `broker.conf` file.
 
-| Name | Type | Description |
-|---|---|---|
-| pulsar_schema_del_ops_failed_count | Counter | Number of failed operations to delete schemas. |
-| pulsar_schema_get_ops_failed_count | Counter | Number of failed operations to get schemas. |
-| pulsar_schema_put_ops_failed_count | Counter | Number of failed operations to send schemas. |
-| pulsar_schema_compatible_count | Counter | Number of compatible schemas. |
-| pulsar_schema_incompatible_count | Counter | Number of incompatible schemas. |
-| pulsar_schema_del_ops_latency | Summary | Latency of successful operations to delete schemas. |
-| pulsar_schema_get_ops_latency | Summary | Latency of successful operations to get schemas. |
-| pulsar_schema_put_ops_latency | Summary | Latency of successful operations to send schemas. |
+| Name                               | Type    | Description                                         |
+|------------------------------------|---------|-----------------------------------------------------|
+| pulsar_schema_del_ops_failed_total | Counter | Number of failed operations to delete schemas.      |
+| pulsar_schema_get_ops_failed_total | Counter | Number of failed operations to get schemas.         |
+| pulsar_schema_put_ops_failed_total | Counter | Number of failed operations to send schemas.        |
+| pulsar_schema_compatible_total     | Counter | Number of compatible schemas.                       |
+| pulsar_schema_incompatible_total   | Counter | Number of incompatible schemas.                     |
+| pulsar_schema_del_ops_latency      | Summary | Latency of successful operations to delete schemas. |
+| pulsar_schema_get_ops_latency      | Summary | Latency of successful operations to get schemas.    |
+| pulsar_schema_put_ops_latency      | Summary | Latency of successful operations to send schemas.   |
 
 ### Offload metrics