lhotari opened a new pull request, #24060:
URL: https://github.com/apache/pulsar/pull/24060

   ### Motivation
   
   Prometheus 3.x requires explicit version information in the content type 
header when scraping metrics. Without this change, Prometheus 3.x would not be 
able to properly scrape metrics from Pulsar endpoints, which would cause 
monitoring issues for users who upgrade to Prometheus 3.x.
   See https://prometheus.io/docs/prometheus/latest/migration/#scrape-protocols 
for more details.
   
   A similar change has been made in BookKeeper with 
https://github.com/apache/bookkeeper/pull/4208
   
   ### Modifications
   
   - Added a constant `PROMETHEUS_CONTENT_TYPE_004` in 
`PrometheusMetricsServlet` class
   - Updated the content type in all metrics endpoints to include 
`version=0.0.4`:
    - `PrometheusMetricsServlet`
    - `PulsarPrometheusMetricsServlet`
    - `FunctionsMetricsResource`
   - Added a test in `BrokerServiceTest` to verify the correct content type is 
returned
   
   ### Additional context
   
   - Until this change is available, it's possible to configure 
`fallbackScrapeProtocol` in Prometheus at multiple levels. Here's an example 
for Apache Pulsar Helm chart 
https://github.com/apache/pulsar-helm-chart/pull/577 .
   
   ### 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 -->


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to