From c92e2f41c3ad05c150df2742a5b1e66843fa5773 Mon Sep 17 00:00:00 2001 From: vitor-aignosi Date: Mon, 4 Aug 2025 16:09:26 -0300 Subject: [PATCH] SIENTIAPDE-1174 pdate metrics tracking to include response time histogram - Changed PREDICTION_RESPONSE_TIME_MONITOR from Gauge to Histogram for better response time analysis. - Updated response time observation method in gates.py to utilize the new Histogram functionality. --- laborious/activities/gates.py | 2 +- laborious/metrics.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/laborious/activities/gates.py b/laborious/activities/gates.py index 739fa4b..38ee483 100644 --- a/laborious/activities/gates.py +++ b/laborious/activities/gates.py @@ -340,4 +340,4 @@ class Gates(BaseActivity): pod_id=self.pod_id, model_name=metadata['model_name'], pipeline_name=metadata['workflow_name'] - ).set(response_time) + ).observe(response_time) diff --git a/laborious/metrics.py b/laborious/metrics.py index eaad6a7..a3adcf9 100644 --- a/laborious/metrics.py +++ b/laborious/metrics.py @@ -1,4 +1,4 @@ -from prometheus_client import Gauge, Counter +from prometheus_client import Gauge, Counter, Histogram APP_UP = Gauge( "app_up", @@ -20,8 +20,9 @@ PREDICTION_CONFIDENCE_MONITOR = Gauge( CORE_LABELS, ) -PREDICTION_RESPONSE_TIME_MONITOR = Gauge( +PREDICTION_RESPONSE_TIME_MONITOR = Histogram( "laborious_prediction_response_time_monitor", "Current response time of each prediction", CORE_LABELS, + buckets=[0.01, 0.05, 0.1, 0.2, 0.5, 1.0, 2.0, 5.0, 10.0] )