[BUG] Gotify fallback webhook URL is missing token placeholder
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 92/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- java
- Domain
- observability-sre
Research direction
Start by comparing the fallback value in AlerterProperties.java with the formatting call in GotifyAlertNotifyHandlerImpl. Confirm that the fallback URL contains the token placeholder and that formatting it with a receiver token produces the expected Gotify URL.
Written by the indexing model from the issue text.
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Describe the bug
AlerterProperties.java defines the fallback default Gotify webhook URL as:
private String gotifyWebhookUrl = "https://push.example.de/message?token=";
But GotifyAlertNotifyHandlerImpl formats this value with the receiver token:
String webHookUrl = String.format(alerterProperties.getGotifyWebhookUrl(), receiver.getGotifyToken());
Because the fallback default does not contain a %s placeholder, String.format() ignores receiver.getGotifyToken(). If this Java fallback value is used, the generated URL becomes:
https://push.example.de/message?token=
instead of including the Gotify token.
The configured value in application.yml already uses the expected format:
gotify-webhook-url: http://127.0.0.1/message?token=%s
So the Java fallback default should be consistent with the configured default.
Expected Behavior
The fallback default should include the token placeholder:
private String gotifyWebhookUrl = "https://push.example.de/message?token=%s";
Steps To Reproduce
No response
Environment
HertzBeat master branch / 2.0-SNAPSHOT.
Debug logs
No response
Anything else?
No response
- Dominant language
- Java
- Stars
- 7.4k
- Forks
- 1.3k
- Avg merge
- 16h 20m
- Merged PRs (30d)
- 22
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/hertzbeat
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
Difficulty 4/5 3-5 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
All issues in apache/hertzbeat
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100