Add WebSocket Proxy Prometheus Metrics Endpoint
- Dominant language
- Java
- Stars
- 15.3k
- Forks
- 3.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 160
Description
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
### Motivation
Metrics are essential to all production deployments.
### Solution
Expose a metrics endpoint. This will require formatting the metrics, and then exposing them. Typically, these metrics are exposed at the `/metrics` endpoint.
### Alternatives
There is currently and endpoint for `/admin/v2/proxy-stats/metrics`, but that exposes metrics in a JSON format. It looks like the logic for those metrics could easily be converted into correct Prometheus metrics.
### Anything else?
_No response_
### Are you willing to submit a PR?
- [x] I'm willing to submit a PR!
Contributor guide
Research direction
Start by locating the proxy implementation for /admin/v2/proxy-stats/metrics and the code that formats its JSON response. Compare the existing metrics with Prometheus exposition requirements and determine where a /metrics endpoint should be exposed. Done means the proxy serves the converted metrics at /metrics and coverage verifies the endpoint and format.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, prometheus
- Domain
- api, observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100