You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@hertzbeat.apache.org by "orangeCatDeveloper (via GitHub)" <gi...@apache.org> on 2026/07/09 07:15:17 UTC

[PR] [fix] expose prestodb auth parameters and wire authorization into all metrics [hertzbeat]

orangeCatDeveloper opened a new pull request, #4188:
URL: https://github.com/apache/hertzbeat/pull/4188

   ## What's changed?
   
   Fixes #2838.
   
   The `app-prestodb.yml` template's `status` and `task` metric http sections already referenced `^_^authType^_^` / `^_^username^_^` / `^_^password^_^` placeholders in their `authorization` blocks, but the corresponding params were never defined, so the monitor form offered no way to enter credentials for an auth-enabled PrestoDB.
   
   This PR:
   
   - defines the missing `authType` (Basic Auth / Digest Auth), `username` and `password` params, following the same structure as `app-api.yml`
   - adds the `authorization` block to the `cluster` (priority 0 availability probe) and `node` metrics, which previously sent unauthenticated requests — without this, an auth-enabled PrestoDB is marked unavailable even with credentials configured, since the availability probe gets 401 before the auth-wired metrics ever run
   - updates the en / zh-cn help docs, and aligns the zh-cn `启用HTTPS` row with the form field label
   - adds `PrestodbMonitorE2eTest`: unlike the existing http e2e tests it takes the protocol from the template definition after placeholder replacement (mirroring `WheelTimerTask#initJobMetrics`), so a metric whose http section lacks the authorization wiring fails the test with a 401. Covers both the authenticated path (all 4 metric groups collect through a mock server enforcing HTTP Basic Auth) and the rejection path (no credentials → collection fails)
   
   Verification beyond the e2e test: ran the template against a real `prestodb/presto` docker instance configured with `http-server.authentication.type=PASSWORD` (password-file authenticator, bcrypt) + HTTPS self-signed keystore, per the official security docs. With credentials all metric groups collect successfully over HTTPS Basic Auth; without credentials the availability probe is rejected with 401. Also verified all template field names against the live `/v1/cluster`, `/v1/status`, `/v1/node`, `/v1/task` responses.
   
   Note: PrestoDB's native password authentication (LDAP / password file) uses HTTP Basic over HTTPS; Digest Auth is not natively supported by Presto and is only useful behind a reverse proxy — the option is kept for consistency with other hertzbeat http templates.
   
   ## Checklist
   
   - [x]  I have read the [Contributing Guide](https://hertzbeat.apache.org/docs/community/code_style_and_quality_guide)
   - [x]  I have written the necessary doc or comment.
   - [x]  I have added the necessary unit tests and all cases have passed.
   
   ## Add or update API
   
   - [x] I have added the necessary [e2e tests](https://github.com/apache/hertzbeat/tree/master/e2e) and all cases have passed.


-- 
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: notifications-unsubscribe@hertzbeat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@hertzbeat.apache.org
For additional commands, e-mail: notifications-help@hertzbeat.apache.org


Re: [PR] [fix] expose prestodb auth parameters and wire authorization into all metrics [hertzbeat]

Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 commented on PR #4188:
URL: https://github.com/apache/hertzbeat/pull/4188#issuecomment-4951742128

   hi, if you using wechat, pls add my account: aias00


-- 
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: notifications-unsubscribe@hertzbeat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@hertzbeat.apache.org
For additional commands, e-mail: notifications-help@hertzbeat.apache.org


Re: [PR] [fix] expose prestodb auth parameters and wire authorization into all metrics [hertzbeat]

Posted by "orangeCatDeveloper (via GitHub)" <gi...@apache.org>.
orangeCatDeveloper commented on PR #4188:
URL: https://github.com/apache/hertzbeat/pull/4188#issuecomment-4954273067

   @Aias00 The CI issue is not introduced in this PR. This is another PR to fix it. Could you please take a look? Thank you. https://github.com/apache/hertzbeat/pull/4202


-- 
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: notifications-unsubscribe@hertzbeat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@hertzbeat.apache.org
For additional commands, e-mail: notifications-help@hertzbeat.apache.org


Re: [PR] [fix] expose prestodb auth parameters and wire authorization into all metrics [hertzbeat]

Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 commented on PR #4188:
URL: https://github.com/apache/hertzbeat/pull/4188#issuecomment-4953297193

   pls fix ci


-- 
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: notifications-unsubscribe@hertzbeat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@hertzbeat.apache.org
For additional commands, e-mail: notifications-help@hertzbeat.apache.org


Re: [PR] [fix] expose prestodb auth parameters and wire authorization into all metrics [hertzbeat]

Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 merged PR #4188:
URL: https://github.com/apache/hertzbeat/pull/4188


-- 
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: notifications-unsubscribe@hertzbeat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@hertzbeat.apache.org
For additional commands, e-mail: notifications-help@hertzbeat.apache.org