-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add compacted topic metrics for TopicStats in CLI #11564
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
Add compacted topic metrics for TopicStats in CLI #11564
Conversation
c49abed to
81a7b49
Compare
|
/pulsarbot run-failure-checks |
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
Outdated
Show resolved
Hide resolved
michaeljmarshall
left a comment
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.
I suggested a few changes and asked some questions about design. I think the Sum class needs tests before this can be merged.
pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactorMXBeanImpl.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactorMXBeanImpl.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactorMXBeanImpl.java
Outdated
Show resolved
Hide resolved
pulsar-common/src/main/java/org/apache/pulsar/common/stats/Sum.java
Outdated
Show resolved
Hide resolved
Thanks for reviewing. Yesterday, we find that compacted topic has metrics in InternalStats which would be shown by: I may have to record other metrics except the above two |
f729c2c to
c6beb44
Compare
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
Outdated
Show resolved
Hide resolved
pulsar-client-admin-api/src/main/java/org/apache/pulsar/common/policies/data/CompactStats.java
Show resolved
Hide resolved
e8b4d0d to
89c90f9
Compare
pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
Outdated
Show resolved
Hide resolved
pulsar-client-admin-api/src/main/java/org/apache/pulsar/common/policies/data/CompactStats.java
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactorMXBeanImpl.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactorMXBeanImpl.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactorMXBeanImpl.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactorMXBean.java
Outdated
Show resolved
Hide resolved
gaoran10
left a comment
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.
LGTM
|
@michaeljmarshall Please help review the PR again. |
|
@michaeljmarshall Please help review the PR again. |
michaeljmarshall
left a comment
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.
I am concerned that the 2 hour fixed rate for cleanup will lead to incorrect metrics. I think it could be possible to implement the cleanup in a way that removes the possibility of serving incorrect metrics. Please let me know what you think.
Otherwise, this PR looks good to me.
pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactorMXBeanImpl.java
Outdated
Show resolved
Hide resolved
pulsar-client-admin-api/src/main/java/org/apache/pulsar/common/policies/data/CompactStats.java
Outdated
Show resolved
Hide resolved
|
@michaeljmarshall @gaoran10 @codelipenghui thanks for reviewing. |
michaeljmarshall
left a comment
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.
LGTM. Good work! I left a couple comments. It's up to you if you want to address them or leave the PR as is.
...r-client-admin-api/src/main/java/org/apache/pulsar/common/policies/data/CompactionStats.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactorMXBeanImpl.java
Outdated
Show resolved
Hide resolved
6cbbb12 to
c4b6e71
Compare
|
|
/pulsarbot run-failure-checks |
2 similar comments
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
### Motivation As #11564 has involved compaction metrics in CLI, it's extremely useful to expose relative metrics to Prometheus. - pulsar_compaction_removed_event_count : the removed event count of compaction . - pulsar_compaction_succeed_count : the succeed count of compaction. - pulsar_compaction_failed_count : the failed count of compaction. - pulsar_compaction_duration_time_in_millis : the duration time of compaction. - pulsar_compaction_read_throughput : the read throughput of compaction. - pulsar_compaction_write_throughput : the write throughput of compaction. - pulsar_compaction_compacted_entries_count: the compacted entries count. - pulsar_compaction_compacted_entries_size: the compacted entries size; if users enable the topic level metrics and the topic has been compacted or doing the compaction, we should expose the compaction metrics for the topic level. If users disable the topic level metrics, we should expose the aggregated compaction metrics for the namespace level.
Add below metrics to help track potential flows or examine the overall condition of compacted topics . - lastCompactionRemovedEventCount : the removed event count of last compaction - lastCompactionSucceedTimestamp : the timestamp of last succeed compaction - lastCompactionFailedTimestamp : the timestamp of last failed compaction - lastCompactionDurationTimeInMills: the duration time of last compaction These 4 metrics will be displayed in topic stats CLI : ``` ./pulsar-admin topics stats persistent://tenant/ns/topic ``` This patch will add metrics in CLI , which would generate doc automatically. (cherry picked from commit c0ef593)
### Motivation As #11564 has involved compaction metrics in CLI, it's extremely useful to expose relative metrics to Prometheus. - pulsar_compaction_removed_event_count : the removed event count of compaction . - pulsar_compaction_succeed_count : the succeed count of compaction. - pulsar_compaction_failed_count : the failed count of compaction. - pulsar_compaction_duration_time_in_millis : the duration time of compaction. - pulsar_compaction_read_throughput : the read throughput of compaction. - pulsar_compaction_write_throughput : the write throughput of compaction. - pulsar_compaction_compacted_entries_count: the compacted entries count. - pulsar_compaction_compacted_entries_size: the compacted entries size; if users enable the topic level metrics and the topic has been compacted or doing the compaction, we should expose the compaction metrics for the topic level. If users disable the topic level metrics, we should expose the aggregated compaction metrics for the namespace level. (cherry picked from commit 656635e)
Add below metrics to help track potential flows or examine the overall condition of compacted topics . - lastCompactionRemovedEventCount : the removed event count of last compaction - lastCompactionSucceedTimestamp : the timestamp of last succeed compaction - lastCompactionFailedTimestamp : the timestamp of last failed compaction - lastCompactionDurationTimeInMills: the duration time of last compaction These 4 metrics will be displayed in topic stats CLI : ``` ./pulsar-admin topics stats persistent://tenant/ns/topic ``` This patch will add metrics in CLI , which would generate doc automatically. (cherry picked from commit c0ef593) (cherry picked from commit 71cc13b)
### Motivation As apache#11564 has involved compaction metrics in CLI, it's extremely useful to expose relative metrics to Prometheus. - pulsar_compaction_removed_event_count : the removed event count of compaction . - pulsar_compaction_succeed_count : the succeed count of compaction. - pulsar_compaction_failed_count : the failed count of compaction. - pulsar_compaction_duration_time_in_millis : the duration time of compaction. - pulsar_compaction_read_throughput : the read throughput of compaction. - pulsar_compaction_write_throughput : the write throughput of compaction. - pulsar_compaction_compacted_entries_count: the compacted entries count. - pulsar_compaction_compacted_entries_size: the compacted entries size; if users enable the topic level metrics and the topic has been compacted or doing the compaction, we should expose the compaction metrics for the topic level. If users disable the topic level metrics, we should expose the aggregated compaction metrics for the namespace level. (cherry picked from commit 656635e) (cherry picked from commit a80f1e8)
### Motivation Add below metrics to help track potential flows or examine the overall condition of compacted topics . - lastCompactionRemovedEventCount : the removed event count of last compaction - lastCompactionSucceedTimestamp : the timestamp of last succeed compaction - lastCompactionFailedTimestamp : the timestamp of last failed compaction - lastCompactionDurationTimeInMills: the duration time of last compaction These 4 metrics will be displayed in topic stats CLI : ``` ./pulsar-admin topics stats persistent://tenant/ns/topic ``` ### Documentation This patch will add metrics in CLI , which would generate doc automatically.
### Motivation As apache#11564 has involved compaction metrics in CLI, it's extremely useful to expose relative metrics to Prometheus. - pulsar_compaction_removed_event_count : the removed event count of compaction . - pulsar_compaction_succeed_count : the succeed count of compaction. - pulsar_compaction_failed_count : the failed count of compaction. - pulsar_compaction_duration_time_in_millis : the duration time of compaction. - pulsar_compaction_read_throughput : the read throughput of compaction. - pulsar_compaction_write_throughput : the write throughput of compaction. - pulsar_compaction_compacted_entries_count: the compacted entries count. - pulsar_compaction_compacted_entries_size: the compacted entries size; if users enable the topic level metrics and the topic has been compacted or doing the compaction, we should expose the compaction metrics for the topic level. If users disable the topic level metrics, we should expose the aggregated compaction metrics for the namespace level.
Motivation
Add below metrics to help track potential flows or examine the overall condition of compacted topics .
These 4 metrics will be displayed in topic stats CLI :
Documentation
This patch will add metrics in CLI , which would generate doc automatically.