hertzbeat icon indicating copy to clipboard operation
hertzbeat copied to clipboard

[BUG] Push style monitor is broken: collector posts to /api/push which was removed in #3204

Open orangeCatDeveloper opened this issue 3 months ago • 0 comments

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-push entry in the help-docs task list #1795

Expected Behavior

Either the template works, or it is removed. Two options:

  1. Remove the leftovers: drop app-push.yml, PushProtocol, PushCollectImpl and the extend-push docs, 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.
  2. 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

  1. Start HertzBeat from current master
  2. Add a Push Style Monitor (host: 127.0.0.1, port: 1157, any metrics fields)
  3. Watch the collect logs / metrics page: every cycle fails with StatusCode 404

Environment

HertzBeat version(s): master (2.0-SNAPSHOT)

orangeCatDeveloper avatar Aug 10 '26 03:08 orangeCatDeveloper