Disable all the old tracing stuff.

This commit is contained in:
Tom Alexander 2023-08-10 20:01:00 -04:00
parent f6e539a40b
commit 1f10d3d064
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 22 additions and 19 deletions

View File

@ -9,6 +9,7 @@ repository = "https://code.fizz.buzz/talexander/organic"
readme = "README.org"
keywords = ["emacs", "org-mode"]
categories = ["parsing"]
resolver = "2"
[lib]
name = "organic"
@ -21,18 +22,20 @@ path = "src/main.rs"
[dependencies]
nom = "7.1.1"
opentelemetry = "0.17.0"
opentelemetry-jaeger = "0.16.0"
tracing = "0.1.37"
tracing-opentelemetry = "0.17.2"
tracing-subscriber = {version="0.3.16", features=["env-filter"]}
tracing = { version = "0.1.37", optional = true }
# opentelemetry = "0.17.0"
# opentelemetry-jaeger = "0.16.0"
# tracing = "0.1.37"
# tracing-opentelemetry = "0.17.2"
# tracing-subscriber = {version="0.3.16", features=["env-filter"]}
[build-dependencies]
walkdir = "2.3.3"
[features]
default = ["compare"]
default = ["compare", "tracing"]
compare = []
tracing = ["dep:tracing"]
[profile.release]
lto = true

View File

@ -1,5 +1,5 @@
use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::util::SubscriberInitExt;
// use tracing_subscriber::layer::SubscriberExt;
// use tracing_subscriber::util::SubscriberInitExt;
// use tracing_subscriber::EnvFilter;
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_target(false);
opentelemetry::global::set_text_map_propagator(opentelemetry_jaeger::Propagator::new());
let tracer = opentelemetry_jaeger::new_pipeline()
.with_service_name("organic")
.install_simple()?;
// opentelemetry::global::set_text_map_propagator(opentelemetry_jaeger::Propagator::new());
// let tracer = opentelemetry_jaeger::new_pipeline()
// .with_service_name("organic")
// .install_simple()?;
let opentelemetry = tracing_opentelemetry::layer().with_tracer(tracer);
// let opentelemetry = tracing_opentelemetry::layer().with_tracer(tracer);
tracing_subscriber::registry()
// .with(env_filter)
.with(opentelemetry)
// .with(stdout)
.try_init()?;
// tracing_subscriber::registry()
// // .with(env_filter)
// .with(opentelemetry)
// // .with(stdout)
// .try_init()?;
Ok(())
}
pub fn shutdown_telemetry() -> Result<(), Box<dyn std::error::Error>> {
opentelemetry::global::shutdown_tracer_provider();
// opentelemetry::global::shutdown_tracer_provider();
Ok(())
}