Skip to content
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

Alerting Contact Points: Test Contact Point feature fails for Slack Integration #73015

Closed
camoore1979 opened this issue Aug 7, 2023 · 1 comment
Labels
area/alerting Grafana Alerting

Comments

@camoore1979
Copy link

What happened?

When testing a contact point with the Slack Integration, with the contact point in the saved state (the Webhook URL displays "Configured" rather than showing the value of the webhook), running a test fails with this message:

image

In the Network tab, we see that the request for POST https://grafana.tools.eoilreports.com/api/alertmanager/grafana/config/api/v1/receivers/test is missing the webhook url in it's payload. Here's the payload from cURL:

--data-raw '{"receivers":[{"name":"test","grafana_managed_receiver_configs":[{"settings":{"title":"{{ template \"slack-title\" . }}","text":"{{ template \"slack-body\" . }}"},"secureSettings":{},"type":"slack","name":"test","disableResolveMessage":true,"uid":"VQmcfZa4k"}]}]}' 

Note, it does work when you edit the Webhook URL input before you save (which hides the value). In the Network tab, we can see that the request in this case is not missing the webhook url in it's payload. Here's the payload from cURL:

--data-raw '{"receivers":[{"name":"test","grafana_managed_receiver_configs":[{"settings":{"title":"{{ template \"slack-title\" . }}","text":"{{ template \"slack-body\" . }}"},"secureSettings":{"url":"https://hooks.slack.com/services/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"},"type":"slack","name":"test","disableResolveMessage":true,"uid":"VQmcfZa4k"}]}]}'```

### What did you expect to happen?

I expected for the Test of the Contact Point with Slack Integration to be successful both in the saved and the unsaved state.

### Did this work before?

Yes. It works fine on other Grafana 9.1.4 instances we are running.

### How do we reproduce it?

The following presupposes that you have configured your Slack instance for receiving messages to a channel via webhook. You will need that webhook to test the following.

1. Navigate to Alerting -> Contact points
2. Select +Add contact point.
3. Select "Slack" from the Integration select.
4. Copy the Slack webhook url into the Webhook URL input.
5. Press "Test", then press "Send test notification." That should work!
6. Press "Save contact point." This will return you to the list of Contact points.
7. Select your Contact point from the list.
8. Press "Test", then press "Send test notification." This should result in the error. See screenshot above.


### Is the bug inside a dashboard panel?

No.

### Environment (with versions)?

Grafana: 10.0.3
OS: macOS 13.4.1
Browser: Chrome Version 115.0.5790.114


### Grafana platform?

Kubernetes

### Datasource(s)?

_No response_
@zuchka zuchka added the area/alerting Grafana Alerting label Aug 13, 2023
@armandgrillet
Copy link
Contributor

This is fixed in Grafana 10.0.4 (unreleased) and 10.1.0 (will be released on August 22nd): #72235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/alerting Grafana Alerting
Projects
Archived in project
Development

No branches or pull requests

3 participants