Skip to content

Commit

Permalink
ops: added zipper duration as prom metric
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-20 committed Dec 10, 2024
1 parent 0e2e5a4 commit 005f40b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/bulk_data_service/zipper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 4 additions & 0 deletions src/utilities/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 005f40b

Please sign in to comment.