You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "dao-jun (via GitHub)" <gi...@apache.org> on 2024/04/12 08:46:43 UTC
[PR] [improve] Make the config `metricsBufferResponse` description more effective [pulsar]
dao-jun opened a new pull request, #22490:
URL: https://github.com/apache/pulsar/pull/22490
### Motivation
Referring to: https://github.com/apache/pulsar/issues/22477#issuecomment-2050141202
### Modifications
<!-- Describe the modifications you've done. -->
### Verifying this change
- [ ] Make sure that the change passes the CI checks.
*(Please pick either of the following options)*
This change is a trivial rework / code cleanup without any test coverage.
*(or)*
This change is already covered by existing tests, such as *(please describe tests)*.
*(or)*
This change added tests and can be verified as follows:
*(example:)*
- *Added integration tests for end-to-end deployment with large payloads (10MB)*
- *Extended integration test for recovery after broker failure*
### Does this pull request potentially affect one of the following parts:
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
*If the box was checked, please highlight the changes*
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve] Make the config `metricsBufferResponse` description more effective [pulsar]
Posted by "dao-jun (via GitHub)" <gi...@apache.org>.
dao-jun merged PR #22490:
URL: https://github.com/apache/pulsar/pull/22490
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve] Make the config `metricsBufferResponse` description more effective [pulsar]
Posted by "dao-jun (via GitHub)" <gi...@apache.org>.
dao-jun commented on code in PR #22490:
URL: https://github.com/apache/pulsar/pull/22490#discussion_r1565469039
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -2915,7 +2915,9 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
private boolean exposeTopicLevelMetricsInPrometheus = true;
@FieldContext(
category = CATEGORY_METRICS,
- doc = "If true, export buffered metrics"
+ doc = "Set to true to enable the broker to cache the metrics response, default is false. "
+ + "For scraping metrics more than once per scrape period, the broker generates metrics at the first "
+ + "scrape and returns the same response for the rest of the scrape period. "
Review Comment:
fix, PTAL
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -2915,7 +2915,9 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
private boolean exposeTopicLevelMetricsInPrometheus = true;
@FieldContext(
category = CATEGORY_METRICS,
- doc = "If true, export buffered metrics"
+ doc = "Set to true to enable the broker to cache the metrics response, default is false. "
+ + "For scraping metrics more than once per scrape period, the broker generates metrics at the first "
+ + "scrape and returns the same response for the rest of the scrape period. "
Review Comment:
fixed, PTAL
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve] Make the config `metricsBufferResponse` description more effective [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #22490:
URL: https://github.com/apache/pulsar/pull/22490#discussion_r1567317285
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -2915,7 +2915,11 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
private boolean exposeTopicLevelMetricsInPrometheus = true;
@FieldContext(
category = CATEGORY_METRICS,
- doc = "If true, export buffered metrics"
+ doc = "Set to true to enable the broker to cache the metrics response, default is false. "
+ + "For scraping metrics more than once per scrape period(defined by "
+ + "`managedLedgerStatsPeriodSeconds`, please make sure `managedLedgerStatsPeriodSeconds`"
+ + " same with your time series DB scrape interval.), the broker generates metrics at the first "
+ + "scrape and returns the same response for the rest of the scrape period. "
Review Comment:
@dao-jun I'd simplify the description as follows:
```suggestion
doc = "Set to true to enable the broker to cache the metrics response; the default is false. "
+ "The caching period is defined by `managedLedgerStatsPeriodSeconds`. "
+ "The broker returns the same response for subsequent requests within the same period. "
+ "Ensure that the scrape interval of your monitoring system matches the caching period."
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve] Make the config `metricsBufferResponse` description more effective [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #22490:
URL: https://github.com/apache/pulsar/pull/22490#discussion_r1562306801
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -2915,7 +2915,9 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
private boolean exposeTopicLevelMetricsInPrometheus = true;
@FieldContext(
category = CATEGORY_METRICS,
- doc = "If true, export buffered metrics"
+ doc = "Set to true to enable the broker to cache the metrics response, default is false. "
+ + "For scraping metrics more than once per scrape period, the broker generates metrics at the first "
+ + "scrape and returns the same response for the rest of the scrape period. "
Review Comment:
Add a better definition for scraping period. Currently "scrape period" is vague. It's better to explicitly define it. There's 2 different concepts that are involved:
* Internally, there's a caching period for the metrics response. In the implementation, the caching period is defined with `managedLedgerStatsPeriodSeconds`.
* In Prometheus, there's a global setting called ["scrape_interval"](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#configuration-file) and in the Prometheus operator there's [PodMetricsEndpoint interval](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#monitoring.coreos.com/v1.PodMetricsEndpoint) for configuring the scraping interval for individual scraping endpoints.
Please revisit the description to resolve the issue with the undefined concept "scrape period".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org