From 79b13f685e43ab3c0d57511947d4b6a2ac543798 Mon Sep 17 00:00:00 2001 From: Alex Ellis Date: Mon, 26 Jun 2017 12:38:00 +0100 Subject: [PATCH] Move to HA for gateway --- prometheus/alert.rules | 3 ++- prometheus/prometheus.yml | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/prometheus/alert.rules b/prometheus/alert.rules index 05785ddc..10d5b7cd 100644 --- a/prometheus/alert.rules +++ b/prometheus/alert.rules @@ -2,7 +2,7 @@ ALERT service_down IF up == 0 ALERT APIHighInvocationRate - IF rate ( gateway_function_invocation_total [10s] ) > 5 + IF sum ( rate(gateway_function_invocation_total{code="200"}[10s]) ) by (function_name) > 5 FOR 5s LABELS { service = "gateway", @@ -13,3 +13,4 @@ ALERT APIHighInvocationRate summary = "High invocation total on {{ $labels.instance }}", description = "High invocation total on {{ $labels.instance }}" } + diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml index d288a55a..86905ed0 100644 --- a/prometheus/prometheus.yml +++ b/prometheus/prometheus.yml @@ -30,5 +30,11 @@ scrape_configs: - job_name: "gateway" scrape_interval: 5s - static_configs: - - targets: ['gateway:8080'] + dns_sd_configs: + - names: ['tasks.gateway'] + port: 8080 + type: A + refresh_interval: 5s + + +