From 63b8a780e427cb5f751b8f66d287f7946cc38419 Mon Sep 17 00:00:00 2001 From: Abraham Chavez Date: Fri, 3 May 2024 11:05:42 -0700 Subject: [PATCH] Fix: Health lambas still fail occasionally (#6097) --- lambdas/indexer/app.py | 4 ++++ lambdas/service/app.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/lambdas/indexer/app.py b/lambdas/indexer/app.py index 8ccc0cc836..975d060f16 100644 --- a/lambdas/indexer/app.py +++ b/lambdas/indexer/app.py @@ -216,6 +216,10 @@ def health_by_key(keys: Optional[str] = None): return app.health_controller.custom_health(keys) +@app.metric_alarm(metric=LambdaMetric.errors, + threshold=1, + period=24 * 60 * 60) +@app.metric_alarm(metric=LambdaMetric.throttles) @app.retry(num_retries=0) # FIXME: Remove redundant prefix from name # https://github.com/DataBiosphere/azul/issues/5337 diff --git a/lambdas/service/app.py b/lambdas/service/app.py index b038a39948..1fef51654d 100644 --- a/lambdas/service/app.py +++ b/lambdas/service/app.py @@ -54,6 +54,7 @@ from azul.chalice import ( AzulChaliceApp, C, + LambdaMetric, ) from azul.collections import ( OrderedSet, @@ -559,6 +560,10 @@ def custom_health(keys: Optional[str] = None): return app.health_controller.custom_health(keys) +@app.metric_alarm(metric=LambdaMetric.errors, + threshold=1, + period=24 * 60 * 60) +@app.metric_alarm(metric=LambdaMetric.throttles) @app.retry(num_retries=0) # FIXME: Remove redundant prefix from name # https://github.com/DataBiosphere/azul/issues/5337