Add ZMQ send debugging to identify data transmission issues

Added detailed logging for ZMQ data sending to see exactly what
data is being transmitted and whether sends are successful.
This will help identify if the issue is in data format, sending,
or dashboard reception.
This commit is contained in:
Christoffer Martinsson 2025-10-16 00:00:40 +02:00
parent 6bc2ffd94b
commit 925988896a

View File

@ -218,8 +218,10 @@ impl SmartAgent {
/// Send individual metric data via ZMQ /// Send individual metric data via ZMQ
async fn send_metric_data(&self, agent_type: &AgentType, data: &serde_json::Value) { async fn send_metric_data(&self, agent_type: &AgentType, data: &serde_json::Value) {
if let Err(e) = self.send_metrics(agent_type, data).await { info!("Sending {} metric data: {}", format!("{:?}", agent_type), data);
error!("Failed to send {} metrics: {}", format!("{:?}", agent_type), e); match self.send_metrics(agent_type, data).await {
Ok(()) => info!("Successfully sent {} metrics via ZMQ", format!("{:?}", agent_type)),
Err(e) => error!("Failed to send {} metrics: {}", format!("{:?}", agent_type), e),
} }
} }