-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] [txn] Make txn metrics name conforms to the rule (#17905)
Fixes: #17921 <strong>Note</strong>: This patch will change metrics names `s_bufferedwriter_batch_record_count` and `s_bufferedwriter_batch_oldest_record_delay_time_second`. These two names were first used in this PR #17701, and PR #17701 hasn't cherry-picked any branches yet, so this change will not cause any breaking changes. ### Motivation https://github.com/poorbarcode/pulsar/actions/runs/3156649582/jobs/5136584463 https://github.com/apache/pulsar/actions/runs/3156649597/jobs/5136596447 #### Problem-1 If the `Prometheus-Colloctor` which typed `Counter` is named 'xxx_count', then the output `metrics-api` will be named 'xxx_count_count'. `TxnLogBufferedWriterMetricsStats` hits this error. https://github.com/apache/pulsar/blob/fb7307d8f4998e42b18df3a4599fd7ec34cb04a9/pulsar-transaction/coordinator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/TxnLogBufferedWriterMetricsStats.java#L105-L106 ---- #### Problem-2 `PrometheusMetricsTest` defines the standard metrics name(see code below): ``` ["_sum", "_bucket", "_count", "_total", "_created"] ``` But the standard Prometheus name has three others( see: https://github.com/prometheus/client_java/blob/c28b901225e35e7c1df0eacae8b58fdfbb390162/simpleclient/src/main/java/io/prometheus/client/Collector.java#L152-L186 ): ``` ["_info", "_gsum", "_gcount"] ``` https://github.com/apache/pulsar/blob/fb7307d8f4998e42b18df3a4599fd7ec34cb04a9/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/PrometheusMetricsTest.java#L834-L861 ---- ### Modifications - Make `PrometheusMetricsTest` run with transaction feature - Make txn metrics name conforms to the rule. see: https://prometheus.io/docs/practices/naming/ - Make `PrometheusMetricsTest` support all suffix of prometheus metrics name ### Documentation - [x] `doc-not-needed` (Please explain why) ### Matching PR in forked repository PR in forked repository: - poorbarcode#19
- Loading branch information
1 parent
5d6a88e
commit 3715934
Showing
4 changed files
with
50 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters