You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: monitor-data/custom-webhook-notifier.mdx
+38-16Lines changed: 38 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -24,14 +24,37 @@ To create a custom webhook notifier, follow these steps:
24
24
-`.QueryStartTime` is the start time applied in the monitor query that gave rise to the notification.
25
25
-`.Timestamp` is the time the notification was generated.
26
26
-`.Title` is the name of the monitor associated with the notification.
27
-
-`.Value` is the value that gave rise to the monitor triggering or resolving when the notification corresponds to a threshold monitor.
28
-
-`.MatchedEvent` is the event that matched the criteria of a match monitor.
27
+
-`.Value` is the value that gave rise to the monitor triggering or resolving. It’s only applicable if the notification corresponds to a threshold monitor.
28
+
-`.MatchedEvent` is a JSON object that represents the event that matched the criteria of the monitor. It’s only applicable if the notification corresponds to a match monitor.
29
+
-`.GroupKeys` and `.GroupValues` are JSON arrays that contain the keys and the values returned by the group-by attributes of your query. They are only applicable if the APL query of the monitor groups by a non-time field.
30
+
You can fully customize the content of the webhook to match the requirements of your environment.
29
31
1. Optional: Add headers to the POST request sent to the webhook URL.
30
32
1. Click **Create**.
31
33
32
34
## Examples
33
35
34
-
The example below is a custom webhook notification generated from a threshold monitor triggering. The body of a POST request sent to the webhook URL using the default template is the following:
36
+
The example below is the default template for a custom webhook notification:
37
+
38
+
```json
39
+
{
40
+
"action": "{{.Action}}",
41
+
"event": {
42
+
"monitorID": "{{.MonitorID}}",
43
+
"body": "{{.Body}}",
44
+
"description": "{{.Description}}",
45
+
"queryEndTime": "{{.QueryEndTime}}",
46
+
"queryStartTime": "{{.QueryStartTime}}",
47
+
"timestamp": "{{.Timestamp}}",
48
+
"title": "{{.Title}}",
49
+
"value": {{.Value}},
50
+
"matchedEvent": {{jsonObject .MatchedEvent}},
51
+
"groupKeys": {{jsonArray .GroupKeys}},
52
+
"groupValues": {{jsonArray .GroupValues}}
53
+
}
54
+
}
55
+
```
56
+
57
+
Using the template above, the body of a POST request sent to the webhook URL for a threshold monitor triggering:
35
58
36
59
```json
37
60
{
@@ -45,7 +68,9 @@ The example below is a custom webhook notification generated from a threshold mo
45
68
"timestamp": "2024-06-28 14:55:57 +0000 UTC",
46
69
"title": "Axiom Monitor Test Triggered",
47
70
"value": 57347,
48
-
"matchedEvent": null
71
+
"matchedEvent": null,
72
+
"groupKeys": null,
73
+
"groupValues": null
49
74
}
50
75
}
51
76
```
@@ -54,17 +79,14 @@ The example template below formats the webhook message to match the [expectation
54
79
55
80
```json
56
81
{
57
-
"action": "Open",
58
-
"event": {
59
-
"title": "{{.Title}}",
60
-
"description": "{{.Body}}",
61
-
"deduplication_key": "{{.MonitorID}}",
62
-
"status": "{{ if eq .Action "Open" }}firing{{ else }}resolved{{ end }}",
0 commit comments