Kris20030907 opened a new pull request, #432:
URL: https://github.com/apache/rocketmq-dashboard/pull/432
## What is the purpose of the change
RocketMQ Studio currently returns generated sample data from its metrics
API, so it cannot be used to query real RocketMQ monitoring data.
This change introduces a real Prometheus-compatible range query adapter as
the foundation for the observability features proposed in #431. It enables
Studio to query historical RocketMQ metrics collected by a configured
Prometheus-compatible backend.
Part of #431.
## Brief changelog
- Replace the generated metrics source with a real `/api/v1/query_range`
adapter.
- Send PromQL range queries using form-encoded POST requests.
- Add configurable base URL, connect timeout, read timeout, Basic
authentication, and Bearer authentication.
- Preserve Prometheus result types, multiple series, labels, decimal and
special sample values, and warnings.
- Validate query parameters and expose meaningful upstream errors through
HTTP 400, 422, 502, 503, and 504 responses.
- Add executable OpenAPI examples and response documentation.
- Align the frontend metrics API with the backend request and response
contract.
- Add tests covering request encoding, response fidelity, authentication,
invalid input, malformed responses, upstream errors, missing configuration, and
timeouts.
## Verifying this change
The following checks were completed with JDK 21:
- `mvn -q checkstyle:check package`
- 165 tests passed.
- Checkstyle passed.
- Server packaging succeeded.
- `npm test`
- 6 tests passed.
- `npm run lint`
- No lint errors.
- `npm run build`
- Production build succeeded.
- Manually queried a Prometheus instance containing RocketMQ 5.5.0 metrics
through RocketMQ Studio Swagger UI.
- The request returned real matrix data with multiple labelled series.
- Invalid PromQL and timeout responses were mapped to the expected HTTP
errors.
Follow this checklist to help us incorporate your contribution quickly and
easily.
- [x] A GitHub issue has been filed for this change: #431.
- [x] The pull request title follows the required `[ISSUE #123] ...` format.
- [x] The pull request description explains what the change does, how it
works, and why it is needed.
- [x] Necessary unit tests have been added for the new logic.
- [x] Applicable backend and frontend verification checks have passed.
- [ ] If this contribution is considered large, submit an [Apache Individual
Contributor License Agreement](https://www.apache.org/licenses/#clas).
--
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]