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 };