From e27b15aa90ea9dff50702417ff7fdecdbd24fdcc Mon Sep 17 00:00:00 2001 From: jmjoy <918734043@qq.com> Date: Sun, 3 Jul 2022 20:50:51 +0800 Subject: [PATCH 1/2] Rename crate name skywalking_rust to skywalking. --- Cargo.toml | 2 +- README.md | 4 ++-- e2e/Cargo.lock | 4 ++-- e2e/Cargo.toml | 2 +- e2e/src/main.rs | 10 +++++----- examples/simple_trace_report.rs | 4 ++-- src/context/trace_context.rs | 4 ++-- src/reporter/grpc.rs | 4 ++-- tests/propagation.rs | 10 +++++----- tests/trace_context.rs | 12 ++++++------ 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1d2715e..d7302c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ # [package] -name = "skywalking_rust" +name = "skywalking" version = "0.1.0" authors = ["Apache SkyWalking Developers (dev@skywalking.apache.org)"] edition = "2021" diff --git a/README.md b/README.md index 918a7f9..3c9682b 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,8 @@ context after the span finished. # Example ```rust -use skywalking_rust::context::trace_context::TracingContext; -use skywalking_rust::reporter::grpc::Reporter; +use skywalking::context::trace_context::TracingContext; +use skywalking::reporter::grpc::Reporter; use tokio; async fn handle_request(reporter: ContextReporter) { diff --git a/e2e/Cargo.lock b/e2e/Cargo.lock index 502f22d..59764e9 100644 --- a/e2e/Cargo.lock +++ b/e2e/Cargo.lock @@ -184,7 +184,7 @@ name = "e2e" version = "0.1.0" dependencies = [ "hyper", - "skywalking_rust", + "skywalking", "structopt", "tokio", ] @@ -777,7 +777,7 @@ dependencies = [ ] [[package]] -name = "skywalking_rust" +name = "skywalking" version = "0.1.0" dependencies = [ "async-stream", diff --git a/e2e/Cargo.toml b/e2e/Cargo.toml index 577612e..2f655e7 100644 --- a/e2e/Cargo.toml +++ b/e2e/Cargo.toml @@ -23,7 +23,7 @@ edition = "2021" publish = false [dependencies] -skywalking_rust = { path = ".." } +skywalking = { path = ".." } hyper = { version = "0.14", features = ["full"] } tokio = { version = "1", features = ["full"] } structopt = "0.3" diff --git a/e2e/src/main.rs b/e2e/src/main.rs index 71f36f0..cf3884c 100644 --- a/e2e/src/main.rs +++ b/e2e/src/main.rs @@ -18,11 +18,11 @@ use hyper::client::HttpConnector; use hyper::service::{make_service_fn, service_fn}; use hyper::{Body, Client, Method, Request, Response, Server, StatusCode}; -use skywalking_rust::context::propagation::context::SKYWALKING_HTTP_CONTEXT_HEADER_KEY; -use skywalking_rust::context::propagation::decoder::decode_propagation; -use skywalking_rust::context::propagation::encoder::encode_propagation; -use skywalking_rust::context::trace_context::TracingContext; -use skywalking_rust::reporter::grpc::Reporter; +use skywalking::context::propagation::context::SKYWALKING_HTTP_CONTEXT_HEADER_KEY; +use skywalking::context::propagation::decoder::decode_propagation; +use skywalking::context::propagation::encoder::encode_propagation; +use skywalking::context::trace_context::TracingContext; +use skywalking::reporter::grpc::Reporter; use std::convert::Infallible; use std::error::Error; use std::net::SocketAddr; diff --git a/examples/simple_trace_report.rs b/examples/simple_trace_report.rs index 1c16c67..2bbdf00 100644 --- a/examples/simple_trace_report.rs +++ b/examples/simple_trace_report.rs @@ -17,8 +17,8 @@ // use std::error::Error; -use skywalking_rust::context::trace_context::TracingContext; -use skywalking_rust::reporter::grpc::Reporter; +use skywalking::context::trace_context::TracingContext; +use skywalking::reporter::grpc::Reporter; #[tokio::main] async fn main() -> Result<(), Box> { diff --git a/src/context/trace_context.rs b/src/context/trace_context.rs index 87911d1..36abff2 100644 --- a/src/context/trace_context.rs +++ b/src/context/trace_context.rs @@ -34,7 +34,7 @@ use super::system_time::UnixTimeStampFetcher; /// # Example /// /// ``` -/// use skywalking_rust::context::trace_context::TracingContext; +/// use skywalking::context::trace_context::TracingContext; /// /// async fn handle_request() { /// let mut ctx = TracingContext::default("svc", "ins"); @@ -206,7 +206,7 @@ impl TracingContext { /// Generate a new trace context using the propagated context. /// They should be propagated on `sw8` header in HTTP request with encoded form. - /// You can retrieve decoded context with `skywalking_rust::context::propagation::encoder::encode_propagation` + /// You can retrieve decoded context with `skywalking::context::propagation::encoder::encode_propagation` pub fn from_propagation_context( service_name: &str, instance_name: &str, diff --git a/src/reporter/grpc.rs b/src/reporter/grpc.rs index 218383c..984ec79 100644 --- a/src/reporter/grpc.rs +++ b/src/reporter/grpc.rs @@ -52,8 +52,8 @@ impl Reporter { /// /// use tokio; /// - /// use skywalking_rust::context::trace_context::TracingContext; - /// use skywalking_rust::reporter::grpc::Reporter; + /// use skywalking::context::trace_context::TracingContext; + /// use skywalking::reporter::grpc::Reporter; /// /// #[tokio::main] /// async fn main () -> Result<(), Box> { diff --git a/tests/propagation.rs b/tests/propagation.rs index b4cd61e..52e5435 100644 --- a/tests/propagation.rs +++ b/tests/propagation.rs @@ -15,11 +15,11 @@ // #![allow(unused_imports)] -use skywalking_rust::common::time::TimeFetcher; -use skywalking_rust::context::propagation::context::PropagationContext; -use skywalking_rust::context::propagation::decoder::decode_propagation; -use skywalking_rust::context::propagation::encoder::encode_propagation; -use skywalking_rust::context::trace_context::TracingContext; +use skywalking::common::time::TimeFetcher; +use skywalking::context::propagation::context::PropagationContext; +use skywalking::context::propagation::decoder::decode_propagation; +use skywalking::context::propagation::encoder::encode_propagation; +use skywalking::context::trace_context::TracingContext; use std::sync::Arc; struct MockTimeFetcher {} diff --git a/tests/trace_context.rs b/tests/trace_context.rs index a06a12d..f50dff6 100644 --- a/tests/trace_context.rs +++ b/tests/trace_context.rs @@ -17,12 +17,12 @@ #![allow(unused_imports)] use prost::Message; -use skywalking_rust::common::time::TimeFetcher; -use skywalking_rust::context::propagation::context::PropagationContext; -use skywalking_rust::context::propagation::decoder::decode_propagation; -use skywalking_rust::context::propagation::encoder::encode_propagation; -use skywalking_rust::context::trace_context::TracingContext; -use skywalking_rust::skywalking_proto::v3::{ +use skywalking::common::time::TimeFetcher; +use skywalking::context::propagation::context::PropagationContext; +use skywalking::context::propagation::decoder::decode_propagation; +use skywalking::context::propagation::encoder::encode_propagation; +use skywalking::context::trace_context::TracingContext; +use skywalking::skywalking_proto::v3::{ KeyStringValuePair, Log, RefType, SegmentObject, SegmentReference, SpanLayer, SpanObject, SpanType, }; From b74f993433616307f410f970f7d3cd67b34ea9c4 Mon Sep 17 00:00:00 2001 From: jmjoy <918734043@qq.com> Date: Sun, 3 Jul 2022 22:15:21 +0800 Subject: [PATCH 2/2] Bump to 0.2.0. --- Cargo.toml | 2 +- README.md | 4 ++-- e2e/Cargo.lock | 4 ++-- e2e/Cargo.toml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d7302c4..c47c7b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ [package] name = "skywalking" -version = "0.1.0" +version = "0.2.0" authors = ["Apache SkyWalking Developers (dev@skywalking.apache.org)"] edition = "2021" description = "Apache SkyWalking Rust Agent" diff --git a/README.md b/README.md index 3c9682b..8f940c5 100644 --- a/README.md +++ b/README.md @@ -69,10 +69,10 @@ async fn main() { ``` # How to compile? -If you have `skywalking-rust-(VERSION).crate`, you can unpack it with the way as follows: +If you have `skywalking-(VERSION).crate`, you can unpack it with the way as follows: ``` -tar -xvzf skywalking-rust-(VERSION).crate +tar -xvzf skywalking-(VERSION).crate ``` Using `cargo build` generates a library. If you'd like to verify the behavior, we recommend to use `cargo run --example simple_trace_report` diff --git a/e2e/Cargo.lock b/e2e/Cargo.lock index 59764e9..5b4f089 100644 --- a/e2e/Cargo.lock +++ b/e2e/Cargo.lock @@ -181,7 +181,7 @@ dependencies = [ [[package]] name = "e2e" -version = "0.1.0" +version = "0.2.0" dependencies = [ "hyper", "skywalking", @@ -778,7 +778,7 @@ dependencies = [ [[package]] name = "skywalking" -version = "0.1.0" +version = "0.2.0" dependencies = [ "async-stream", "base64", diff --git a/e2e/Cargo.toml b/e2e/Cargo.toml index 2f655e7..8ffc6e4 100644 --- a/e2e/Cargo.toml +++ b/e2e/Cargo.toml @@ -17,7 +17,7 @@ # [package] name = "e2e" -version = "0.1.0" +version = "0.2.0" authors = ["Shikugawa "] edition = "2021" publish = false