diff --git a/Cargo.toml b/Cargo.toml index 8e1441fd..7f1cc215 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,4 +18,4 @@ documentation = "https://docs.rs/tardis/" repository = "https://github.com/ideal-world/tardis" edition = "2021" license = "MIT/Apache-2.0" -rust-version = "1.64" +rust-version = "1.72" \ No newline at end of file diff --git a/examples/tracing-otlp/config/conf-default.toml b/examples/tracing-otlp/config/conf-default.toml index feafd37f..92f3e674 100644 --- a/examples/tracing-otlp/config/conf-default.toml +++ b/examples/tracing-otlp/config/conf-default.toml @@ -8,11 +8,16 @@ version = "1.0.0" port = 8089 doc_urls = [["test env", "http://localhost:8089/"]] -[fw.db] -url = "postgres://postgres:ENC(5892ae51dbeedacdf10ba4c0d7af42a7)@localhost:5432/test" +# [fw.db] +# url = "postgres://postgres:ENC(5892ae51dbeedacdf10ba4c0d7af42a7)@localhost:5432/test" [fw.log] -level = "info" +level = "debug" + +[fw.log.tracing] +# https://www.jaegertracing.io/docs/1.49/getting-started/ +# endpoint = "http://localhost:4318/" endpoint = "http://localhost:4317" +# protocol = "http/protobuf" protocol = "grpc" server_name = "tracing示例" diff --git a/examples/tracing-otlp/src/main.rs b/examples/tracing-otlp/src/main.rs index c9fa5bde..592e5475 100644 --- a/examples/tracing-otlp/src/main.rs +++ b/examples/tracing-otlp/src/main.rs @@ -13,13 +13,12 @@ mod route; /// #[tokio::main] async fn main() -> TardisResult<()> { - env::set_var("RUST_LOG", "debug"); env::set_var("PROFILE", "default"); // Initial configuration TardisFuns::init(Some("config")).await?; // Register the processor and start the web service TardisFuns::web_server().add_route(Api).await.start().await; - web_server.await; + TardisFuns::web_server().await; Ok(()) } diff --git a/examples/tracing-otlp/src/route.rs b/examples/tracing-otlp/src/route.rs index 7aa4af35..536bce56 100644 --- a/examples/tracing-otlp/src/route.rs +++ b/examples/tracing-otlp/src/route.rs @@ -6,7 +6,7 @@ use tardis::web::web_resp::{TardisApiResult, TardisResp}; use crate::processor::{self, TaskKind}; -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct Api; #[poem_openapi::OpenApi] diff --git a/examples/websocket/src/processor.rs b/examples/websocket/src/processor.rs index 30810790..e1b65e6d 100644 --- a/examples/websocket/src/processor.rs +++ b/examples/websocket/src/processor.rs @@ -17,7 +17,7 @@ impl Page { #[oai(path = "/echo", method = "get")] async fn echo(&self) -> Html<&'static str> { Html( - r###" + r##"