Skip to content
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

Rename Pulsar schema metrics to specify OpenMetrics #16610

Merged
merged 1 commit into from
Jul 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ static synchronized SchemaRegistryStats getInstance(ScheduledExecutorService sch
}

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", "-");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ public void testSchemaRegistryMetrics() throws Exception {
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");
Expand Down
20 changes: 10 additions & 10 deletions site2/docs/reference-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down