2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-25 12:01:24 +00:00

Update opentelemetry, tracing-log

This commit is contained in:
asonix 2023-12-05 12:57:38 -06:00
parent b8d0e7b391
commit 7f153c6430
3 changed files with 59 additions and 63 deletions

99
Cargo.lock generated
View file

@ -920,6 +920,12 @@ version = "0.28.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
[[package]]
name = "glob"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
[[package]] [[package]]
name = "h2" name = "h2"
version = "0.3.22" version = "0.3.22"
@ -1391,26 +1397,32 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
[[package]] [[package]]
name = "opentelemetry" name = "opentelemetry"
version = "0.20.0" version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9591d937bc0e6d2feb6f71a559540ab300ea49955229c347a517a28d27784c54" checksum = "1e32339a5dc40459130b3bd269e9892439f55b33e772d2a9d402a789baaf4e8a"
dependencies = [ dependencies = [
"opentelemetry_api", "futures-core",
"opentelemetry_sdk", "futures-sink",
"indexmap 2.1.0",
"js-sys",
"once_cell",
"pin-project-lite",
"thiserror",
"urlencoding",
] ]
[[package]] [[package]]
name = "opentelemetry-otlp" name = "opentelemetry-otlp"
version = "0.13.0" version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e5e5a5c4135864099f3faafbe939eb4d7f9b80ebf68a8448da961b32a7c1275" checksum = "f24cda83b20ed2433c68241f918d0f6fdec8b1d43b7a9590ab4420c5095ca930"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"futures-core", "futures-core",
"http", "http",
"opentelemetry",
"opentelemetry-proto", "opentelemetry-proto",
"opentelemetry-semantic-conventions", "opentelemetry-semantic-conventions",
"opentelemetry_api",
"opentelemetry_sdk", "opentelemetry_sdk",
"prost 0.11.9", "prost 0.11.9",
"thiserror", "thiserror",
@ -1420,11 +1432,11 @@ dependencies = [
[[package]] [[package]]
name = "opentelemetry-proto" name = "opentelemetry-proto"
version = "0.3.0" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1e3f814aa9f8c905d0ee4bde026afd3b2577a97c10e1699912e3e44f0c4cbeb" checksum = "a2e155ce5cc812ea3d1dffbd1539aed653de4bf4882d60e6e04dcf0901d674e1"
dependencies = [ dependencies = [
"opentelemetry_api", "opentelemetry",
"opentelemetry_sdk", "opentelemetry_sdk",
"prost 0.11.9", "prost 0.11.9",
"tonic 0.9.2", "tonic 0.9.2",
@ -1432,47 +1444,30 @@ dependencies = [
[[package]] [[package]]
name = "opentelemetry-semantic-conventions" name = "opentelemetry-semantic-conventions"
version = "0.12.0" version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73c9f9340ad135068800e7f1b24e9e09ed9e7143f5bf8518ded3d3ec69789269" checksum = "f5774f1ef1f982ef2a447f6ee04ec383981a3ab99c8e77a1a7b30182e65bbc84"
dependencies = [ dependencies = [
"opentelemetry", "opentelemetry",
] ]
[[package]]
name = "opentelemetry_api"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a81f725323db1b1206ca3da8bb19874bbd3f57c3bcd59471bfb04525b265b9b"
dependencies = [
"futures-channel",
"futures-util",
"indexmap 1.9.3",
"js-sys",
"once_cell",
"pin-project-lite",
"thiserror",
"urlencoding",
]
[[package]] [[package]]
name = "opentelemetry_sdk" name = "opentelemetry_sdk"
version = "0.20.0" version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa8e705a0612d48139799fcbaba0d4a90f06277153e43dd2bdc16c6f0edd8026" checksum = "968ba3f2ca03e90e5187f5e4f46c791ef7f2c163ae87789c8ce5f5ca3b7b7de5"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"crossbeam-channel", "crossbeam-channel",
"futures-channel", "futures-channel",
"futures-executor", "futures-executor",
"futures-util", "futures-util",
"glob",
"once_cell", "once_cell",
"opentelemetry_api", "opentelemetry",
"ordered-float", "ordered-float",
"percent-encoding", "percent-encoding",
"rand", "rand",
"regex",
"serde_json",
"thiserror", "thiserror",
"tokio", "tokio",
"tokio-stream", "tokio-stream",
@ -1480,9 +1475,9 @@ dependencies = [
[[package]] [[package]]
name = "ordered-float" name = "ordered-float"
version = "3.9.2" version = "4.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1e1c390732d15f1d48471625cd92d154e66db2c56645e29a9cd26f4699f72dc" checksum = "a76df7075c7d4d01fdcb46c912dd17fba5b60c78ea480b475f2b6ab6f666584e"
dependencies = [ dependencies = [
"num-traits", "num-traits",
] ]
@ -1644,6 +1639,7 @@ dependencies = [
"once_cell", "once_cell",
"opentelemetry", "opentelemetry",
"opentelemetry-otlp", "opentelemetry-otlp",
"opentelemetry_sdk",
"pin-project-lite", "pin-project-lite",
"quick-xml 0.30.0", "quick-xml 0.30.0",
"reqwest", "reqwest",
@ -1667,7 +1663,7 @@ dependencies = [
"tracing-actix-web", "tracing-actix-web",
"tracing-error", "tracing-error",
"tracing-futures", "tracing-futures",
"tracing-log 0.1.4", "tracing-log",
"tracing-opentelemetry", "tracing-opentelemetry",
"tracing-subscriber", "tracing-subscriber",
"url", "url",
@ -2724,17 +2720,6 @@ dependencies = [
"tracing", "tracing",
] ]
[[package]]
name = "tracing-log"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2"
dependencies = [
"log",
"once_cell",
"tracing-core",
]
[[package]] [[package]]
name = "tracing-log" name = "tracing-log"
version = "0.2.0" version = "0.2.0"
@ -2748,18 +2733,20 @@ dependencies = [
[[package]] [[package]]
name = "tracing-opentelemetry" name = "tracing-opentelemetry"
version = "0.21.0" version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75327c6b667828ddc28f5e3f169036cb793c3f588d83bf0f262a7f062ffed3c8" checksum = "c67ac25c5407e7b961fafc6f7e9aa5958fd297aada2d20fa2ae1737357e55596"
dependencies = [ dependencies = [
"js-sys",
"once_cell", "once_cell",
"opentelemetry", "opentelemetry",
"opentelemetry_sdk", "opentelemetry_sdk",
"smallvec", "smallvec",
"tracing", "tracing",
"tracing-core", "tracing-core",
"tracing-log 0.1.4", "tracing-log",
"tracing-subscriber", "tracing-subscriber",
"web-time",
] ]
[[package]] [[package]]
@ -2789,7 +2776,7 @@ dependencies = [
"thread_local", "thread_local",
"tracing", "tracing",
"tracing-core", "tracing-core",
"tracing-log 0.2.0", "tracing-log",
"tracing-serde", "tracing-serde",
] ]
@ -2997,6 +2984,16 @@ dependencies = [
"wasm-bindgen", "wasm-bindgen",
] ]
[[package]]
name = "web-time"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57099a701fb3a8043f993e8228dc24229c7b942e2b009a1b962e54489ba1d3bf"
dependencies = [
"js-sys",
"wasm-bindgen",
]
[[package]] [[package]]
name = "webpki-roots" name = "webpki-roots"
version = "0.25.3" version = "0.25.3"

View file

@ -32,8 +32,9 @@ md-5 = "0.10.5"
mime = "0.3.1" mime = "0.3.1"
num_cpus = "1.13" num_cpus = "1.13"
once_cell = "1.4.0" once_cell = "1.4.0"
opentelemetry = { version = "0.20", features = ["rt-tokio"] } opentelemetry = "0.21"
opentelemetry-otlp = "0.13" opentelemetry_sdk = { version = "0.21", features = ["rt-tokio"] }
opentelemetry-otlp = "0.14"
pin-project-lite = "0.2.7" pin-project-lite = "0.2.7"
quick-xml = { version = "0.30.0", features = ["serialize"] } quick-xml = { version = "0.30.0", features = ["serialize"] }
reqwest = { version = "0.11.18", default-features = false, features = ["json", "rustls-tls", "stream"] } reqwest = { version = "0.11.18", default-features = false, features = ["json", "rustls-tls", "stream"] }
@ -59,8 +60,8 @@ toml = "0.8.0"
tracing = "0.1.15" tracing = "0.1.15"
tracing-error = "0.2.0" tracing-error = "0.2.0"
tracing-futures = "0.2.4" tracing-futures = "0.2.4"
tracing-log = "0.1.2" tracing-log = "0.2.0"
tracing-opentelemetry = "0.21" tracing-opentelemetry = "0.22"
tracing-subscriber = { version = "0.3.0", features = [ tracing-subscriber = { version = "0.3.0", features = [
"ansi", "ansi",
"env-filter", "env-filter",
@ -73,6 +74,6 @@ url = { version = "2.2", features = ["serde"] }
uuid = { version = "1", features = ["v4", "serde"] } uuid = { version = "1", features = ["v4", "serde"] }
[dependencies.tracing-actix-web] [dependencies.tracing-actix-web]
version = "0.7.7" version = "0.7.9"
default-features = false default-features = false
features = ["opentelemetry_0_20"] features = ["opentelemetry_0_21"]

View file

@ -1,10 +1,8 @@
use crate::config::{LogFormat, OpenTelemetry, Tracing}; use crate::config::{LogFormat, OpenTelemetry, Tracing};
use console_subscriber::ConsoleLayer; use console_subscriber::ConsoleLayer;
use opentelemetry::{ use opentelemetry::KeyValue;
sdk::{propagation::TraceContextPropagator, Resource},
KeyValue,
};
use opentelemetry_otlp::WithExportConfig; use opentelemetry_otlp::WithExportConfig;
use opentelemetry_sdk::{propagation::TraceContextPropagator, Resource};
use tracing::subscriber::set_global_default; use tracing::subscriber::set_global_default;
use tracing_error::ErrorLayer; use tracing_error::ErrorLayer;
use tracing_log::LogTracer; use tracing_log::LogTracer;
@ -65,7 +63,7 @@ where
let tracer = opentelemetry_otlp::new_pipeline() let tracer = opentelemetry_otlp::new_pipeline()
.tracing() .tracing()
.with_trace_config( .with_trace_config(
opentelemetry::sdk::trace::config().with_resource(Resource::new(vec![ opentelemetry_sdk::trace::config().with_resource(Resource::new(vec![
KeyValue::new("service.name", otel.service_name.clone()), KeyValue::new("service.name", otel.service_name.clone()),
])), ])),
) )
@ -74,7 +72,7 @@ where
.tonic() .tonic()
.with_endpoint(url.as_str()), .with_endpoint(url.as_str()),
) )
.install_batch(opentelemetry::runtime::Tokio)?; .install_batch(opentelemetry_sdk::runtime::Tokio)?;
let otel_layer = tracing_opentelemetry::layer() let otel_layer = tracing_opentelemetry::layer()
.with_tracer(tracer) .with_tracer(tracer)