grafana / oncall

Developer-friendly incident response with brilliant Slack integration
GNU Affero General Public License v3.0
3.41k stars 272 forks source link

Incorrect message in phone call #851

Open greatvovan opened 1 year ago

greatvovan commented 1 year ago

Preparation

  1. Set up user notifications to receive phone calls (default or important).
  2. Add notification of the user to a chain (making it default or important as per the previous step).
  3. Create a Webhook integration, copy the URL, click Open Escalation Settings.
  4. Click pencil and change name to "My beautiful integration".
  5. Assign the chain from step #2 to the integration through the default route.
  6. Click Change alert template and grouping.
  7. Set web title template to {{ payload.title }}.
  8. Set phone title template to {{ payload.title }}.
  9. Click Save Templates.

Repro steps

  1. Initiate an alert group creation with title "My wonderful alert group" through the integration from step #3. curl <URL_from_prep_step_3> -H 'Content-Type: Application/json' -d '{"title": "My wonderful alert group"}'
  2. Accept and listen the phone call.

Expected behaviour

The message correctly identifies parameters of the alert group.

Actual behaviour

The voice message: "You are invited to check an incident from Grafana OnCall. Alert [illegible - fire?] My beautiful integration, web hook with title My wonderful alert group triggered one time. Press 1 to acknowledge, 2 to resolve, 3 to silence for 30 minutes". Titles of the alert group and integration are confused.

Environment

Grafana Cloud

greatvovan commented 1 year ago

After listening again, it might have been "Alert via ..., web hook with title ... triggered one time" (correction in bold). With that, it makes sense to put integration name here, but it means that the message must be corrected anyway, because both placeholders are prepared for the name of integration. An example of corrected message:

"Alert via integration name titled alert group title"

I also not sure what is the purpose of adding "triggered one time", and what are the situations when it can be more than "one".

Konstantinov-Innokentii commented 1 year ago

@greatvovan you can check phone_call template here.

greatvovan commented 1 year ago

Based on the linked template, I am realizing I was wrong with the assumption that it is the template that is bad (maybe it is bad, too, but it is not the root cause). Let's check it carefully again:

The integration name:

image

The alert group name:

image

The voice message: https://soundcloud.com/fun-with-no-end/grafana-oncall-sample-notification-2 Transcript: "You are invited to check an incident from Grafana OnCall. Alert via My beautiful integration, web hook with title My wonderful alert group triggered one time. Press 1 to acknowledge, 2 to resolve, 3 to silence for 30 minutes".

Question: how does "web hook" part makes its way into the message?

Konstantinov-Innokentii commented 1 year ago

@greatvovan {integration_name} in template consists from integration name and integration type

greatvovan commented 1 year ago

@Konstantinov-Innokentii that explains something. But how exactly? Do any commas or dots separate name and type?

greatvovan commented 1 year ago

Thinking more about the potential to improve the message, why do we not provide the user ability to form entire message, as in other destinations?

image

Currently the user can influence only Title and (in another place) name of integration.

Can we rename the field into Message and allow the user to form entire voice message as they wish?