fixed json in api call
This commit is contained in:
@@ -15,13 +15,12 @@ use std::time::Duration;
|
||||
use crate::docker::serverclientcomm::handle_server_message;
|
||||
use crate::hardware::HardwareInfo;
|
||||
use crate::models::{
|
||||
Acknowledgment, DockerContainer, DockerMetricDto, DockerRegistrationDto, HeartbeatDto,
|
||||
Acknowledgment, DockerMetricDto, DockerRegistrationDto, HeartbeatDto,
|
||||
IdResponse, MetricDto, RegistrationDto, ServerMessage,
|
||||
};
|
||||
|
||||
use anyhow::Result;
|
||||
use reqwest::{Client, StatusCode};
|
||||
use serde::Serialize;
|
||||
use std::error::Error;
|
||||
use tokio::time::sleep;
|
||||
|
||||
@@ -431,7 +430,8 @@ pub async fn send_docker_metrics(
|
||||
) -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||
let client = Client::new();
|
||||
let url = format!("{}/monitoring/docker-metric", base_url);
|
||||
println!("Docker Metrics: {:?}", docker_metrics);
|
||||
|
||||
println!("Docker Metrics: {}", serde_json::to_string_pretty(&docker_metrics)?);
|
||||
|
||||
match client.post(&url).json(&docker_metrics).send().await {
|
||||
Ok(res) => println!(
|
||||
|
||||
Reference in New Issue
Block a user