diff --git a/opentelemetry-stackdriver/CHANGELOG.md b/opentelemetry-stackdriver/CHANGELOG.md index ee83f1bd..5b36355d 100644 --- a/opentelemetry-stackdriver/CHANGELOG.md +++ b/opentelemetry-stackdriver/CHANGELOG.md @@ -2,8 +2,11 @@ ## vNext +## v0.22.0 + ### Added +- Update to opentelemetry v0.25.0, opentelemetry_sdk v0.25.0, opentelemetry-semantic-conventions v0.25.0 - Added support for `MonitoredResource::CloudRunJob` [#100](https://github.com/open-telemetry/opentelemetry-rust-contrib/issues/100) ## v0.21.0 diff --git a/opentelemetry-stackdriver/Cargo.toml b/opentelemetry-stackdriver/Cargo.toml index 90a6230e..716d7f28 100644 --- a/opentelemetry-stackdriver/Cargo.toml +++ b/opentelemetry-stackdriver/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "opentelemetry-stackdriver" -version = "0.21.0" +version = "0.22.0" description = "A Rust opentelemetry exporter that uploads traces to Google Stackdriver trace." documentation = "https://docs.rs/opentelemetry-stackdriver/" repository = "https://github.com/open-telemetry/opentelemetry-rust-contrib" @@ -14,9 +14,9 @@ async-trait = "0.1.48" gcp_auth = { version = "0.12", optional = true } hex = "0.4" http = "1" -opentelemetry = "0.24" -opentelemetry_sdk = { version = "0.24", features = ["trace"] } -opentelemetry-semantic-conventions = "0.16" +opentelemetry = {workspace = true} +opentelemetry_sdk = { workspace = true, features = ["trace"] } +opentelemetry-semantic-conventions = { workspace = true} prost = "0.13" prost-types = "0.13" thiserror = "1.0.30" @@ -42,4 +42,4 @@ tokio = "1" tonic-build = "0.12" walkdir = "2.3.2" futures-util = { version = "0.3", default-features = false } -opentelemetry = { version = "0.24", features = ["testing"] } +opentelemetry = { workspace = true, features = ["testing"] } diff --git a/opentelemetry-stackdriver/src/proto/api.rs b/opentelemetry-stackdriver/src/proto/api.rs index 047fda77..f0a744b1 100644 --- a/opentelemetry-stackdriver/src/proto/api.rs +++ b/opentelemetry-stackdriver/src/proto/api.rs @@ -408,14 +408,14 @@ impl LaunchStage { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - LaunchStage::Unspecified => "LAUNCH_STAGE_UNSPECIFIED", - LaunchStage::Unimplemented => "UNIMPLEMENTED", - LaunchStage::Prelaunch => "PRELAUNCH", - LaunchStage::EarlyAccess => "EARLY_ACCESS", - LaunchStage::Alpha => "ALPHA", - LaunchStage::Beta => "BETA", - LaunchStage::Ga => "GA", - LaunchStage::Deprecated => "DEPRECATED", + Self::Unspecified => "LAUNCH_STAGE_UNSPECIFIED", + Self::Unimplemented => "UNIMPLEMENTED", + Self::Prelaunch => "PRELAUNCH", + Self::EarlyAccess => "EARLY_ACCESS", + Self::Alpha => "ALPHA", + Self::Beta => "BETA", + Self::Ga => "GA", + Self::Deprecated => "DEPRECATED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -772,14 +772,14 @@ impl ClientLibraryOrganization { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ClientLibraryOrganization::Unspecified => "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED", - ClientLibraryOrganization::Cloud => "CLOUD", - ClientLibraryOrganization::Ads => "ADS", - ClientLibraryOrganization::Photos => "PHOTOS", - ClientLibraryOrganization::StreetView => "STREET_VIEW", - ClientLibraryOrganization::Shopping => "SHOPPING", - ClientLibraryOrganization::Geo => "GEO", - ClientLibraryOrganization::GenerativeAi => "GENERATIVE_AI", + Self::Unspecified => "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED", + Self::Cloud => "CLOUD", + Self::Ads => "ADS", + Self::Photos => "PHOTOS", + Self::StreetView => "STREET_VIEW", + Self::Shopping => "SHOPPING", + Self::Geo => "GEO", + Self::GenerativeAi => "GENERATIVE_AI", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -817,9 +817,9 @@ impl ClientLibraryDestination { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ClientLibraryDestination::Unspecified => "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED", - ClientLibraryDestination::Github => "GITHUB", - ClientLibraryDestination::PackageManager => "PACKAGE_MANAGER", + Self::Unspecified => "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED", + Self::Github => "GITHUB", + Self::PackageManager => "PACKAGE_MANAGER", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -895,15 +895,15 @@ impl FieldBehavior { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - FieldBehavior::Unspecified => "FIELD_BEHAVIOR_UNSPECIFIED", - FieldBehavior::Optional => "OPTIONAL", - FieldBehavior::Required => "REQUIRED", - FieldBehavior::OutputOnly => "OUTPUT_ONLY", - FieldBehavior::InputOnly => "INPUT_ONLY", - FieldBehavior::Immutable => "IMMUTABLE", - FieldBehavior::UnorderedList => "UNORDERED_LIST", - FieldBehavior::NonEmptyDefault => "NON_EMPTY_DEFAULT", - FieldBehavior::Identifier => "IDENTIFIER", + Self::Unspecified => "FIELD_BEHAVIOR_UNSPECIFIED", + Self::Optional => "OPTIONAL", + Self::Required => "REQUIRED", + Self::OutputOnly => "OUTPUT_ONLY", + Self::InputOnly => "INPUT_ONLY", + Self::Immutable => "IMMUTABLE", + Self::UnorderedList => "UNORDERED_LIST", + Self::NonEmptyDefault => "NON_EMPTY_DEFAULT", + Self::Identifier => "IDENTIFIER", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1075,9 +1075,9 @@ pub mod resource_descriptor { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - History::Unspecified => "HISTORY_UNSPECIFIED", - History::OriginallySinglePattern => "ORIGINALLY_SINGLE_PATTERN", - History::FutureMultiPattern => "FUTURE_MULTI_PATTERN", + Self::Unspecified => "HISTORY_UNSPECIFIED", + Self::OriginallySinglePattern => "ORIGINALLY_SINGLE_PATTERN", + Self::FutureMultiPattern => "FUTURE_MULTI_PATTERN", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1113,8 +1113,8 @@ pub mod resource_descriptor { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Style::Unspecified => "STYLE_UNSPECIFIED", - Style::DeclarativeFriendly => "DECLARATIVE_FRIENDLY", + Self::Unspecified => "STYLE_UNSPECIFIED", + Self::DeclarativeFriendly => "DECLARATIVE_FRIENDLY", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1200,9 +1200,9 @@ pub mod label_descriptor { /// (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", + Self::String => "STRING", + Self::Bool => "BOOL", + Self::Int64 => "INT64", } } /// Creates an enum from field names used in the ProtoBuf definition. diff --git a/opentelemetry-stackdriver/src/proto/devtools/cloudtrace/v2.rs b/opentelemetry-stackdriver/src/proto/devtools/cloudtrace/v2.rs index 4fc7fdd2..f03abc27 100644 --- a/opentelemetry-stackdriver/src/proto/devtools/cloudtrace/v2.rs +++ b/opentelemetry-stackdriver/src/proto/devtools/cloudtrace/v2.rs @@ -170,9 +170,9 @@ pub mod span { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Type::Unspecified => "TYPE_UNSPECIFIED", - Type::Sent => "SENT", - Type::Received => "RECEIVED", + Self::Unspecified => "TYPE_UNSPECIFIED", + Self::Sent => "SENT", + Self::Received => "RECEIVED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -258,9 +258,9 @@ pub mod span { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Type::Unspecified => "TYPE_UNSPECIFIED", - Type::ChildLinkedSpan => "CHILD_LINKED_SPAN", - Type::ParentLinkedSpan => "PARENT_LINKED_SPAN", + Self::Unspecified => "TYPE_UNSPECIFIED", + Self::ChildLinkedSpan => "CHILD_LINKED_SPAN", + Self::ParentLinkedSpan => "PARENT_LINKED_SPAN", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -320,12 +320,12 @@ pub mod span { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - SpanKind::Unspecified => "SPAN_KIND_UNSPECIFIED", - SpanKind::Internal => "INTERNAL", - SpanKind::Server => "SERVER", - SpanKind::Client => "CLIENT", - SpanKind::Producer => "PRODUCER", - SpanKind::Consumer => "CONSUMER", + Self::Unspecified => "SPAN_KIND_UNSPECIFIED", + Self::Internal => "INTERNAL", + Self::Server => "SERVER", + Self::Client => "CLIENT", + Self::Producer => "PRODUCER", + Self::Consumer => "CONSUMER", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -472,7 +472,13 @@ pub struct BatchWriteSpansRequest { } /// Generated client implementations. pub mod trace_service_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value + )] use tonic::codegen::http::Uri; use tonic::codegen::*; /// Service for collecting and viewing traces and spans within a trace. @@ -568,10 +574,7 @@ pub mod trace_service_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -590,10 +593,7 @@ pub mod trace_service_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( diff --git a/opentelemetry-stackdriver/src/proto/logging/type.rs b/opentelemetry-stackdriver/src/proto/logging/type.rs index 41430639..93a3b8d6 100644 --- a/opentelemetry-stackdriver/src/proto/logging/type.rs +++ b/opentelemetry-stackdriver/src/proto/logging/type.rs @@ -113,15 +113,15 @@ impl LogSeverity { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - LogSeverity::Default => "DEFAULT", - LogSeverity::Debug => "DEBUG", - LogSeverity::Info => "INFO", - LogSeverity::Notice => "NOTICE", - LogSeverity::Warning => "WARNING", - LogSeverity::Error => "ERROR", - LogSeverity::Critical => "CRITICAL", - LogSeverity::Alert => "ALERT", - LogSeverity::Emergency => "EMERGENCY", + Self::Default => "DEFAULT", + Self::Debug => "DEBUG", + Self::Info => "INFO", + Self::Notice => "NOTICE", + Self::Warning => "WARNING", + Self::Error => "ERROR", + Self::Critical => "CRITICAL", + Self::Alert => "ALERT", + Self::Emergency => "EMERGENCY", } } /// Creates an enum from field names used in the ProtoBuf definition. diff --git a/opentelemetry-stackdriver/src/proto/logging/v2.rs b/opentelemetry-stackdriver/src/proto/logging/v2.rs index ae2168a7..b76e9ff1 100644 --- a/opentelemetry-stackdriver/src/proto/logging/v2.rs +++ b/opentelemetry-stackdriver/src/proto/logging/v2.rs @@ -594,9 +594,9 @@ pub mod tail_log_entries_response { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Reason::Unspecified => "REASON_UNSPECIFIED", - Reason::RateLimit => "RATE_LIMIT", - Reason::NotConsumed => "NOT_CONSUMED", + Self::Unspecified => "REASON_UNSPECIFIED", + Self::RateLimit => "RATE_LIMIT", + Self::NotConsumed => "NOT_CONSUMED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -613,7 +613,13 @@ pub mod tail_log_entries_response { } /// Generated client implementations. pub mod logging_service_v2_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value + )] use tonic::codegen::http::Uri; use tonic::codegen::*; /// Service for ingesting and querying logs. @@ -705,10 +711,7 @@ pub mod logging_service_v2_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -734,10 +737,7 @@ pub mod logging_service_v2_client { ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -760,10 +760,7 @@ pub mod logging_service_v2_client { ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -785,10 +782,7 @@ pub mod logging_service_v2_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -808,10 +802,7 @@ pub mod logging_service_v2_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -834,10 +825,7 @@ pub mod logging_service_v2_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( diff --git a/opentelemetry-stackdriver/tests/generate.rs b/opentelemetry-stackdriver/tests/generate.rs index d7284fca..d32c21a4 100644 --- a/opentelemetry-stackdriver/tests/generate.rs +++ b/opentelemetry-stackdriver/tests/generate.rs @@ -55,7 +55,7 @@ fn generated_code_is_fresh() { .build_client(true) .build_server(false) .out_dir(&tmp_dir) - .compile(&schemas, &["proto"]) + .compile_protos(&schemas, &["proto"]) .unwrap(); // Next, wrangle the generated file names into a directory hierarchy.