From f2eb58e4a3f801e9967f4864a8819907d2d00e74 Mon Sep 17 00:00:00 2001 From: Rohit Chatterjee Date: Fri, 19 Jul 2024 07:35:23 +0530 Subject: [PATCH 1/2] reduce logging --- proxy/main.py | 12 ++++++------ proxy/service.py | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/proxy/main.py b/proxy/main.py index 5eafbf2..84ff4ea 100644 --- a/proxy/main.py +++ b/proxy/main.py @@ -499,7 +499,7 @@ def get_flow_runs( raise TypeError("limit must be an integer") if limit < 0: raise ValueError("limit must be positive") - logger.info("deployment_id=%s, limit=%s", deployment_id, limit) + # logger.info("deployment_id=%s, limit=%s", deployment_id, limit) try: flow_runs = get_flow_runs_by_deployment_id(deployment_id, limit, start_time_gt) except Exception as error: @@ -507,7 +507,7 @@ def get_flow_runs( raise HTTPException( status_code=400, detail="failed to fetch flow_runs for deployment" ) from error - logger.info("Found flow runs for deployment ID: %s", deployment_id) + # logger.info("Found flow runs for deployment ID: %s", deployment_id) return {"flow_runs": flow_runs} @@ -525,7 +525,7 @@ def get_flow_run_by_id(request: Request, flow_run_id): status_code=400, detail="failed to fetch flow_run " + flow_run_id ) from error - logger.info("Found flow run wth id - %s", flow_run_id) + # logger.info("Found flow run wth id - %s", flow_run_id) return flow_run @@ -558,7 +558,7 @@ def get_flow_run_logs_paginated(request: Request, flow_run_id: str, offset: int raise TypeError("offset must be an integer") if offset < 0: raise ValueError("offset must be positive") - logger.info("flow_run_id=%s, offset=%s", flow_run_id, offset) + # logger.info("flow_run_id=%s, offset=%s", flow_run_id, offset) try: return get_flow_run_logs(flow_run_id, offset) except Exception as error: @@ -574,7 +574,7 @@ def get_flow_run_logs_grouped(request: Request, flow_run_id: str): if not isinstance(flow_run_id, str): raise TypeError("flow_run_id must be a string") - logger.info("flow_run_id=%s", flow_run_id) + # logger.info("flow_run_id=%s", flow_run_id) try: return get_flow_run_logs_v2(flow_run_id) except Exception as error: @@ -589,7 +589,7 @@ def get_read_deployment(request: Request, deployment_id): """Fetch deployment and all its details""" if not isinstance(deployment_id, str): raise TypeError("deployment_id must be a string") - logger.info("deployment_id=%s", deployment_id) + # logger.info("deployment_id=%s", deployment_id) try: deployment = get_deployment(deployment_id) diff --git a/proxy/service.py b/proxy/service.py index e5f4b88..c1b838d 100644 --- a/proxy/service.py +++ b/proxy/service.py @@ -664,7 +664,7 @@ def get_deployment(deployment_id: str) -> dict: if not isinstance(deployment_id, str): raise TypeError("deployment_id must be a string") res = prefect_get(f"deployments/{deployment_id}") - logger.info("Fetched deployment with ID: %s", deployment_id) + # logger.info("Fetched deployment with ID: %s", deployment_id) return res @@ -706,7 +706,7 @@ def get_flow_runs_by_deployment_id( raise TypeError("limit must be an integer") if limit < 0: raise ValueError("limit must be a positive integer") - logger.info("fetching flow runs for deployment %s", deployment_id) + # logger.info("fetching flow runs for deployment %s", deployment_id) query = { "sort": "START_TIME_DESC", From cb42887e3a208f67eeefb727cb70657b9ec90757 Mon Sep 17 00:00:00 2001 From: Rohit Chatterjee Date: Mon, 22 Jul 2024 07:33:42 +0530 Subject: [PATCH 2/2] removed commented logging lines --- proxy/main.py | 7 ------- proxy/service.py | 2 -- 2 files changed, 9 deletions(-) diff --git a/proxy/main.py b/proxy/main.py index 84ff4ea..2deaab4 100644 --- a/proxy/main.py +++ b/proxy/main.py @@ -499,7 +499,6 @@ def get_flow_runs( raise TypeError("limit must be an integer") if limit < 0: raise ValueError("limit must be positive") - # logger.info("deployment_id=%s, limit=%s", deployment_id, limit) try: flow_runs = get_flow_runs_by_deployment_id(deployment_id, limit, start_time_gt) except Exception as error: @@ -507,7 +506,6 @@ def get_flow_runs( raise HTTPException( status_code=400, detail="failed to fetch flow_runs for deployment" ) from error - # logger.info("Found flow runs for deployment ID: %s", deployment_id) return {"flow_runs": flow_runs} @@ -525,8 +523,6 @@ def get_flow_run_by_id(request: Request, flow_run_id): status_code=400, detail="failed to fetch flow_run " + flow_run_id ) from error - # logger.info("Found flow run wth id - %s", flow_run_id) - return flow_run @@ -558,7 +554,6 @@ def get_flow_run_logs_paginated(request: Request, flow_run_id: str, offset: int raise TypeError("offset must be an integer") if offset < 0: raise ValueError("offset must be positive") - # logger.info("flow_run_id=%s, offset=%s", flow_run_id, offset) try: return get_flow_run_logs(flow_run_id, offset) except Exception as error: @@ -574,7 +569,6 @@ def get_flow_run_logs_grouped(request: Request, flow_run_id: str): if not isinstance(flow_run_id, str): raise TypeError("flow_run_id must be a string") - # logger.info("flow_run_id=%s", flow_run_id) try: return get_flow_run_logs_v2(flow_run_id) except Exception as error: @@ -589,7 +583,6 @@ def get_read_deployment(request: Request, deployment_id): """Fetch deployment and all its details""" if not isinstance(deployment_id, str): raise TypeError("deployment_id must be a string") - # logger.info("deployment_id=%s", deployment_id) try: deployment = get_deployment(deployment_id) diff --git a/proxy/service.py b/proxy/service.py index c1b838d..4cbf99e 100644 --- a/proxy/service.py +++ b/proxy/service.py @@ -664,7 +664,6 @@ def get_deployment(deployment_id: str) -> dict: if not isinstance(deployment_id, str): raise TypeError("deployment_id must be a string") res = prefect_get(f"deployments/{deployment_id}") - # logger.info("Fetched deployment with ID: %s", deployment_id) return res @@ -706,7 +705,6 @@ def get_flow_runs_by_deployment_id( raise TypeError("limit must be an integer") if limit < 0: raise ValueError("limit must be a positive integer") - # logger.info("fetching flow runs for deployment %s", deployment_id) query = { "sort": "START_TIME_DESC",