Додан моніторінг застосунку
Додани веб компоненти карточок територій та повідомлень
This commit is contained in:
13
ws/middleware/pushToMetrics.js
Normal file
13
ws/middleware/pushToMetrics.js
Normal file
@@ -0,0 +1,13 @@
|
||||
async function pushToMetrics(metric) {
|
||||
if (!metric || !metric.type) return;
|
||||
|
||||
const payload = { ...metric, timestamp: Date.now() };
|
||||
|
||||
fetch("http://metrics:4005/push", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(payload)
|
||||
}).catch(err => console.error("Metrics push error:", err));
|
||||
}
|
||||
|
||||
module.exports = { pushToMetrics };
|
||||
Reference in New Issue
Block a user