I'm trying to add a new Slack notification channel so I can change the slack channel that I'm using to send an alert to. When I try add a channel it asks me to authorize slack, which I do and then it redirects to Google Cloud's Alerting section and then it gets stuck.
I've tried in both Brave and Firefox and I still can't add a new slack channel.
Here is where you go to manage your notification channels and then I click on add new for Slack(I already have a few configured but I want to add a new one):
Here it redirects to Slack
Then it just gets stuck here:
Solved! Go to Solution.
Hello @timogoosen ,
Welcome to the Google Cloud Community. I've checked this at newly created workspace. At the first time I've got white page. I've tried once more and I was able to add integration. Maybe you are choosing wrong workspace ? Additionally, did you've tried to add this channel via CLI?
To add a Slack notification channel via CLI, you can use the following command:
gcloud alpha monitoring channels create slack --project=PROJECT_ID --display-name=CHANNEL_NAME --slack-webhook-url=SLACK_WEBHOOK_URL
Where:
PROJECT_ID is your project ID.
For example, to add a Slack channel named "My Channel" with the webhook URL " https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXX ", you would use the following command:
gcloud alpha monitoring channels create slack --project=webaap-wordpress-load --display-name=My Channel --slack-webhook-url=https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXX
Once you have created the channel, you can verify that it was created by running the following command:
gcloud alpha monitoring channels list --project=PROJECT_ID
Hello @timogoosen ,
Welcome to the Google Cloud Community. I've checked this at newly created workspace. At the first time I've got white page. I've tried once more and I was able to add integration. Maybe you are choosing wrong workspace ? Additionally, did you've tried to add this channel via CLI?
To add a Slack notification channel via CLI, you can use the following command:
gcloud alpha monitoring channels create slack --project=PROJECT_ID --display-name=CHANNEL_NAME --slack-webhook-url=SLACK_WEBHOOK_URL
Where:
PROJECT_ID is your project ID.
For example, to add a Slack channel named "My Channel" with the webhook URL " https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXX ", you would use the following command:
gcloud alpha monitoring channels create slack --project=webaap-wordpress-load --display-name=My Channel --slack-webhook-url=https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXX
Once you have created the channel, you can verify that it was created by running the following command:
gcloud alpha monitoring channels list --project=PROJECT_ID
Thanks I tried again, but going directly to manage "notification channels" now it works.
Seems if you try do it from an existing alert and you try manage notifications from an existing alert then it won't work even if you try again.
Thanks for your help.
If anyone at google sees this please fix it. Your welcome to reach out to me if you want more details to replicate the issue exactly.
I can confirm this is still an issue, and that the solution above works.
gcloud alpha monitoring channels create --project=project0id --display-name="channel-name" --type=slack --channel-labels=auth_token=token-for-bot-user-retrieved-from-app,channel_name=your-slack-channel-name
The channel was added and visible from the notification channel tab but I'm still unable to attach the channel to my budget.
Btw if it is a private channel you also need to first add the Google Cloud Monitoring Integration from Slack to the channel first before you can add that channel as a notification channel on the GCP side, else it will else show "channel not found".
I had the same issue, and somehow it only happened when I tried to add the channel from the page where I was creating the alert.
Going to Notification Channels first, and adding the channel there worked just fine. The page didn't get stuck! After that I went back to my alert and just refreshed the channels list and my channel was there.