@satterly hey Nick! Hope you're doing great. I started on some project for an email to alerta integration. I've managed to send some alerts into alerta from email. But I'd like to start this script on startup right after my container comes alive. Do you have any suggestions to achieve tht? I've tried docker compose's command function but it breaks the container and webui doesn't start actually.
You can check out the forked repo of alerta on here if you'd like to:
Does someone know how to configure Heartbeats with prometheus
@FL3SH add the following two lines to alerta config:
PLUGINS=['prometheus','heartbeat'] HEARTBEAT_EVENTS=['Heartbeat', 'Watchdog']
you would probably want to set timeout label in alert relabel config
- source_labels: [alertname] target_label: timeout regex: 'Watchdog' replacement: '120'
and set repeat_interval in alertmanager config
- match: alertname: Watchdog group_wait: 0s group_interval: 1m repeat_interval: 50s receiver: alerta
that's what I did.
The only issue is that when heartbeat status is NOT ok, the alert's environment is set to default value of 'Production'. The environment label of Watchdog alert is not honored. Seems like a bug @satterly
OK I've found out how to autostart my application inside docker. I used supervisored.conf and added the command there. Also if anyone would like to contribute feel free to do so :
$ alerta delete Deleting all alerts. Do you want to continue? [y/N]:
$ alerta delete --help Usage: alerta delete [OPTIONS] Delete alerts. Options: -i, --ids UUID List of alert IDs (can use short 8-char id) -q, --query QUERY severity:"warning" AND resource:web -f, --filter FILTER KEY=VALUE eg. serverity=warning resource=web -h, --help Show this message and exit.
Successfully installed alerta-urlmon-3.3.0 alerta@a0a27ce0f1b2:/urlmon$ alerta-urlmon Traceback (most recent call last): File "/venv/bin/alerta-urlmon", line 11, in <module> load_entry_point('alerta-urlmon==3.3.0', 'console_scripts', 'alerta-urlmon')() File "/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 490, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2853, in load_entry_point return ep.load() File "/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2453, in load return self.resolve() File "/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2459, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "/venv/lib/python3.7/site-packages/urlmon.py", line 54, in <module> import settings