diff --git a/prometheus/alert.rules b/prometheus/alert.rules index 05785ddc0e6ec20abc8d7b3f67731220b92d5bbe..10d5b7cd6548d2b98442ad726210dd2b53879de9 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 d288a55a2b4060301fe52019f1785133b9674a97..86905ed0a0efdf818220373aea12e2e1680dbef8 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 + + +