Disable all the old tracing stuff.
This commit is contained in:
parent
f6e539a40b
commit
1f10d3d064
15
Cargo.toml
15
Cargo.toml
@ -9,6 +9,7 @@ repository = "https://code.fizz.buzz/talexander/organic"
|
|||||||
readme = "README.org"
|
readme = "README.org"
|
||||||
keywords = ["emacs", "org-mode"]
|
keywords = ["emacs", "org-mode"]
|
||||||
categories = ["parsing"]
|
categories = ["parsing"]
|
||||||
|
resolver = "2"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "organic"
|
name = "organic"
|
||||||
@ -21,18 +22,20 @@ path = "src/main.rs"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nom = "7.1.1"
|
nom = "7.1.1"
|
||||||
opentelemetry = "0.17.0"
|
tracing = { version = "0.1.37", optional = true }
|
||||||
opentelemetry-jaeger = "0.16.0"
|
# opentelemetry = "0.17.0"
|
||||||
tracing = "0.1.37"
|
# opentelemetry-jaeger = "0.16.0"
|
||||||
tracing-opentelemetry = "0.17.2"
|
# tracing = "0.1.37"
|
||||||
tracing-subscriber = {version="0.3.16", features=["env-filter"]}
|
# tracing-opentelemetry = "0.17.2"
|
||||||
|
# tracing-subscriber = {version="0.3.16", features=["env-filter"]}
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
walkdir = "2.3.3"
|
walkdir = "2.3.3"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["compare"]
|
default = ["compare", "tracing"]
|
||||||
compare = []
|
compare = []
|
||||||
|
tracing = ["dep:tracing"]
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
lto = true
|
lto = true
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use tracing_subscriber::layer::SubscriberExt;
|
// use tracing_subscriber::layer::SubscriberExt;
|
||||||
use tracing_subscriber::util::SubscriberInitExt;
|
// use tracing_subscriber::util::SubscriberInitExt;
|
||||||
// use tracing_subscriber::EnvFilter;
|
// use tracing_subscriber::EnvFilter;
|
||||||
|
|
||||||
pub fn init_telemetry() -> Result<(), Box<dyn std::error::Error>> {
|
pub fn init_telemetry() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
@ -12,23 +12,23 @@ pub fn init_telemetry() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
// .with_thread_ids(false)
|
// .with_thread_ids(false)
|
||||||
// .with_target(false);
|
// .with_target(false);
|
||||||
|
|
||||||
opentelemetry::global::set_text_map_propagator(opentelemetry_jaeger::Propagator::new());
|
// opentelemetry::global::set_text_map_propagator(opentelemetry_jaeger::Propagator::new());
|
||||||
let tracer = opentelemetry_jaeger::new_pipeline()
|
// let tracer = opentelemetry_jaeger::new_pipeline()
|
||||||
.with_service_name("organic")
|
// .with_service_name("organic")
|
||||||
.install_simple()?;
|
// .install_simple()?;
|
||||||
|
|
||||||
let opentelemetry = tracing_opentelemetry::layer().with_tracer(tracer);
|
// let opentelemetry = tracing_opentelemetry::layer().with_tracer(tracer);
|
||||||
|
|
||||||
tracing_subscriber::registry()
|
// tracing_subscriber::registry()
|
||||||
// .with(env_filter)
|
// // .with(env_filter)
|
||||||
.with(opentelemetry)
|
// .with(opentelemetry)
|
||||||
// .with(stdout)
|
// // .with(stdout)
|
||||||
.try_init()?;
|
// .try_init()?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn shutdown_telemetry() -> Result<(), Box<dyn std::error::Error>> {
|
pub fn shutdown_telemetry() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
opentelemetry::global::shutdown_tracer_provider();
|
// opentelemetry::global::shutdown_tracer_provider();
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user