diff --git a/README.md b/README.md index 67a47f1..35775a9 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ git clone https://github.com/connext/nxtp-router-docker-compose.git - `ROUTER_EXTERNAL_PORT`, `GRAFANA_EXTERNAL_PORT` 3. (Optional) Modify `.env` file and set alert notifications to Slack or Discord. +- `DISCORD_WEBHOOK` - optionally set discord webhook tag to receive custom alerts. See [Discord docs](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) to create a webhook. 4. Create NXTP configuration file `~/nxtp-router-docker-compose/config.json`, it will be mounted into router container. See [Connext docs](https://docs.connext.network/Routers/configuration) for configuration description. You can use `config.example.json` as example. diff --git a/data/alertmanagerConfig/alertmanager.yml b/data/alertmanagerConfig/alertmanager.yml new file mode 100644 index 0000000..cc3febe --- /dev/null +++ b/data/alertmanagerConfig/alertmanager.yml @@ -0,0 +1,12 @@ +# The root route on which each incoming alert enters. +route: + group_by: ['alertname'] + group_wait: 20s + group_interval: 5m + repeat_interval: 3h + receiver: discord_webhook + +receivers: + - name: 'discord_webhook' + webhook_configs: + - url: 'http://alertmanager-discord:9094' diff --git a/docker-compose.yml b/docker-compose.yml index f35db4c..dd0ecbf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -143,6 +143,36 @@ services: networks: - nxtp + alertmanager: + image: prom/alertmanager + restart: always + volumes: + - ./data/alertmanagerConfig:/config + - alertmanager:/data + command: + - --config.file=/config/alertmanager.yml + ports: + - 9093:9093 + logging: + driver: json-file + options: + max-size: 10m + networks: + - nxtp + + alertmanager-discord: + container_name: alertmanager-discord + image: benjojo/alertmanager-discord + restart: always + environment: + DISCORD_WEBHOOK: $DISCORD_WEBHOOK + logging: + driver: json-file + options: + max-size: 10m + networks: + - nxtp + ################################################################################ node-exporter: @@ -194,4 +224,5 @@ volumes: grafana: loki: redis_data: + alertmanager: