Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions opsimate-docs/docs/alerts/actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
sidebar_position: 5
---

# Actions

An action is a configured integration (Slack webhook, Teams webhook, Jira, generic HTTP) that is fired against an Alert.

## Scope
Each action can be limited to certain alerts by name or criteria.

## Action types and what they need

| Type | Required | Optional |
| --- | --- | --- |
| Slack | Webhook URL | Channel, Message template |
| Teams | Webhook URL | Title template, Message template |
| Jira | Base URL, Email, API token, Project key, Issue type | Summary template, Description template |
| HTTP | URL, Method | Headers, Body template |

## Variable substitution in action payloads
Templates use: `{{name}}`

### Alert fields

Every field is available under a short name and an `alert.` prefixed alias. Both forms
resolve to the same value.

| Variable | Description |
| --- | --- |
| `{{name}}` | Alert name |
| `{{id}}` | Alert ID |
| `{{status}}` | e.g. `firing` |
| `{{type}}` | Alert type |
| `{{severity}}` | Alert severity |
| `{{summary}}` | Alert summary |
| `{{service}}` | Service the alert relates to |
| `{{startsAt}}` | When the alert started |
| `{{createdAt}}` | When the alert was created |
| `{{updatedAt}}` | When the alert was last updated |
| `{{url}}` | Link to the alert in OpsiMate |
| `{{runbookUrl}}` | Link to the runbook, if set |

### Tags
Tag values are available under three prefixes, all equivalent. Replace `env` with your tag's name:

| Variable | Description |
| --- | --- |
| `{{label.env}}` | Tag value, `label.` prefix |
| `{{tag.env}}` | Tag value, `tag.` prefix |
| `{{alert.tags.env}}` | Tag value, full path |

## Running an action from an alert
In the alert details panel there's a collapsible Actions section (with a count). Expanding it shows a button per action. Clicking one opens a dialog. The dialog builds a preview, lets you edit the fields, and you hit Send. Success or failure appears as a notification. There's also a Manage link to the Actions page, and if nothing's configured you get a prompt to create one.

## Alert History Timeline
Each entry is labelled as Action run with a description line and the timestamp followed by who ran it.

Action-run entries land on the Activity side rail, not the main lifecycle rail. So filtering to Activity isolates them.
2 changes: 1 addition & 1 deletion opsimate-docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const sidebars = {
type: 'category',
label: 'Alerts',
collapsed: true,
items: ['alerts/adding-alerts', 'alerts/alert-management', 'alerts/archived-alerts', 'alerts/tv-mode'],
items: ['alerts/adding-alerts', 'alerts/alert-management', 'alerts/archived-alerts', 'alerts/tv-mode', 'alerts/actions'],
},
{
type: 'category',
Expand Down