Skip to content
Snippets Groups Projects
Commit 2dd3b9f8 authored by Jan Hartig's avatar Jan Hartig
Browse files

Fix metrics stuff

parent 56b9da6c
Branches
No related tags found
1 merge request!6Fix metrics stuff
...@@ -107,11 +107,16 @@ def main(end): ...@@ -107,11 +107,16 @@ def main(end):
try: try:
try: try:
auth = HTTPBasicAuth(config["METRICS"]["USER"], config["MONITORING"]["PASS"]) auth = HTTPBasicAuth(config["METRICS"]["USER"], config["METRICS"]["PASS"])
except KeyError: except KeyError:
auth = None auth = None
requests.post(config["METRICS"]["URL"], json=metrics, auth=auth) r = requests.post(config["METRICS"]["URL"], json=metrics, auth=auth)
try:
r.raise_for_status()
except requests.HTTPError as e:
print("[MAILSERVICE] Could not send metrics to server: {}".format(e))
except KeyError: except KeyError:
pass pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment