-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Disable stats recorder for built-in PulsarClient #12217
Disable stats recorder for built-in PulsarClient #12217
Conversation
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.
If we find that we are interested in these stats, I think it makes more sense to update the implementation to add them to the results returned by the metrics endpoint instead of hide the stats in logs. Technically, this could be useful for client applications as well. The pulsar go client creates prometheus metrics, and I've found those very useful.
My only concern is that some users conduct some business analysis by collecting this log. At least this change needs to be explained in the Release, right? |
Yeah, you're right. Anyway it's a trade-off. And I'm curious about how can we explain it in release notes? |
### Motivation In `PulsarService`, there's a built-in client used in many places, like topic compaction, system topics read/write. It could also be used in protocol handlers. Different with the manually created Pulsar client, it can read the configured authentication params and TLS related configs for broker-to-broker communication. However, it doesn't change the default `statsIntervalSeconds` config, which means each time a producer/consumer/reader is created, a stats recorder (`ProducerStatsRecorderImpl` or `ConsumerStatsRecorderImpl`) will be created, in which there's a Netty `TimerTask` that prints stats periodically (the default interval is 1 minute). If there're many producers/consumers/readers created by this built-in client, the unnecessary CPU usage will be high. ### Modifications Configure the `statsIntervalSeconds` with zero value to disable stats recorder. (cherry picked from commit 52232e6)
### Motivation In `PulsarService`, there's a built-in client used in many places, like topic compaction, system topics read/write. It could also be used in protocol handlers. Different with the manually created Pulsar client, it can read the configured authentication params and TLS related configs for broker-to-broker communication. However, it doesn't change the default `statsIntervalSeconds` config, which means each time a producer/consumer/reader is created, a stats recorder (`ProducerStatsRecorderImpl` or `ConsumerStatsRecorderImpl`) will be created, in which there's a Netty `TimerTask` that prints stats periodically (the default interval is 1 minute). If there're many producers/consumers/readers created by this built-in client, the unnecessary CPU usage will be high. ### Modifications Configure the `statsIntervalSeconds` with zero value to disable stats recorder. (cherry picked from commit 52232e6)
### Motivation In `PulsarService`, there's a built-in client used in many places, like topic compaction, system topics read/write. It could also be used in protocol handlers. Different with the manually created Pulsar client, it can read the configured authentication params and TLS related configs for broker-to-broker communication. However, it doesn't change the default `statsIntervalSeconds` config, which means each time a producer/consumer/reader is created, a stats recorder (`ProducerStatsRecorderImpl` or `ConsumerStatsRecorderImpl`) will be created, in which there's a Netty `TimerTask` that prints stats periodically (the default interval is 1 minute). If there're many producers/consumers/readers created by this built-in client, the unnecessary CPU usage will be high. ### Modifications Configure the `statsIntervalSeconds` with zero value to disable stats recorder.
### Motivation In `PulsarService`, there's a built-in client used in many places, like topic compaction, system topics read/write. It could also be used in protocol handlers. Different with the manually created Pulsar client, it can read the configured authentication params and TLS related configs for broker-to-broker communication. However, it doesn't change the default `statsIntervalSeconds` config, which means each time a producer/consumer/reader is created, a stats recorder (`ProducerStatsRecorderImpl` or `ConsumerStatsRecorderImpl`) will be created, in which there's a Netty `TimerTask` that prints stats periodically (the default interval is 1 minute). If there're many producers/consumers/readers created by this built-in client, the unnecessary CPU usage will be high. ### Modifications Configure the `statsIntervalSeconds` with zero value to disable stats recorder. (cherry picked from commit 52232e6)
Motivation
In
PulsarService
, there's a built-in client used in many places, like topic compaction, system topics read/write. It could also be used in protocol handlers. Different with the manually created Pulsar client, it can read the configured authentication params and TLS related configs for broker-to-broker communication.However, it doesn't change the default
statsIntervalSeconds
config, which means each time a producer/consumer/reader is created, a stats recorder (ProducerStatsRecorderImpl
orConsumerStatsRecorderImpl
) will be created, in which there's a NettyTimerTask
that prints stats periodically (the default interval is 1 minute). If there're many producers/consumers/readers created by this built-in client, the unnecessary CPU usage will be high.Modifications
Configure the
statsIntervalSeconds
with zero value to disable stats recorder.Verifying this change
This change is a trivial rework / code cleanup without any test coverage.