diff --git a/docker/blocks/prometheus/Dockerfile b/docker/blocks/prometheus/Dockerfile index 0e07679ddd5..1ad28f524ff 100644 --- a/docker/blocks/prometheus/Dockerfile +++ b/docker/blocks/prometheus/Dockerfile @@ -1,2 +1,3 @@ FROM prom/prometheus ADD prometheus.yml /etc/prometheus/ +ADD alert.rules /etc/prometheus/ diff --git a/docker/blocks/prometheus/alert.rules b/docker/blocks/prometheus/alert.rules new file mode 100644 index 00000000000..563d1e89994 --- /dev/null +++ b/docker/blocks/prometheus/alert.rules @@ -0,0 +1,10 @@ +# Alert Rules + +ALERT AppCrash + IF process_open_fds > 0 + FOR 15s + LABELS { severity="critical" } + ANNOTATIONS { + summary = "Number of open fds > 0", + description = "Just testing" + } diff --git a/docker/blocks/prometheus/fig b/docker/blocks/prometheus/fig index 1c70c14fc37..7d9bea68046 100644 --- a/docker/blocks/prometheus/fig +++ b/docker/blocks/prometheus/fig @@ -18,3 +18,8 @@ fake-prometheus-data: environment: FD_DATASOURCE: prom +alertmanager: + image: quay.io/prometheus/alertmanager + net: host + ports: + - "9093:9093" diff --git a/docker/blocks/prometheus/prometheus.yml b/docker/blocks/prometheus/prometheus.yml index 35be33b80a7..0afb7968ce5 100644 --- a/docker/blocks/prometheus/prometheus.yml +++ b/docker/blocks/prometheus/prometheus.yml @@ -6,9 +6,18 @@ global: # Load and evaluate rules in this file every 'evaluation_interval' seconds. rule_files: + - "alert.rules" # - "first.rules" # - "second.rules" +alerting: + alertmanagers: + - scheme: http + static_configs: + - targets: + - "127.0.0.1:9093" + + # A scrape configuration containing exactly one endpoint to scrape: # Here it's Prometheus itself. scrape_configs: