hertzbeat
hertzbeat copied to clipboard
[BUG] Push style monitor is broken: collector posts to /api/push which was removed in #3204
Is there an existing issue for this?
- [X] I have searched the existing issues
Current Behavior
The Push Style Monitor (app-push.yml) can be created but every collect cycle fails: its collector posts to /api/push, an endpoint that no longer exists — #3204 replaced the push module's custom endpoint with the Prometheus pushgateway style API (/api/push/prometheus/**) and deleted PushController/PushService, but the monitor template, PushProtocol's default uri and the extend-push docs were left pointing at the removed endpoint.
Verified on current master:
$ curl -X POST http://localhost:1157/api/push -d '{}' -H 'Content-Type: application/json'
HTTP 404
collector log after adding a push monitor:
[1000000000-push-metrics] INFO MetricsCollect - [Collect Failed, Run 203ms] Reason: StatusCode 404
References still pointing at the removed endpoint:
hertzbeat-manager/src/main/resources/define/app-push.yml(uri: /api/push)hertzbeat-common-core/.../job/protocol/PushProtocol.java(private String uri = "/api/push")home/docs/advanced/extend-push.md(+ zh-CN/ja-JP i18n copies)app-pushentry in the help-docs task list #1795
Expected Behavior
Either the template works, or it is removed. Two options:
- Remove the leftovers: drop
app-push.yml,PushProtocol,PushCollectImpland theextend-pushdocs, since the Prometheus pushgateway API is the supported push path now. Simple, but loses the UI flow where users define custom metric fields for a push monitor. - Rewire the template to the new
/api/push/prometheus/{job}endpoint so the push-style monitor works again on top of the pushgateway implementation.
I'm happy to submit a PR for whichever direction the community prefers.
Steps To Reproduce
- Start HertzBeat from current master
- Add a
Push Style Monitor(host: 127.0.0.1, port: 1157, any metrics fields) - Watch the collect logs / metrics page: every cycle fails with
StatusCode 404
Environment
HertzBeat version(s): master (2.0-SNAPSHOT)