Skip to content

Commit 2093976

Browse files
committed
chore: disable otel
1 parent adf646c commit 2093976

File tree

72 files changed

+537
-447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+537
-447
lines changed

Cargo.lock

+272-273
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ json5 = "0.4.1"
1717
tracing = "0.1"
1818

1919
[workspace.dependencies.tokio]
20-
version = "1.40.0"
21-
default-features = false
22-
features = ["full"]
20+
version = "1.44.0"
21+
features = ["full", "tracing"]
2322

2423
[workspace.dependencies.nix]
2524
version = "0.27"

packages/common/api-helper/build/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ rivet-util.workspace = true
3939
serde = { version = "1.0", features = ["derive"] }
4040
serde_json = "1.0"
4141
thiserror = "1.0"
42-
tokio = { version = "1.40" }
42+
tokio.workspace = true
4343
tracing = "0.1"
4444
tracing-subscriber = { version = "0.3", default-features = false, features = [
4545
"fmt",

packages/common/cache/build/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ rivet-util.workspace = true
2121
serde = { version = "1.0", features = ["derive"] }
2222
serde_json = "1.0"
2323
thiserror = "1.0"
24-
tokio = { version = "1.40", features = ["full"] }
24+
tokio.workspace = true
2525
tracing = "0.1"
2626
types-proto.workspace = true
2727
uuid = { version = "1", features = ["v4"] }

packages/common/chirp-workflow/core/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ serde = { version = "1.0.198", features = ["derive"] }
3636
serde_json = "1.0.116"
3737
strum = { version = "0.26", features = ["derive"] }
3838
thiserror = "1.0.59"
39-
tokio = { version = "1.40.0", features = ["full"] }
39+
tokio.workspace = true
4040
tokio-util = "0.7"
4141
tracing = "0.1.40"
4242
tracing-logfmt.workspace = true

packages/common/chirp/client/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ rivet-pools.workspace = true
1919
rivet-util.workspace = true
2020
serde = { version = "1.0", features = ["derive"] }
2121
thiserror = "1.0"
22-
tokio = { version = "1.40", features = ["full"] }
22+
tokio.workspace = true
2323
tokio-util = "0.7"
2424
tracing = "0.1"
2525
types-proto.workspace = true

packages/common/chirp/perf/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ types-proto.workspace = true
1212
rivet-metrics.workspace = true
1313
rivet-pools.workspace = true
1414
thiserror = "1.0"
15-
tokio = { version = "1.40", features = ["full", "tracing"] }
15+
tokio.workspace = true
1616
tracing = "0.1"
1717
rivet-env.workspace = true
1818

packages/common/chirp/worker/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ rivet-runtime.workspace = true
3232
rivet-util.workspace = true
3333
serde_json = "1.0"
3434
thiserror = "1.0"
35-
tokio = { version = "1.40", features = ["full", "tracing"] }
35+
tokio.workspace = true
3636
tracing = "0.1"
3737
types-proto.workspace = true
3838
tracing-subscriber = { version = "0.3", optional = true, default-features = false, features = [

packages/common/deno-embed/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition.workspace = true
77

88
[dependencies]
99
anyhow = "1.0"
10-
tokio = { version = "1.40.0", features = ["full"] }
10+
tokio.workspace = true
1111

1212
[features]
1313
# Enable if using from a build script, since this'll cause problems if cross

packages/common/fdb-util/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ anyhow = "1.0"
1010
foundationdb.workspace = true
1111
lazy_static = "1.4"
1212
rivet-metrics.workspace = true
13-
tokio = { version = "1.40.0", features = ["full"] }
13+
tokio.workspace = true
1414
tracing = "0.1.40"

packages/common/health-checks/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ rivet-pools.workspace = true
1414
serde = { version = "1.0", features = ["derive"] }
1515
serde_json = "1.0"
1616
thiserror = "1.0"
17-
tokio = { version = "1.40", features = ["tracing"] }
17+
tokio.workspace = true
1818
tracing = "0.1"
1919
uuid = { version = "1", features = ["v4"] }

packages/common/metrics/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ lazy_static = "1.4"
1212
prometheus = "0.13"
1313
rivet-config.workspace = true
1414
rivet-env.workspace = true
15-
tokio = "1.40.0"
15+
tokio.workspace = true
1616
tracing = "0.1"
1717

packages/common/migrate/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ rivet-config.workspace = true
1414
rivet-pools.workspace = true
1515
rivet-util.workspace = true
1616
tempfile = "3.13.0"
17-
tokio = { version = "1.40", features = ["full"] }
17+
tokio.workspace = true
1818
tracing = "0.1"
1919
url = "2.4"
2020
urlencoding = "2.1.3"

packages/common/nomad-util/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rivet-pools.workspace = true
1717
serde = { version = "1.0", features = ["derive"] }
1818
serde_json = { version = "1.0", features = ["raw_value"] }
1919
thiserror = "1.0"
20-
tokio = { version = "1.40", features = ["full"] }
20+
tokio.workspace = true
2121
tracing = "0.1"
2222

2323
[dependencies.nomad_client_new]

packages/common/operation/core/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ rivet-pools.workspace = true
2424
rivet-util.workspace = true
2525
serde_json = { version = "1.0", features = ["raw_value"] }
2626
thiserror = "1.0"
27-
tokio = { version = "1.40", features = ["full", "tracing"] }
27+
tokio.workspace = true
2828
tracing = "0.1"
2929
types-proto.workspace = true

packages/common/pools/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ rivet-metrics.workspace = true
2525
service-discovery.workspace = true
2626
tempfile = "3.13.0"
2727
thiserror = "1.0"
28-
tokio = { version = "1.40", features = ["tracing"] }
28+
tokio.workspace = true
2929
tokio-util = "0.7"
3030
tracing = "0.1"
3131
tracing-subscriber.workspace = true

packages/common/runtime/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ license.workspace = true
66
edition.workspace = true
77

88
[dependencies]
9-
console-subscriber = "0.1"
9+
console-subscriber = "0.4"
1010
lazy_static = "1.4"
1111
rivet-metrics.workspace = true
1212
thiserror = "1.0"
13-
tokio = { version = "1.40", features = ["full", "tracing"] }
13+
tokio.workspace = true
1414
tracing = "0.1"
1515
tracing-core = "0.1"
1616
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "json", "ansi", "registry", "env-filter"] } # Used with attribute

packages/common/runtime/src/otel.rs

+61-30
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ use opentelemetry_sdk::{
1010
};
1111
use opentelemetry_semantic_conventions::{attribute::SERVICE_VERSION, SCHEMA_URL};
1212
use tracing_opentelemetry::{MetricsLayer, OpenTelemetryLayer};
13-
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
13+
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Layer};
14+
use console_subscriber;
1415

1516
fn resource() -> Resource {
1617
Resource::builder()
@@ -92,11 +93,11 @@ fn init_meter_provider() -> SdkMeterProvider {
9293

9394
// Initialize tracing-subscriber and return OtelGuard for opentelemetry-related termination processing
9495
pub fn init_tracing_subscriber() -> OtelGuard {
95-
let tracer_provider = init_tracer_provider();
96-
let meter_provider = init_meter_provider();
96+
//let tracer_provider = init_tracer_provider();
97+
//let meter_provider = init_meter_provider();
9798
//let logger_provider = init_logger_provider();
9899

99-
let tracer = tracer_provider.tracer("tracing-otel-subscriber");
100+
//let tracer = tracer_provider.tracer("tracing-otel-subscriber");
100101

101102
// For the OpenTelemetry layer, add a tracing filter to filter events from
102103
// OpenTelemetry and its dependent crates (opentelemetry-otlp uses crates
@@ -118,15 +119,6 @@ pub fn init_tracing_subscriber() -> OtelGuard {
118119
// opentelemetry_appender_tracing::layer::OpenTelemetryTracingBridge::new(&logger_provider)
119120
// .with_filter(filter_otel);
120121

121-
// Create logfmt logger
122-
let logfmt_layer = tracing_logfmt::builder()
123-
.with_span_name(std::env::var("RUST_LOG_SPAN_NAME").map_or(false, |x| x == "1"))
124-
.with_span_path(std::env::var("RUST_LOG_SPAN_PATH").map_or(false, |x| x == "1"))
125-
.with_target(std::env::var("RUST_LOG_TARGET").map_or(false, |x| x == "1"))
126-
.with_location(std::env::var("RUST_LOG_LOCATION").map_or(false, |x| x == "1"))
127-
.with_module_path(std::env::var("RUST_LOG_MODULE_PATH").map_or(false, |x| x == "1"))
128-
.with_ansi_color(std::env::var("RUST_LOG_ANSI_COLOR").map_or(false, |x| x == "1"))
129-
.layer();
130122

131123
// Create env filter
132124
let mut env_filter = EnvFilter::default()
@@ -141,35 +133,74 @@ pub fn init_tracing_subscriber() -> OtelGuard {
141133
}
142134
}
143135

144-
tracing_subscriber::registry()
145-
.with(env_filter)
146-
.with(OpenTelemetryLayer::new(tracer))
147-
.with(MetricsLayer::new(meter_provider.clone()))
148-
//.with(logger)
149-
.with(logfmt_layer)
150-
.init();
136+
// Check if tokio console is enabled
137+
let enable_tokio_console = std::env::var("TOKIO_CONSOLE_ENABLE").map_or(false, |x| x == "1");
138+
139+
if enable_tokio_console {
140+
let console_layer = console_subscriber::ConsoleLayer::builder()
141+
.with_default_env()
142+
.spawn();
143+
144+
// Create logfmt logger
145+
let logfmt_layer = tracing_logfmt::builder()
146+
.with_span_name(std::env::var("RUST_LOG_SPAN_NAME").map_or(false, |x| x == "1"))
147+
.with_span_path(std::env::var("RUST_LOG_SPAN_PATH").map_or(false, |x| x == "1"))
148+
.with_target(std::env::var("RUST_LOG_TARGET").map_or(false, |x| x == "1"))
149+
.with_location(std::env::var("RUST_LOG_LOCATION").map_or(false, |x| x == "1"))
150+
.with_module_path(std::env::var("RUST_LOG_MODULE_PATH").map_or(false, |x| x == "1"))
151+
.with_ansi_color(std::env::var("RUST_LOG_ANSI_COLOR").map_or(false, |x| x == "1"))
152+
.layer()
153+
.with_filter(env_filter);
154+
155+
tracing_subscriber::registry()
156+
.with(console_layer)
157+
//.with(OpenTelemetryLayer::new(tracer))
158+
//.with(MetricsLayer::new(meter_provider.clone()))
159+
//.with(logger)
160+
.with(logfmt_layer)
161+
.init();
162+
} else {
163+
// Create logfmt logger
164+
let logfmt_layer = tracing_logfmt::builder()
165+
.with_span_name(std::env::var("RUST_LOG_SPAN_NAME").map_or(false, |x| x == "1"))
166+
.with_span_path(std::env::var("RUST_LOG_SPAN_PATH").map_or(false, |x| x == "1"))
167+
.with_target(std::env::var("RUST_LOG_TARGET").map_or(false, |x| x == "1"))
168+
.with_location(std::env::var("RUST_LOG_LOCATION").map_or(false, |x| x == "1"))
169+
.with_module_path(std::env::var("RUST_LOG_MODULE_PATH").map_or(false, |x| x == "1"))
170+
.with_ansi_color(std::env::var("RUST_LOG_ANSI_COLOR").map_or(false, |x| x == "1"))
171+
.layer()
172+
.with_filter(env_filter);
173+
174+
tracing_subscriber::registry()
175+
.with(env_filter)
176+
//.with(OpenTelemetryLayer::new(tracer))
177+
//.with(MetricsLayer::new(meter_provider.clone()))
178+
//.with(logger)
179+
.with(logfmt_layer)
180+
.init();
181+
}
151182

152183
OtelGuard {
153-
tracer_provider,
154-
meter_provider,
184+
//tracer_provider,
185+
//meter_provider,
155186
//logger_provider,
156187
}
157188
}
158189

159190
pub struct OtelGuard {
160-
tracer_provider: SdkTracerProvider,
161-
meter_provider: SdkMeterProvider,
191+
//tracer_provider: SdkTracerProvider,
192+
//meter_provider: SdkMeterProvider,
162193
//logger_provider: SdkLoggerProvider,
163194
}
164195

165196
impl Drop for OtelGuard {
166197
fn drop(&mut self) {
167-
if let Err(err) = self.tracer_provider.shutdown() {
168-
eprintln!("{err:?}");
169-
}
170-
if let Err(err) = self.meter_provider.shutdown() {
171-
eprintln!("{err:?}");
172-
}
198+
//if let Err(err) = self.tracer_provider.shutdown() {
199+
// eprintln!("{err:?}");
200+
//}
201+
//if let Err(err) = self.meter_provider.shutdown() {
202+
// eprintln!("{err:?}");
203+
//}
173204
//if let Err(err) = self.logger_provider.shutdown() {
174205
// eprintln!("{err:?}");
175206
//}

packages/common/s3-util/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ aws-smithy-types = { version = "1.2" }
1313
http = "0.2"
1414
thiserror = "1.0"
1515
tracing = "0.1"
16-
tokio = { version = "1.40" }
16+
tokio.workspace = true
1717
rivet-util.workspace = true
1818
rivet-config.workspace = true
1919
global-error.workspace = true

packages/common/server-cli/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ strum = "0.26.3"
3535
tabled = "0.17.0"
3636
tempfile = "3.13.0"
3737
thiserror = "1.0.64"
38-
tokio = { version = "1.40", features = ["full", "tracing"] }
38+
tokio.workspace = true
3939
tracing = "0.1"
4040
url = "2.4"
4141
uuid = "1.10.0"

packages/common/service-discovery/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ edition.workspace = true
99
rand = "0.8"
1010
reqwest = { version = "0.12", features = ["json"] }
1111
serde = { version = "1.0", features = ["derive"] }
12-
tokio = { version = "1.40", features = ["full"] }
12+
tokio.workspace = true
1313
tracing = "0.1"
14-
url = "2.4"
14+
url = "2.4"

packages/common/service-manager/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ rivet-metrics.workspace = true
1616
rivet-migrate.workspace = true
1717
rivet-pools.workspace = true
1818
s3-util.workspace = true
19-
tokio = { version = "1.40", features = ["full", "tracing"] }
19+
tokio.workspace = true
2020
tokio-cron-scheduler = "0.13.0"
2121
tracing = "0.1.40"

packages/common/util/core/Cargo.toml

+1-8
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,7 @@ rivet-util-macros.workspace = true
2727
serde = { version = "1.0", features = ["derive"] }
2828
serde_json = { version = "1.0" }
2929
thiserror = "1.0"
30-
tokio = { version = "1.40", default-features = false, features = [
31-
"fs",
32-
"macros",
33-
"parking_lot",
34-
"sync",
35-
"test-util",
36-
"time",
37-
] }
30+
tokio.workspace = true
3831
types-proto.workspace = true
3932
url = "2.5.4"
4033
uuid = { version = "1", features = ["v4", "serde"] }

packages/core/api/actor/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ s3-util.workspace = true
2323
serde = { version = "1.0", features = ["derive"] }
2424
serde_json = "1.0"
2525
base64 = "0.13"
26-
tokio = { version = "1.40" }
26+
tokio.workspace = true
2727
tracing = "0.1"
2828
tracing-futures = "0.2"
2929
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "json", "ansi"] }

packages/core/api/auth/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ serde_json = "1.0"
3434
thiserror = "1.0"
3535
token-create.workspace = true
3636
token-revoke.workspace = true
37-
tokio = { version = "1.40" }
37+
tokio.workspace = true
3838
tracing = "0.1"
3939
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "json", "ansi"] }
4040
url = "2.2.2"

packages/core/api/cf-verification/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ rivet-pools.workspace = true
2424
serde = { version = "1.0", features = ["derive"] }
2525
serde_json = "1.0"
2626
thiserror = "1.0"
27-
tokio = { version = "1.40" }
27+
tokio.workspace = true
2828
tracing = "0.1"
2929
tracing-subscriber = { version = "0.3", default-features = false, features = [
3030
"fmt",

packages/core/api/cloud/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ s3-util.workspace = true
3030
serde = { version = "1.0", features = ["derive"] }
3131
serde_json = "1.0"
3232
thiserror = "1.0"
33-
tokio = { version = "1.40" }
33+
tokio.workspace = true
3434
tracing = "0.1"
3535
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "json", "ansi"] }
3636
url = "2.2.2"

packages/core/api/games/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ s3-util.workspace = true
2323
serde = { version = "1.0", features = ["derive"] }
2424
serde_json = "1.0"
2525
base64 = "0.13"
26-
tokio = { version = "1.40" }
26+
tokio.workspace = true
2727
tracing = "0.1"
2828
tracing-futures = "0.2"
2929
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "json", "ansi"] }

packages/core/api/group/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ rivet-pools.workspace = true
2626
serde = { version = "1.0", features = ["derive"] }
2727
serde_json = "1.0"
2828
thiserror = "1.0"
29-
tokio = { version = "1.40" }
29+
tokio.workspace = true
3030
tracing = "0.1"
3131
tracing-subscriber = { version = "0.3", default-features = false, features = [
3232
"fmt",

packages/core/api/identity/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ rivet-pools.workspace = true
2424
serde = { version = "1.0", features = ["derive"] }
2525
serde_json = "1.0"
2626
thiserror = "1.0"
27-
tokio = { version = "1.40" }
27+
tokio.workspace = true
2828
tracing = "0.1"
2929
tracing-subscriber = { version = "0.3", default-features = false, features = [
3030
"fmt",

0 commit comments

Comments
 (0)