Ileo
07/29/2024, 3:37 PMSrikanth Chekuri
07/30/2024, 4:31 AMIleo
07/30/2024, 8:01 AM<https://chat.googleapis.com/v1/spaces/>...
Alertmanager log:
level=error ts=2024-07-30T07:10:48.103Z caller=api.go:808 component=api version=v1 msg="API error" err="server_error: unexpected status code 400: <https://chat.googleapis.com/v1/spaces/>...
I really think this error corresponds to this one:
{
"error": {
"code": 400,
"message": "Message cannot be empty.",
"status": "INVALID_ARGUMENT"
}
}
It's because you have to send the message through JSON in the body of the POST request, like:
Body:
{
"text": "{\"receiver\":\"test-google tchat fux events\",\"status\":\"firing\",\"alerts\":[{\"status\":\"firing\",\"labels\":{\"alertname\":\"Test Alert (google tchat fux events)\",\"severity\":\"critical\"},\"annotations\":{\"description\":\"Test alert fired from SigNoz dashboard\",\"message\":\"Test alert fired from SigNoz dashboard\",\"summary\":\"Test alert fired from SigNoz dashboard\"},\"startsAt\":\"0001-01-01T00:00:00Z\",\"endsAt\":\"0001-01-01T00:00:00Z\",\"generatorURL\":\"\",\"fingerprint\":\"9e56996e970e12c6\"}],\"groupLabels\":{\"alertname\":\"Test Alert (google tchat fux events)\",\"severity\":\"info\"},\"commonLabels\":{\"alertname\":\"Test Alert (google tchat fux events)\",\"severity\":\"critical\"},\"commonAnnotations\":{\"description\":\"Test alert fired from SigNoz dashboard\",\"message\":\"Test alert fired from SigNoz dashboard\",\"summary\":\"Test alert fired from SigNoz dashboard\"},\"externalURL\":\"<http://signoz.io>\",\"version\":\"4\",\"groupKey\":\"1\",\"truncatedAlerts\":0}"
}
But since it's a Google Chat, it's a good idea to send JSON data.
I think the actual body is something like this:
{
"receiver": "test-google tchat fux events",
"status": "firing",
"alerts": [
{
"status": "firing",
"labels": {
"alertname": "Test Alert (google tchat fux events)",
"severity": "critical"
},
"annotations": {
"description": "Test alert fired from SigNoz dashboard",
"message": "Test alert fired from SigNoz dashboard",
"summary": "Test alert fired from SigNoz dashboard"
},
"startsAt": "0001-01-01T00:00:00Z",
"endsAt": "0001-01-01T00:00:00Z",
"generatorURL": "",
"fingerprint": "9e56996e970e12c6"
}
],
"groupLabels": {
"alertname": "Test Alert (google tchat fux events)",
"severity": "info"
},
"commonLabels": {
"alertname": "Test Alert (google tchat fux events)",
"severity": "critical"
},
"commonAnnotations": {
"description": "Test alert fired from SigNoz dashboard",
"message": "Test alert fired from SigNoz dashboard",
"summary": "Test alert fired from SigNoz dashboard"
},
"externalURL": "<http://signoz.io>",
"version": "4",
"groupKey": "1",
"truncatedAlerts": 0
}
Ileo
07/30/2024, 8:16 AM{
"text": "{\"receiver\":\"test-google tchat fux events\",\"status\":\"firing\",\"alerts\":[{\"status\":\"firing\",\"labels\":{\"alertname\":\"Test Alert (google tchat fux events)\",\"severity\":\"critical\"},\"annotations\":{\"description\":\"Test alert fired from SigNoz dashboard\",\"message\":\"Test alert fired from SigNoz dashboard\",\"summary\":\"Test alert fired from SigNoz dashboard\"},\"startsAt\":\"0001-01-01T00:00:00Z\",\"endsAt\":\"0001-01-01T00:00:00Z\",\"generatorURL\":\"\",\"fingerprint\":\"9e56996e970e12c6\"}],\"groupLabels\":{\"alertname\":\"Test Alert (google tchat fux events)\",\"severity\":\"info\"},\"commonLabels\":{\"alertname\":\"Test Alert (google tchat fux events)\",\"severity\":\"critical\"},\"commonAnnotations\":{\"description\":\"Test alert fired from SigNoz dashboard\",\"message\":\"Test alert fired from SigNoz dashboard\",\"summary\":\"Test alert fired from SigNoz dashboard\"},\"externalURL\":\"<http://signoz.io>\",\"version\":\"4\",\"groupKey\":\"1\",\"truncatedAlerts\":0}"
}
https://github.com/SigNoz/signoz/issues/5095
found this issueSrikanth Chekuri
07/30/2024, 1:57 PM