Skip to content

Watcher: Add the ability to add Slack actions to Slack attachments #31032

@rukas

Description

@rukas

It does not appear that the Watcher Slack action supports adding Slack Actions. It would be very helpful to have the ability to add actions such as buttons for alert acknowledgement. I'm currently able to do this outside of Elasticsearch with a POST containing the following body:

{
  "title": "*Something bad happened*",
  "text": "*Something bad happened*",
  "attachments": [
    {
      "text": "Something bad happened",
      "fallback": "Something bad happened",
      "callback_id": "ack_alert",
      "color": "danger",
      "attachment_type": "default",
      "actions": [
        {
          "name": "acknowledge",
          "text": "Acknowledge",
          "type": "button",
          "value": "acknowledge"
        }
      ]
    }
  ]
}

I added the below to my watch configuration in an attempt to get the same functionality out of Watcher:

"slack": {
  "account": "monitoring",
  "message": {
    "from": "Elasticsearch Watcher",
    "to": [
      "#channel"
    ],
    "text": "*Something bad happened*",
    "attachments": [
      {
        "color": "warning",
        "title": "Something bad happened",
        "text": "Something bad happened",
        "callback_id": "ack_alert",
        "actions": [
          {
            "name": "acknowledge",
            "text": "Acknowledge",
            "type": "button",
            "value": "acknowledge"
          }
        ]
      }
    ]
  }
}

But the error I get is Watcher: [parse_exception] could not parse message attachment field. unexpected field [callback_id] which makes me assume that the Slack action in Watcher does not support adding actions to attachments.

Elasticsearch version: 6.2.4

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions