Skip to content

msteamsv2 Notification Issues with Mobile App Display #4182

@allanhung

Description

@allanhung

What did you do?
When using the msteamsv2 notification integration, the alerts do not display correctly on the Microsoft Teams mobile app. This issue seems to be caused by the card text being truncated on mobile devices. For reference, Microsoft’s guidelines for designing effective cards can be found here: Microsoft Docs - Design Effective Cards. I tested adding wrap: true in the template msteamsv2.go, and it resolved the issue.

I recorded the JSON generated by Alertmanager and used curl to reproduce this issue.

curl -X 'POST' '<msteams webhook url>' -H 'content-type: application/json' -d $'{
  "type": "message",
  "attachments": [
    {
      "contentType": "application/vnd.microsoft.card.adaptive",
      "contentUrl": null,
      "content": {
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "type": "AdaptiveCard",
        "version": "1.2",
        "body": [
          {
            "type": "TextBlock",
            "text": "\nPrometheus Alert 🔥 Firing:1 🔥",
            "weigth": "Bolder",
            "size": "Medium",
            "wrap": true,
            "style": "heading",
            "color": "Attention"
          },
          {
            "type": "TextBlock",
            "text": "\n**Found 1 unattached disks.**\n- **description**: Found 1 unattached disks.\n\n\n- **alertname**: UnattachedDiskFound\n"
          }
        ]
      }
    }
  ]
}'

What did you expect to see?
IMG_5300

What did you see instead? Under which circumstances?
IMG_5299

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions