Skip to content

Commit dea52ef

Browse files
committed
Add doc: Setting up custom integration over HTTPS
1 parent b105bf8 commit dea52ef

2 files changed

Lines changed: 58 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Follow these steps precisely, and you've got yourself a working installation:
6060
5. [Set up API Gateway](docs/setup_apigateway.md) (also includes: testing that this works)
6161
6. (recommended) [Set up AlertManager-canary](docs/setup_alertmanager-canary.md)
6262
7. (optional) Set up Prometheus integration
63-
8. (optional) Set up custom integration
63+
8. (optional) [Set up custom integration](docs/setup_custom_integration.md)
6464

6565

6666
Diagram

docs/setup_custom_integration.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
Setting up custom integration over HTTPS
2+
========================================
3+
4+
This API is pretty much explained in the [Setting up API gateway](./setup_apigateway.md) guide,
5+
but here's a short summary until I get time to write a better tutorial on this.
6+
7+
NOTE: replace `REDACTED` with your `API ID` from API Gateway.
8+
9+
10+
List firing alerts
11+
------------------
12+
13+
AKA un-acknowledged alerts.
14+
15+
```
16+
$ curl https://REDACTED.execute-api.us-west-2.amazonaws.com/prod/alerts
17+
[
18+
{
19+
"alert_key": "1",
20+
"subject": "www.example.com",
21+
"timestamp": "2017-01-15T12:12:04.018Z",
22+
"details": "I dont like the page"
23+
}
24+
]
25+
```
26+
27+
28+
Submit an alarm
29+
---------------
30+
31+
```
32+
$ curl -H 'Content-Type: application/json' -X POST -d '{"subject": "www.example.com", "details": "I dont like the page"}' https://REDACTED.execute-api.us-west-2.amazonaws.com/prod/alerts/ingest
33+
"OK => alert saved to database and queued for delivery"
34+
```
35+
36+
Or if the alert is already firing, you'll get back response `This alert is already firing. Discarding the submitted alert.`.
37+
38+
39+
Acknowledge an alert
40+
--------------------
41+
42+
```
43+
$ curl -H 'Content-Type: application/json' -X POST -d '{"alert_key": "1"}' https://REDACTED.execute-api.us-west-2.amazonaws.com/prod/alerts/acknowledge
44+
"Alert 1 deleted"
45+
```
46+
47+
48+
Receiving fired alerts via webhook
49+
----------------------------------
50+
51+
Go to `SNS > Topics > AlertManager-alert > Create subscription > HTTP or HTTPS`.
52+
53+
Firing alerts are sent to any subscribers listed in this topic. If I added a webhook, I would have these subscriptions:
54+
55+
- Email: ops@example.com
56+
- SMS: +358 40 123 456
57+
- Webhook(HTTPS): https://example.com/api/alert-firing-webhook

0 commit comments

Comments
 (0)