diff --git a/Cargo.toml b/Cargo.toml index 70b9ea1680..3092889e71 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,13 +38,13 @@ debug = 1 async-std = "1.10" async-trait = "0.1" bytes = "1" -env_logger = "0.10" # env_logger requires a newer MSRV +env_logger = { version = "0.10", default-features = false } # env_logger requires a newer MSRV futures-core = "0.3" futures-executor = "0.3" -futures-util = "0.3" -hyper = "0.14" -http = "0.2" -isahc = "1.4" +futures-util = { version = "0.3", default-features = false } +hyper = { version = "0.14", default-features = false } +http = { version = "0.2", default-features = false } +isahc = { version = "1.4", default-features = false } log = "0.4" once_cell = "1.13" ordered-float = "4.0" @@ -52,17 +52,17 @@ pin-project-lite = "0.2" prost = "0.12" prost-build = "0.12" prost-types = "0.12" -rand = "0.8" +rand = { version = "0.8", default-features = false } reqwest = { version = "0.11", default-features = false } -serde = "1.0" +serde = { version = "1.0", default-features = false } serde_json = "1.0" temp-env = "0.3.6" -thiserror = "1" -tonic = "0.11" +thiserror = { version = "1", default-features = false } +tonic = { version = "0.11", default-features = false } tonic-build = "0.11" -tokio = "1" +tokio = { version = "1", default-features = false } tokio-stream = "0.1.1" -tracing = "0.1" -tracing-core = "0.1" -tracing-subscriber = "0.3" -url = "2.2" +tracing = { version = "0.1", default-features = false } +tracing-core = { version = "0.1", default-features = false } +tracing-subscriber = { version = "0.3", default-features = false } +url = { version = "2.2", default-features = false } diff --git a/examples/tracing-grpc/Cargo.toml b/examples/tracing-grpc/Cargo.toml index fc807e8937..c4ba3e1105 100644 --- a/examples/tracing-grpc/Cargo.toml +++ b/examples/tracing-grpc/Cargo.toml @@ -15,7 +15,7 @@ path = "src/client.rs" [dependencies] opentelemetry = { path = "../../opentelemetry" } -opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["rt-tokio"]} +opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["rt-tokio"] } opentelemetry-stdout = { path = "../../opentelemetry-stdout", features = ["trace"] } prost = { workspace = true } tokio = { workspace = true, features = ["full"] } diff --git a/opentelemetry-jaeger-propagator/Cargo.toml b/opentelemetry-jaeger-propagator/Cargo.toml index 088cd316c8..7c2ed97496 100644 --- a/opentelemetry-jaeger-propagator/Cargo.toml +++ b/opentelemetry-jaeger-propagator/Cargo.toml @@ -25,13 +25,8 @@ opentelemetry = { version = "0.21", default-features = false, features = [ "trace", ], path = "../opentelemetry" } -tonic = { workspace = true, optional = true } -prost = { workspace = true, optional = true } -prost-types = { workspace = true, optional = true } - [dev-dependencies] opentelemetry_sdk = { features = ["testing"], path = "../opentelemetry-sdk" } [features] default = [] -integration_test = [] diff --git a/opentelemetry-jaeger-propagator/src/lib.rs b/opentelemetry-jaeger-propagator/src/lib.rs index 79f08a3355..c8047eb11b 100644 --- a/opentelemetry-jaeger-propagator/src/lib.rs +++ b/opentelemetry-jaeger-propagator/src/lib.rs @@ -88,8 +88,5 @@ /// /// [jaeger propagation format]: https://www.jaegertracing.io/docs/1.18/client-libraries/#propagation-format pub mod propagator; -#[cfg(feature = "integration_test")] -#[doc(hidden)] -pub mod testing; pub use propagator::Propagator; diff --git a/opentelemetry-jaeger-propagator/src/testing/jaeger_api_v2.rs b/opentelemetry-jaeger-propagator/src/testing/jaeger_api_v2.rs deleted file mode 100644 index 467ef9f2b1..0000000000 --- a/opentelemetry-jaeger-propagator/src/testing/jaeger_api_v2.rs +++ /dev/null @@ -1,448 +0,0 @@ -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct KeyValue { - #[prost(string, tag = "1")] - pub key: ::prost::alloc::string::String, - #[prost(enumeration = "ValueType", tag = "2")] - pub v_type: i32, - #[prost(string, tag = "3")] - pub v_str: ::prost::alloc::string::String, - #[prost(bool, tag = "4")] - pub v_bool: bool, - #[prost(int64, tag = "5")] - pub v_int64: i64, - #[prost(double, tag = "6")] - pub v_float64: f64, - #[prost(bytes = "vec", tag = "7")] - pub v_binary: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Log { - #[prost(message, optional, tag = "1")] - pub timestamp: ::core::option::Option<::prost_types::Timestamp>, - #[prost(message, repeated, tag = "2")] - pub fields: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SpanRef { - #[prost(bytes = "vec", tag = "1")] - pub trace_id: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub span_id: ::prost::alloc::vec::Vec, - #[prost(enumeration = "SpanRefType", tag = "3")] - pub ref_type: i32, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Process { - #[prost(string, tag = "1")] - pub service_name: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub tags: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Span { - #[prost(bytes = "vec", tag = "1")] - pub trace_id: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub span_id: ::prost::alloc::vec::Vec, - #[prost(string, tag = "3")] - pub operation_name: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "4")] - pub references: ::prost::alloc::vec::Vec, - #[prost(uint32, tag = "5")] - pub flags: u32, - #[prost(message, optional, tag = "6")] - pub start_time: ::core::option::Option<::prost_types::Timestamp>, - #[prost(message, optional, tag = "7")] - pub duration: ::core::option::Option<::prost_types::Duration>, - #[prost(message, repeated, tag = "8")] - pub tags: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "9")] - pub logs: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "10")] - pub process: ::core::option::Option, - #[prost(string, tag = "11")] - pub process_id: ::prost::alloc::string::String, - #[prost(string, repeated, tag = "12")] - pub warnings: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Trace { - #[prost(message, repeated, tag = "1")] - pub spans: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "2")] - pub process_map: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "3")] - pub warnings: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// Nested message and enum types in `Trace`. -pub mod trace { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct ProcessMapping { - #[prost(string, tag = "1")] - pub process_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub process: ::core::option::Option, - } -} -/// Note that both Span and Batch may contain a Process. -/// This is different from the Thrift model which was only used -/// for transport, because Proto model is also used by the backend -/// as the domain model, where once a batch is received it is split -/// into individual spans which are all processed independently, -/// and therefore they all need a Process. As far as on-the-wire -/// semantics, both Batch and Spans in the same message may contain -/// their own instances of Process, with span.Process taking priority -/// over batch.Process. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Batch { - #[prost(message, repeated, tag = "1")] - pub spans: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub process: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DependencyLink { - #[prost(string, tag = "1")] - pub parent: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub child: ::prost::alloc::string::String, - #[prost(uint64, tag = "3")] - pub call_count: u64, - #[prost(string, tag = "4")] - pub source: ::prost::alloc::string::String, -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ValueType { - String = 0, - Bool = 1, - Int64 = 2, - Float64 = 3, - Binary = 4, -} -impl ValueType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - ValueType::String => "STRING", - ValueType::Bool => "BOOL", - ValueType::Int64 => "INT64", - ValueType::Float64 => "FLOAT64", - ValueType::Binary => "BINARY", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "STRING" => Some(Self::String), - "BOOL" => Some(Self::Bool), - "INT64" => Some(Self::Int64), - "FLOAT64" => Some(Self::Float64), - "BINARY" => Some(Self::Binary), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum SpanRefType { - ChildOf = 0, - FollowsFrom = 1, -} -impl SpanRefType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - SpanRefType::ChildOf => "CHILD_OF", - SpanRefType::FollowsFrom => "FOLLOWS_FROM", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "CHILD_OF" => Some(Self::ChildOf), - "FOLLOWS_FROM" => Some(Self::FollowsFrom), - _ => None, - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetTraceRequest { - #[prost(bytes = "vec", tag = "1")] - pub trace_id: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SpansResponseChunk { - #[prost(message, repeated, tag = "1")] - pub spans: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ArchiveTraceRequest { - #[prost(bytes = "vec", tag = "1")] - pub trace_id: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ArchiveTraceResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TraceQueryParameters { - #[prost(string, tag = "1")] - pub service_name: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub operation_name: ::prost::alloc::string::String, - #[prost(map = "string, string", tag = "3")] - pub tags: - ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, - #[prost(message, optional, tag = "4")] - pub start_time_min: ::core::option::Option<::prost_types::Timestamp>, - #[prost(message, optional, tag = "5")] - pub start_time_max: ::core::option::Option<::prost_types::Timestamp>, - #[prost(message, optional, tag = "6")] - pub duration_min: ::core::option::Option<::prost_types::Duration>, - #[prost(message, optional, tag = "7")] - pub duration_max: ::core::option::Option<::prost_types::Duration>, - #[prost(int32, tag = "8")] - pub search_depth: i32, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FindTracesRequest { - #[prost(message, optional, tag = "1")] - pub query: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetServicesRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetServicesResponse { - #[prost(string, repeated, tag = "1")] - pub services: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetOperationsRequest { - #[prost(string, tag = "1")] - pub service: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub span_kind: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Operation { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub span_kind: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetOperationsResponse { - /// deprecated - #[prost(string, repeated, tag = "1")] - pub operation_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "2")] - pub operations: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDependenciesRequest { - #[prost(message, optional, tag = "1")] - pub start_time: ::core::option::Option<::prost_types::Timestamp>, - #[prost(message, optional, tag = "2")] - pub end_time: ::core::option::Option<::prost_types::Timestamp>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDependenciesResponse { - #[prost(message, repeated, tag = "1")] - pub dependencies: ::prost::alloc::vec::Vec, -} -/// Generated client implementations. -pub mod query_service_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct QueryServiceClient { - inner: tonic::client::Grpc, - } - impl QueryServiceClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: std::convert::TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryServiceClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - QueryServiceClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - pub async fn get_trace( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result< - tonic::Response>, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/jaeger.api_v2.QueryService/GetTrace"); - self.inner - .server_streaming(request.into_request(), path, codec) - .await - } - pub async fn archive_trace( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/jaeger.api_v2.QueryService/ArchiveTrace"); - self.inner.unary(request.into_request(), path, codec).await - } - pub async fn find_traces( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result< - tonic::Response>, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/jaeger.api_v2.QueryService/FindTraces"); - self.inner - .server_streaming(request.into_request(), path, codec) - .await - } - pub async fn get_services( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/jaeger.api_v2.QueryService/GetServices"); - self.inner.unary(request.into_request(), path, codec).await - } - pub async fn get_operations( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/jaeger.api_v2.QueryService/GetOperations"); - self.inner.unary(request.into_request(), path, codec).await - } - pub async fn get_dependencies( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/jaeger.api_v2.QueryService/GetDependencies"); - self.inner.unary(request.into_request(), path, codec).await - } - } -} diff --git a/opentelemetry-jaeger-propagator/src/testing/mod.rs b/opentelemetry-jaeger-propagator/src/testing/mod.rs deleted file mode 100644 index 36d2c3a222..0000000000 --- a/opentelemetry-jaeger-propagator/src/testing/mod.rs +++ /dev/null @@ -1,85 +0,0 @@ -#[allow(unused, missing_docs, clippy::derive_partial_eq_without_eq)] -// tonic don't derive Eq. We shouldn't manually change it.)] -pub mod jaeger_api_v2; - -#[allow(missing_docs)] -pub mod jaeger_client { - use crate::testing::jaeger_api_v2::query_service_client::QueryServiceClient; - use crate::testing::jaeger_api_v2::{ - FindTracesRequest, GetServicesRequest, GetTraceRequest, Span as JaegerSpan, - TraceQueryParameters, - }; - use tonic::transport::Channel; - - #[derive(Debug)] - pub struct JaegerTestClient { - query_service_client: QueryServiceClient, - } - - impl JaegerTestClient { - pub fn new(jaeger_url: &'static str) -> JaegerTestClient { - let channel = Channel::from_static(jaeger_url).connect_lazy(); - - JaegerTestClient { - query_service_client: QueryServiceClient::new(channel), - } - } - - /// Check if the jaeger contains the service - pub async fn contain_service(&mut self, service_name: &String) -> bool { - self.query_service_client - .get_services(GetServicesRequest {}) - .await - .unwrap() - .get_ref() - .services - .iter() - .any(|svc_name| *svc_name == *service_name) - } - - /// Find trace by trace id. - /// Note that `trace_id` should be a u128 in hex. - pub async fn get_trace(&mut self, trace_id: String) -> Vec { - let trace_id = u128::from_str_radix(trace_id.as_ref(), 16).expect("invalid trace id"); - let mut resp = self - .query_service_client - .get_trace(GetTraceRequest { - trace_id: trace_id.to_be_bytes().into(), - }) - .await - .unwrap(); - - if let Some(spans) = resp - .get_mut() - .message() - .await - .expect("jaeger returns error") - { - spans.spans - } else { - vec![] - } - } - - /// Find traces belongs the service. - /// It assumes the service exists. - pub async fn find_traces_from_services(&mut self, service_name: &str) -> Vec { - let request = FindTracesRequest { - query: Some(TraceQueryParameters { - service_name: service_name.to_owned(), - ..Default::default() - }), - }; - self.query_service_client - .find_traces(request) - .await - .unwrap() - .get_mut() - .message() - .await - .expect("jaeger returns error") - .unwrap_or_default() - .spans - } - } -} diff --git a/opentelemetry-jaeger/Cargo.toml b/opentelemetry-jaeger/Cargo.toml index a27a54ef06..cd0768967b 100644 --- a/opentelemetry-jaeger/Cargo.toml +++ b/opentelemetry-jaeger/Cargo.toml @@ -43,7 +43,7 @@ tokio = { workspace = true, features = ["net", "sync"], optional = true } wasm-bindgen = { version = "0.2", optional = true } wasm-bindgen-futures = { version = "0.4.18", optional = true } -tonic = { workspace = true, optional = true } +tonic = { workspace = true, optional = true, features = ["transport", "codegen", "prost"] } prost = { workspace = true, optional = true } prost-types = { workspace = true, optional = true } diff --git a/opentelemetry-prometheus/Cargo.toml b/opentelemetry-prometheus/Cargo.toml index 46d7be9fba..e524257168 100644 --- a/opentelemetry-prometheus/Cargo.toml +++ b/opentelemetry-prometheus/Cargo.toml @@ -22,7 +22,7 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] once_cell = { workspace = true } opentelemetry = { version = "0.21", path = "../opentelemetry", default-features = false, features = ["metrics"] } -opentelemetry_sdk = { version = "0.21", path = "../opentelemetry-sdk", default-features = false, features = ["metrics"] } +opentelemetry_sdk = { version = "0.21", path = "../opentelemetry-sdk", default-features = false, features = ["metrics"] } prometheus = "0.13" protobuf = "2.14" diff --git a/scripts/lint.sh b/scripts/lint.sh index 130d983c6c..13b728f156 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -10,9 +10,24 @@ cargo_feature() { } if rustup component add clippy; then - cargo clippy --all-targets --all-features -- \ - `# Exit with a nonzero code if there are clippy warnings` \ - -Dwarnings + crates=( "opentelemetry" + "opentelemetry-http" + "opentelemetry-jaeger" + "opentelemetry-jaeger-propagator" + "opentelemetry-appender-log" + "opentelemetry-appender-tracing" + "opentelemetry-otlp" + "opentelemetry-prometheus" + "opentelemetry-proto" + "opentelemetry-sdk" + "opentelemetry-semantic-conventions" + "opentelemetry-stdout" + "opentelemetry-zipkin") + for crate in "${crates[@]}"; do + cargo clippy --manifest-path=$crate/Cargo.toml --all-targets --all-features -- \ + `# Exit with a nonzero code if there are clippy warnings` \ + -Dwarnings + done cargo_feature opentelemetry "trace,metrics,logs,logs_level_enabled,testing"