Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish otel-stackdriver v0.22.0 #113

Merged
merged 7 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions opentelemetry-stackdriver/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions opentelemetry-stackdriver/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
Expand All @@ -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"] }
72 changes: 36 additions & 36 deletions opentelemetry-stackdriver/src/proto/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,14 @@
/// (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",

Check warning on line 418 in opentelemetry-stackdriver/src/proto/api.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/api.rs#L411-L418

Added lines #L411 - L418 were not covered by tests
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand Down Expand Up @@ -772,14 +772,14 @@
/// (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",

Check warning on line 782 in opentelemetry-stackdriver/src/proto/api.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/api.rs#L775-L782

Added lines #L775 - L782 were not covered by tests
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand Down Expand Up @@ -817,9 +817,9 @@
/// (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",

Check warning on line 822 in opentelemetry-stackdriver/src/proto/api.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/api.rs#L820-L822

Added lines #L820 - L822 were not covered by tests
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand Down Expand Up @@ -895,15 +895,15 @@
/// (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",

Check warning on line 906 in opentelemetry-stackdriver/src/proto/api.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/api.rs#L898-L906

Added lines #L898 - L906 were not covered by tests
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand Down Expand Up @@ -1075,9 +1075,9 @@
/// (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",

Check warning on line 1080 in opentelemetry-stackdriver/src/proto/api.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/api.rs#L1078-L1080

Added lines #L1078 - L1080 were not covered by tests
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand Down Expand Up @@ -1113,8 +1113,8 @@
/// (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",

Check warning on line 1117 in opentelemetry-stackdriver/src/proto/api.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/api.rs#L1116-L1117

Added lines #L1116 - L1117 were not covered by tests
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand Down Expand Up @@ -1200,9 +1200,9 @@
/// (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",

Check warning on line 1205 in opentelemetry-stackdriver/src/proto/api.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/api.rs#L1203-L1205

Added lines #L1203 - L1205 were not covered by tests
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand Down
42 changes: 21 additions & 21 deletions opentelemetry-stackdriver/src/proto/devtools/cloudtrace/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@
/// (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",

Check warning on line 175 in opentelemetry-stackdriver/src/proto/devtools/cloudtrace/v2.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/devtools/cloudtrace/v2.rs#L173-L175

Added lines #L173 - L175 were not covered by tests
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand Down Expand Up @@ -258,9 +258,9 @@
/// (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",

Check warning on line 263 in opentelemetry-stackdriver/src/proto/devtools/cloudtrace/v2.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/devtools/cloudtrace/v2.rs#L261-L263

Added lines #L261 - L263 were not covered by tests
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand Down Expand Up @@ -320,12 +320,12 @@
/// (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",

Check warning on line 328 in opentelemetry-stackdriver/src/proto/devtools/cloudtrace/v2.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/devtools/cloudtrace/v2.rs#L323-L328

Added lines #L323 - L328 were not covered by tests
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand Down Expand Up @@ -472,7 +472,13 @@
}
/// 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.
Expand Down Expand Up @@ -568,10 +574,7 @@
request: impl tonic::IntoRequest<super::BatchWriteSpansRequest>,
) -> std::result::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()),
)
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))

Check warning on line 577 in opentelemetry-stackdriver/src/proto/devtools/cloudtrace/v2.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/devtools/cloudtrace/v2.rs#L577

Added line #L577 was not covered by tests
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
Expand All @@ -590,10 +593,7 @@
request: impl tonic::IntoRequest<super::Span>,
) -> std::result::Result<tonic::Response<super::Span>, 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()))

Check warning on line 596 in opentelemetry-stackdriver/src/proto/devtools/cloudtrace/v2.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/devtools/cloudtrace/v2.rs#L596

Added line #L596 was not covered by tests
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
Expand Down
18 changes: 9 additions & 9 deletions opentelemetry-stackdriver/src/proto/logging/type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@
/// (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",

Check warning on line 124 in opentelemetry-stackdriver/src/proto/logging/type.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/logging/type.rs#L116-L124

Added lines #L116 - L124 were not covered by tests
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand Down
44 changes: 16 additions & 28 deletions opentelemetry-stackdriver/src/proto/logging/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,9 @@
/// (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",

Check warning on line 599 in opentelemetry-stackdriver/src/proto/logging/v2.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/logging/v2.rs#L597-L599

Added lines #L597 - L599 were not covered by tests
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand All @@ -613,7 +613,13 @@
}
/// 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.
Expand Down Expand Up @@ -705,10 +711,7 @@
request: impl tonic::IntoRequest<super::DeleteLogRequest>,
) -> std::result::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()),
)
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))

Check warning on line 714 in opentelemetry-stackdriver/src/proto/logging/v2.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/logging/v2.rs#L714

Added line #L714 was not covered by tests
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
Expand All @@ -734,10 +737,7 @@
) -> std::result::Result<tonic::Response<super::WriteLogEntriesResponse>, 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()))

Check warning on line 740 in opentelemetry-stackdriver/src/proto/logging/v2.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/logging/v2.rs#L740

Added line #L740 was not covered by tests
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
Expand All @@ -760,10 +760,7 @@
) -> std::result::Result<tonic::Response<super::ListLogEntriesResponse>, 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()))

Check warning on line 763 in opentelemetry-stackdriver/src/proto/logging/v2.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/logging/v2.rs#L763

Added line #L763 was not covered by tests
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
Expand All @@ -785,10 +782,7 @@
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()))

Check warning on line 785 in opentelemetry-stackdriver/src/proto/logging/v2.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/logging/v2.rs#L785

Added line #L785 was not covered by tests
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
Expand All @@ -808,10 +802,7 @@
request: impl tonic::IntoRequest<super::ListLogsRequest>,
) -> std::result::Result<tonic::Response<super::ListLogsResponse>, 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()))

Check warning on line 805 in opentelemetry-stackdriver/src/proto/logging/v2.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/logging/v2.rs#L805

Added line #L805 was not covered by tests
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
Expand All @@ -834,10 +825,7 @@
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()))

Check warning on line 828 in opentelemetry-stackdriver/src/proto/logging/v2.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stackdriver/src/proto/logging/v2.rs#L828

Added line #L828 was not covered by tests
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-stackdriver/tests/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading