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
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2026,7 +2026,7 @@ this feature.
For an example of using `payload` to send notifications to a service that
doesn't have a dedicated receiver, such as [Gotify](https://gotify.net), see
[`examples/webhook/gotify.yml`](https://github.com/prometheus/alertmanager/blob/main/examples/webhook/gotify.yml).
More webhook payload examples, including one for Microsoft Teams, can be
Another webhook payload example for Microsoft Teams can be
found in [`examples/webhook`](https://github.com/prometheus/alertmanager/tree/main/examples/webhook).

### `<incidentio_config>`
Expand Down
2 changes: 1 addition & 1 deletion docs/notification_examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ See the [`<email_config>` reference](configuration.md#email_config) for SMTP aut

## Sending notifications to Gotify with a custom webhook payload

[Gotify](https://gotify.net) doesn't have a dedicated Alertmanager receiver, but its push message API is a simple JSON POST, so it can be driven directly with the generic [`webhook_config`](configuration.md#webhook_config) and its `payload` field. Authentication is done via the `X-Gotify-Key` header, which should be set to a Gotify application token using `secrets` so it's redacted from the displayed configuration:
[Gotify](https://gotify.net) doesn't have a dedicated Alertmanager receiver, but its push message API is a simple JSON POST, so it can be driven directly with the generic [`webhook_config`](configuration.md#webhook_config) and its `payload` field.

```yaml
receivers:
Expand Down
18 changes: 10 additions & 8 deletions examples/webhook/gotify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,24 @@ receivers:
"client::display":
contentType: "text/markdown"
message: |
{{ if gt (len .Alerts.Firing) 0 }}
{{ if .Alerts.Firing }}
**Firing**
{{ range .Alerts.Firing }}
**{{ .Annotations.summary }}**

**Instance:** `{{ .Labels.instance }}`
**Since:** {{ .StartsAt }}
**Source:** [Prometheus]({{ .GeneratorURL }})
- **Instance:** `{{ .Labels.instance }}`
- **Since:** {{ .StartsAt.Format "2006-01-02 15:04:05 MST" }}
- **Source:** [Prometheus]({{ .GeneratorURL }})
{{ end }}
{{ end }}
{{ if gt (len .Alerts.Resolved) 0 }}
{{ if .Alerts.Resolved }}
**Resolved**
{{ range .Alerts.Resolved }}
**{{ .Annotations.summary }}**

**Instance:** `{{ .Labels.instance }}`
**Resolved:** {{ .EndsAt }}
**Source:** [Prometheus]({{ .GeneratorURL }})
- **Instance:** `{{ .Labels.instance }}`
- **Resolved:** {{ .EndsAt.Format "2006-01-02 15:04:05 MST" }}
- **Source:** [Prometheus]({{ .GeneratorURL }})
{{ end }}
{{ end }}

Expand Down
Loading