On Apr 6, 2022, at 2:15 PM, 'Quentin Laville' via Google Cloud Developers <google-c...@googlegroups.com> wrote:
Thank you for your answer. I followed the instruction, I created a new webhook in a Google Chat group, got the URL of the webhook, and added it to the Notification Channels in the "Webhook" section. However, as I wrote previously when I do the "Test Connection", I don't receive anything in the Google Chat group.
--
You received this message because you are subscribed to the Google Groups "Google Cloud Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-dev/671ce146-7826-4d6f-a525-6db743301484n%40googlegroups.com.

Hi,
Thank you for providing your reproduction steps as I was also able to get the same results.
You are correct that this is a formatting issue of the payload. In fact, the specification of the payload that is delivered by Stackdriver webhook(Monitoring) and the specification expected by Google Chat are different. Stackdriver webhook payloads represent a "Stackdriver incident" and include details that make sense in the context of Stackdriver. Google Chat messages represent information to be displayed that is specific to Google Chat and its various messaging capabilities.
In general, attempting to point a Stackdriver webhook directly at another service (whether Google Chat or any other API, whether Google-owned or third party), will not work. The expectation with the webhook channel is that you will implement your own microservice to receive them and that is designed to accept the particular format of the Stackdriver webhook payload.
This microservice can be implemented on Google Cloud (e.g. using Cloud Run, Cloud Functions, App Engine, Kubernetes Engine, Compute Engine, etc.) or on premise. That microservice can then convert the Stackdriver webhook payload, which typically looks something like [1] into a Google Chat message, which can use simple text or a more sophisticated card representation [2], and issue its own HTTP request to the Google Chat API. A guide on how to do with Cloud Run so can be found here[3]
In addition, I found this feature request[4] for Native Integration of the Webhook GCP alert to Google Chat. I suggest you comment and click on the star on top of the page. I hope you find this information useful.
[1]
{
"incident": {
"incident_id": "f2e08xxxxx393bz",
"resource_id": "i-4xxxa2d",
"resource_name": "wxxxxr-85",
"state": "open",
"started_at": 1385085727,
"ended_at": null,
"policy_name": "Wxxxxer Health",
"condition_name": "CPU usage",
"url": "https://console.cloud.google.com/monitoring/alerting/incidents?project=PROJECT_ID",
"summary": "CPU for wxxxxr-85 is above the threshold of 1% with a value of 28.5%"
},
"version": 1.1
}
[2] https://developers.google.com/hangouts/chat/reference/message-formats/cards
[4] https://issuetracker.google.com/219749842