Skip to content

Commit

Permalink
[shippingservice] Update Rust deps and add TelemetryResourceDetector (#…
Browse files Browse the repository at this point in the history
…972)

* Update Rust deps and add TelemetryResourceDetector

* Changelog

* Update min versions

---------

Co-authored-by: Austin Parker <austin@ap2.io>
  • Loading branch information
julianocosta89 and austinlparker authored Jul 17, 2023
1 parent 9f8806f commit 28a6c74
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 47 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ release.
([#872](https://github.com/open-telemetry/opentelemetry-demo/pull/872))
* [frontendproxy]Envoy expose a route for the collector to route frontend spans
([#938](https://github.com/open-telemetry/opentelemetry-demo/pull/938))
* [shippingservice] Update Rust dependencies and add TelemetryResourceDetector
([#972](https://github.com/open-telemetry/opentelemetry-demo/pull/972))

## 1.4.0

Expand Down
124 changes: 88 additions & 36 deletions src/shippingservice/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions src/shippingservice/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ reqwest = { version = "0.11", default-features = false, features = ["json"] }
prost = "0.11"
prost-types = "0.11"
tokio = { version = "1.28", features = ["macros", "rt-multi-thread"] }
opentelemetry = { version = "0.18", features = ["rt-tokio", "trace"] }
opentelemetry-semantic-conventions = "0.10.0"
opentelemetry_api = { version = "0.18" }
opentelemetry-http = "0.7.0"
opentelemetry-otlp = "0.11.0"
log = "0.4.17"
opentelemetry = { version = "0.19", features = ["rt-tokio", "trace"] }
opentelemetry-semantic-conventions = "0.11.0"
opentelemetry_api = { version = "0.19" }
opentelemetry-http = "0.8.0"
opentelemetry-otlp = "0.12.0"
log = "0.4.19"
simplelog = "0.12"
reqwest-middleware = "0.2.0"
reqwest-tracing = { version = "0.4.0", features = ["opentelemetry_0_18"] }
reqwest-middleware = "0.2.2"
reqwest-tracing = { version = "0.4.5", features = ["opentelemetry_0_18"] }
tracing = { version = "0.1", features = ["max_level_debug", "release_max_level_info"] }
tracing-opentelemetry = "0.18.0"
tracing-opentelemetry = "0.19.0"
tracing-subscriber = "0.3"

[dependencies.uuid]
Expand Down
5 changes: 3 additions & 2 deletions src/shippingservice/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use opentelemetry::{
propagation::TraceContextPropagator,
resource::{
OsResourceDetector, ProcessResourceDetector, ResourceDetector,
EnvResourceDetector,
EnvResourceDetector, TelemetryResourceDetector,
SdkProvidedResourceDetector,
},
trace as sdktrace,
Expand Down Expand Up @@ -46,6 +46,7 @@ fn init_tracer() -> Result<sdktrace::Tracer, TraceError> {
let process_resource = ProcessResourceDetector.detect(Duration::from_secs(0));
let sdk_resource = SdkProvidedResourceDetector.detect(Duration::from_secs(0));
let env_resource = EnvResourceDetector::new().detect(Duration::from_secs(0));
let telemetry_resource = TelemetryResourceDetector.detect(Duration::from_secs(0));
opentelemetry_otlp::new_pipeline()
.tracing()
.with_exporter(
Expand All @@ -61,7 +62,7 @@ fn init_tracer() -> Result<sdktrace::Tracer, TraceError> {
)
.with_trace_config(
sdktrace::config()
.with_resource(os_resource.merge(&process_resource).merge(&sdk_resource).merge(&env_resource)),
.with_resource(os_resource.merge(&process_resource).merge(&sdk_resource).merge(&env_resource).merge(&telemetry_resource)),
)
.install_batch(opentelemetry::runtime::Tokio)
}
Expand Down

0 comments on commit 28a6c74

Please sign in to comment.