-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google chat notifications are not received when bulk #83
Comments
Additional info: I've put the pod in debug mode and got the following:
I did some research and it seems that the Google API cannot handle multiple messages fired up at the same time (I didn't hit any other "quota" like amount of messages per hour or something). |
I have confirmed that it is related to how quickly messages are sent to the Google API.
Google recommends to retry a few times when this happens with a longer delay between each try: |
Hello Eric, so is this something that can't be set in Helm?
If it isn't, can you submit a PR with your fix?
Thx.
El vie, 22 nov 2024 a la(s) 1:34 p.m., Eric Blevins (
***@***.***) escribió:
… I have confirmed that it is related to how quickly messages are sent to
the Google API.
I tried a delay of 50ms between each message, still had the problem so I
tried 500ms and that seems to work.
diff --git a/internal/providers/google_chat/google_chat.go b/internal/providers/google_chat/google_chat.go
index 953c84d..df07d37 100644
--- a/internal/providers/google_chat/google_chat.go
+++ b/internal/providers/google_chat/google_chat.go
@@ -143,6 +143,7 @@ func (m *GoogleChatManager) Push(alerts []alertmgrtmpl.Alert) error {
}
m.metrics.Duration(fmt.Sprintf(`alerts_dispatched_duration_seconds{provider="%s", room="%s"}`, m.ID(), m.Room()), now)
+ time.Sleep(500 * time.Millisecond)
}
}
Google recommends to retry a few times when this happens with a longer
delay between each try:
https://developers.google.com/workspace/chat/limits#resolve_time-based_quota_errors
—
Reply to this email directly, view it on GitHub
<#83 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BIHURDAVQVBXODWCOVKG2JT2B5MH7AVCNFSM6AAAAABRNXH3OKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJUGE3DMOBWGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Same problem. And adding |
I changed the sendMessage procedure in internal/providers/google_chat/message.go a bit to resend if an error is received. It doesn't look pretty, but it works for me.
|
When firing multiples alerts at the same time for the same endpoint, only the first one is received in google chat. The rest of them seems to be discared
The pods shows errors like "error sending message","error":"non ok response from gchat" which does not tell you what's exactly going on.
The app should include a mechanism for retrying sending alerts when this happens or fire them after a few seconds between each other to avoid these kind of errors
I'm using image ghcr.io/mr-karan/calert:v2.1.1, deployed by helm chart
The text was updated successfully, but these errors were encountered: