File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ def get_app(httpx_client=None) -> FastAPI:
6161 logger .info (
6262 f"Setting up Metrics with ENABLE_PROMETHEUS_METRICS flag set to { config ['ENABLE_PROMETHEUS_METRICS' ]} "
6363 )
64+
6465 app .metrics = Metrics (
6566 enabled = config ["ENABLE_PROMETHEUS_METRICS" ],
6667 prometheus_dir = config ["PROMETHEUS_MULTIPROC_DIR" ],
@@ -108,7 +109,9 @@ async def middleware_log_response_and_api_metric(
108109 response_time_seconds = response_time_seconds ,
109110 status_code = response .status_code ,
110111 )
111-
112+ logger .debug (
113+ f"Vieweing metrics associated with the registry { list (app .metrics ._registry .collect ())= } "
114+ )
112115 return response
113116
114117 return app
Original file line number Diff line number Diff line change 33from cdispyutils .metrics import BaseMetrics
44
55from gen3workflow .config import config
6+ from gen3workflow import logger
67
78
89class Metrics (BaseMetrics ):
910 def __init__ (self , prometheus_dir : str , enabled : bool = True ) -> None :
11+
1012 super ().__init__ (
1113 prometheus_dir = config ["PROMETHEUS_MULTIPROC_DIR" ], enabled = enabled
1214 )
15+ logger .debug (f"Create a dummy metric for testing purposes: " )
16+ self .add_create_task_api_interaction (
17+ method = "GET" ,
18+ path = "/ga4gh/tes/v1/tasks" ,
19+ response_time_seconds = 2.30 ,
20+ status_code = "404" ,
21+ )
1322
1423 def add_create_task_api_interaction (
1524 self ,
You can’t perform that action at this time.
0 commit comments