From 7b9d264ef98719331d972218e260405ed7e4aa2b Mon Sep 17 00:00:00 2001 From: Egor Matveev Date: Sun, 15 Jun 2025 17:08:15 +0300 Subject: [PATCH] fix --- .deploy/deploy-dev.yaml | 2 -- daemons/metrics.py | 2 +- run.sh | 2 +- utils/queues.py | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.deploy/deploy-dev.yaml b/.deploy/deploy-dev.yaml index 1c9a06f..227877a 100644 --- a/.deploy/deploy-dev.yaml +++ b/.deploy/deploy-dev.yaml @@ -38,5 +38,3 @@ networks: external: true queues-development: external: true - monitoring: - external: true diff --git a/daemons/metrics.py b/daemons/metrics.py index 465de1b..304d0d6 100644 --- a/daemons/metrics.py +++ b/daemons/metrics.py @@ -13,7 +13,7 @@ class Daemon(base.Daemon): for file in os.listdir('/usr/src/metrics'): data = open(f'/usr/src/metrics/{file}', 'r').read() payload = json.loads(data) - resp = post('http://monitoring:1237/api/v1/metrics/task', json=payload) + resp = post('http://queues:1239/api/v1/metric', json=payload) if resp.status_code == 202: print("Metric ok") else: diff --git a/run.sh b/run.sh index c4967bc..1826c2e 100644 --- a/run.sh +++ b/run.sh @@ -4,7 +4,7 @@ python3 main.py $1 & # Start the second process -# python3 main.py metrics & +python3 main.py metrics & # Wait for any process to exit wait -n diff --git a/utils/queues.py b/utils/queues.py index b62f807..5adf3f4 100644 --- a/utils/queues.py +++ b/utils/queues.py @@ -60,7 +60,7 @@ class TasksHandlerMixin: print(f'finish task with id {task["id"]}') except: print(f'Failed to finish task id={task["id"]}') - # self._send_metric(start, end, success) + self._send_metric(start, end, success) @property def queue_name(self):