diff --git a/Cargo.lock b/Cargo.lock index 8d0eeb25f..45d6d1562 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1712,13 +1712,13 @@ dependencies = [ "ddcommon", "duplicate", "hyper 0.14.31", - "log", "rmp-serde", "serde", "serde_json", "serial_test", "tempfile", "tokio", + "tracing", ] [[package]] diff --git a/trace-mini-agent/Cargo.toml b/trace-mini-agent/Cargo.toml index 0de5d941d..381691fa5 100644 --- a/trace-mini-agent/Cargo.toml +++ b/trace-mini-agent/Cargo.toml @@ -15,7 +15,7 @@ anyhow = "1.0" hyper = { version = "0.14", default-features = false, features = ["server", "backports", "deprecated"] } tokio = { version = "1", features = ["macros", "rt-multi-thread"]} async-trait = "0.1.64" -log = "0.4" +tracing = { version = "0.1", default-features = false } serde = { version = "1.0.145", features = ["derive"] } serde_json = "1.0" ddcommon = { path = "../ddcommon" } diff --git a/trace-mini-agent/src/env_verifier.rs b/trace-mini-agent/src/env_verifier.rs index b00cb7e23..f06f30d6f 100644 --- a/trace-mini-agent/src/env_verifier.rs +++ b/trace-mini-agent/src/env_verifier.rs @@ -4,7 +4,6 @@ use async_trait::async_trait; use hyper::body::HttpBody; use hyper::{Body, Client, Method, Request, Response}; -use log::{debug, error}; use serde::{Deserialize, Serialize}; use std::env; use std::fs; @@ -12,6 +11,7 @@ use std::path::Path; use std::process; use std::sync::Arc; use std::time::{Duration, Instant}; +use tracing::{debug, error}; use datadog_trace_utils::trace_utils; diff --git a/trace-mini-agent/src/http_utils.rs b/trace-mini-agent/src/http_utils.rs index b5cf5763e..b17162f2c 100644 --- a/trace-mini-agent/src/http_utils.rs +++ b/trace-mini-agent/src/http_utils.rs @@ -6,8 +6,8 @@ use hyper::{ http::{self, HeaderMap}, Body, Response, StatusCode, }; -use log::{error, info}; use serde_json::json; +use tracing::{error, info}; /// Does two things: /// 1. Logs the given message. A success status code (within 200-299) will cause an info log to be diff --git a/trace-mini-agent/src/mini_agent.rs b/trace-mini-agent/src/mini_agent.rs index e6e24b5bf..9d2b96368 100644 --- a/trace-mini-agent/src/mini_agent.rs +++ b/trace-mini-agent/src/mini_agent.rs @@ -3,13 +3,13 @@ use hyper::service::{make_service_fn, service_fn}; use hyper::{http, Body, Method, Request, Response, Server, StatusCode}; -use log::{debug, error, info}; use serde_json::json; use std::convert::Infallible; use std::net::SocketAddr; use std::sync::Arc; use std::time::Instant; use tokio::sync::mpsc::{self, Receiver, Sender}; +use tracing::{debug, error, info}; use crate::http_utils::log_and_create_http_response; use crate::{config, env_verifier, stats_flusher, stats_processor, trace_flusher, trace_processor}; diff --git a/trace-mini-agent/src/stats_flusher.rs b/trace-mini-agent/src/stats_flusher.rs index 9d7bed76b..e2fa3395f 100644 --- a/trace-mini-agent/src/stats_flusher.rs +++ b/trace-mini-agent/src/stats_flusher.rs @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 use async_trait::async_trait; -use log::{debug, error, info}; use std::{sync::Arc, time}; use tokio::sync::{mpsc::Receiver, Mutex}; +use tracing::{debug, error, info}; use datadog_trace_protobuf::pb; use datadog_trace_utils::stats_utils; diff --git a/trace-mini-agent/src/stats_processor.rs b/trace-mini-agent/src/stats_processor.rs index 38539f5e4..ca431df74 100644 --- a/trace-mini-agent/src/stats_processor.rs +++ b/trace-mini-agent/src/stats_processor.rs @@ -6,8 +6,8 @@ use std::time::UNIX_EPOCH; use async_trait::async_trait; use hyper::{http, Body, Request, Response, StatusCode}; -use log::info; use tokio::sync::mpsc::Sender; +use tracing::info; use datadog_trace_protobuf::pb; use datadog_trace_utils::stats_utils; diff --git a/trace-mini-agent/src/trace_flusher.rs b/trace-mini-agent/src/trace_flusher.rs index 7987e7646..b93e023f2 100644 --- a/trace-mini-agent/src/trace_flusher.rs +++ b/trace-mini-agent/src/trace_flusher.rs @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 use async_trait::async_trait; -use log::{error, info}; use std::{sync::Arc, time}; use tokio::sync::{mpsc::Receiver, Mutex}; +use tracing::{error, info}; use datadog_trace_utils::trace_utils; use datadog_trace_utils::trace_utils::SendData; diff --git a/trace-mini-agent/src/trace_processor.rs b/trace-mini-agent/src/trace_processor.rs index 07360dfa2..244f613cb 100644 --- a/trace-mini-agent/src/trace_processor.rs +++ b/trace-mini-agent/src/trace_processor.rs @@ -5,8 +5,8 @@ use std::sync::Arc; use async_trait::async_trait; use hyper::{http, Body, Request, Response, StatusCode}; -use log::info; use tokio::sync::mpsc::Sender; +use tracing::info; use datadog_trace_obfuscation::obfuscate::obfuscate_span; use datadog_trace_protobuf::pb;