From 005f40bceb057222f9b9065106e38bdf52d2f6df Mon Sep 17 00:00:00 2001 From: Simon K <6615834+simon-20@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:46:55 +0000 Subject: [PATCH] ops: added zipper duration as prom metric --- src/bulk_data_service/zipper.py | 1 + src/utilities/prometheus.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/bulk_data_service/zipper.py b/src/bulk_data_service/zipper.py index ed45d0e..db55677 100644 --- a/src/bulk_data_service/zipper.py +++ b/src/bulk_data_service/zipper.py @@ -63,6 +63,7 @@ def zipper_run(context: dict, datasets_in_working_dir: dict[uuid.UUID, dict], da run_end = datetime.datetime.now(datetime.UTC) context["logger"].info("Zipper run finished in {}.".format(run_end - run_start)) + context["prom_metrics"]["zipper_run_duration"].set((run_end - run_start).seconds) def setup_working_dir_with_downloaded_datasets( diff --git a/src/utilities/prometheus.py b/src/utilities/prometheus.py index 6577e39..977f49a 100644 --- a/src/utilities/prometheus.py +++ b/src/utilities/prometheus.py @@ -22,6 +22,10 @@ def get_metrics_definitions(context: dict) -> list: "checker_run_duration", "The time taken by the last run of the checker (seconds)", ), + ( + "zipper_run_duration", + "The time taken by the last run of the zipper (seconds)", + ), ( "number_crashes", "The number of crashes since app restart",