Skip to content

Commit

Permalink
do not send metrics as json
Browse files Browse the repository at this point in the history
  • Loading branch information
nvuillam committed Aug 16, 2024
1 parent b74e0b7 commit 7591e2c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions megalinter/reporters/ApiReporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,18 +316,18 @@ def send_to_metrics_api(self):
logging.info("[Api Reporter Metrics] Using Bearer Token")
try:
response = session.post(
self.api_metrics_url, headers=headers, json=self.metrics_payload
self.api_metrics_url, headers=headers, data=self.metrics_payload
)
if 200 <= response.status_code < 300:
logging.info(
f"[Api Reporter Metrics] Successfully posted data to {self.api_metrics_url}"
)
if self.is_notif_api_debug_active():
logging.info("[Api Reporter Metrics] " + json.dumps(obj=self.metrics_payload, indent=True))
logging.info("[Api Reporter Metrics] " + self.metrics_payload)
else:
logging.warning(
f"[Api Reporter Metrics] Error posting data to {self.api_metrics_url} ({response.status_code})\n"
f"[Api Reporter Metrics] API request: {json.dumps(obj=self.metrics_payload, indent=True)}\n"
f"[Api Reporter Metrics] API request: {self.metrics_payload}\n"
f"[Api Reporter Metrics] API response: {response.text}"
)
except ConnectionError as e:
Expand Down

0 comments on commit 7591e2c

Please sign in to comment.