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

Mobile push message is not taken from the template #2050

Closed
greatvovan opened this issue May 30, 2023 · 4 comments · Fixed by #3845
Closed

Mobile push message is not taken from the template #2050

greatvovan opened this issue May 30, 2023 · 4 comments · Fixed by #3845
Assignees

Comments

@greatvovan
Copy link

greatvovan commented May 30, 2023

While the title and the message in the mobile app or controlled be templates of "Web" type, the push message itself is using different template, which is not under user's control.

Currently a push message looks as follows:

Grafana Alerting integration type:

New Alert
#<ID> <alertname> via <integration_name>
Status: Firing, alerts: <count>

Webhook integration type:

New Alert
#<ID> Incident via <integration_name>
Status: Firing, alerts: <count>

Reproducing

  1. Create an escalation chain sending yourself a default notification.
  2. Create an integration of type Grafana Alerting and give it a recognizable name, e.g. "My GA integration".
  3. Set up the web templates as follows: Title: Title, Message: Message.
  4. Create an integration of type Webhook and give it a recognizable name, e.g. "My WH integration".
  5. Set up the web templates as follows: Title: Title, Message: Message.
  6. Assign your created escalation chain from item 1.
  7. Copy and store URLs of the created integrations.
Payload
{
    "receiver": "",
    "status": "firing",
    "alerts": [
      {
        "status": "firing",
        "labels": {
          "alertname": "My alert name"
        },
        "annotations": {},
        "startsAt": "2023-04-22T21:19:00Z",
        "endsAt": "0001-01-01T00:00:00Z",
        "generatorURL": "https://xxx.grafana.net/alerting/grafana/a9fa1566-5622-47f9-87b9-f5bbed1aa604/view",
        "fingerprint": "1738c614a1f918d1",
        "silenceURL": "https://xxx.grafana.net/alerting/silence/new?alertmanager=grafana&matcher=alertname%3DMy+alert+name",
        "dashboardURL": "",
        "panelURL": "",
        "values": {},
        "valueString": ""
      }
    ],
    "groupLabels": {},
    "commonLabels": {
      "alertname": "My alert name"
    },
    "commonAnnotations": {},
    "externalURL": "",
    "version": "1",
    "groupKey": "",
    "truncatedAlerts": 0,
    "orgId": 1,
    "title": "",
    "state": "",
    "message": ""
  }
  1. Send the payload to each of integration URLs to create alert groups. Example command:
    curl $url -H 'Content-Type: application/json' -d @$HOME/Downloads/oncall.json

Expected behaviour:
Push message uses the configured text templates (in our case "Tittle" and "Message").

Actual behaviour:
IMG_0768

IMG_0769

Suggested solution
Push text must include the configured title.
Rationale: only the user knows how to compose a useful message from the payload. Integration name and alert name might be not specific. "Incident via Integration name" may provide zero information. Looking at how other applications do the same, they try to fit as much information as possible into the push message.

Example:

#<ID> <templated_title>
<Templated message, if any>
  • I suggest to remove "New alert" row. What value does it give? Can there be messages of other types from OnCall? If yes, then keep it.
  • The Status: Firing, alerts: <count> row is also questionable. Are we sending pushes about "Acknowledged" or other status? If yes, then keep it.

System information

  • Cloud Grafana OnCall
  • version r145-v1.2.31
@iskhakov iskhakov self-assigned this May 31, 2023
@Matvey-Kuk Matvey-Kuk added the bug Something isn't working label May 31, 2023
@imtoori
Copy link
Contributor

imtoori commented May 31, 2023

@greatvovan thanks a lot for the suggestions!

I totally agree with your feedback and we're already working on templates for mobile push notifications.

I agree with your suggested solutions as well and we'll take them into consideration for the default template!

@Dieterbe
Copy link
Contributor

@iskhakov what's the status of this? just curious. i assume priority for this is rather low. thanks :)

@krptg0
Copy link

krptg0 commented Aug 17, 2023

Curious about that also :)

@Matvey-Kuk
Copy link
Contributor

The team will work on this later, it got pulled out of the short-term backlog :(

@joeyorlando joeyorlando assigned joeyorlando and unassigned iskhakov Feb 6, 2024
joeyorlando added a commit that referenced this issue Feb 8, 2024
# What this PR does

Closes #2050

https://www.loom.com/share/cca9af04f905456087f25e9cbf1845ab

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants