Skip to content

Commit

Permalink
fix(logging): adserver is very noisy for feedback requests, possibly …
Browse files Browse the repository at this point in the history
…affecting performance (#5351)
  • Loading branch information
majolo authored Feb 20, 2024
1 parent f6e08c2 commit a0c2ac4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions components/alibi-detect-server/adserver/cm_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ def process_event(self, inputs: Union[List, Dict], headers: Dict) -> Optional[Mo
"""
logging.info("PROCESSING Feedback Event.")
logging.info(str(headers))
logging.info("----")
logging.debug(str(headers))

metrics: List[Dict] = []
output: Dict = {}
Expand Down Expand Up @@ -161,7 +160,7 @@ def process_event(self, inputs: Union[List, Dict], headers: Dict) -> Optional[Mo
error, status_code=400, reason="METRICS_SERVER_ERROR"
)

logging.error(f"{truth}, {response}")
logging.info(f"truth: {truth}, response: {response}")
metrics_transformed = self.model.transform(truth, response)

metrics.extend(metrics_transformed.metrics)
Expand Down
6 changes: 3 additions & 3 deletions components/alibi-detect-server/adserver/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ def post(self):

if not self.reply_url == "":
logging.debug(json.dumps(revent.Properties()))
logging.info("binary CloudEvent")
logging.debug("binary CloudEvent")
for k, v in revent_headers.items():
logging.info("{0}: {1}\r\n".format(k, v))
logging.info(revent_data)
logging.debug("{0}: {1}\r\n".format(k, v))
logging.debug(revent_data)
forward_request(revent_headers, revent_data, self.reply_url)

self.set_header("Content-Type", "application/json")
Expand Down

0 comments on commit a0c2ac4

Please sign in to comment.