Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

penumbra: completely remove console-subscriber #4179

Merged
merged 2 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 0 additions & 57 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ chrono = { default-features = false, version = "0.4" }
clap = { version = "3.2" }
cnidarium = { default-features = false, path = "crates/cnidarium" }
cnidarium-component = { default-features = false, path = "crates/cnidarium-component" }
console-subscriber = { version = "0.2" }
criterion = { version = "0.4" }
decaf377 = { default-features = false, version = "0.5" }
decaf377-fmd = { path = "crates/crypto/decaf377-fmd" }
Expand Down
1 change: 0 additions & 1 deletion crates/bin/pd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ bytes = { workspace = true }
chrono = { workspace = true, default-features = false, features = ["serde"] }
clap = { workspace = true, features = ["derive", "env"] }
cnidarium = { workspace = true, features = ["migration", "rpc"], default-features = true }
console-subscriber = { workspace = true }
csv = "1.1"
decaf377 = { workspace = true, features = ["parallel"], default-features = true }
decaf377-rdsa = { workspace = true }
Expand Down
3 changes: 0 additions & 3 deletions crates/bin/pd/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ use {
#[derive(Debug, Parser)]
#[clap(name = "pd", about = "The Penumbra daemon.", version)]
pub struct Opt {
/// Enable Tokio Console support.
#[clap(long)]
pub tokio_console: bool,
/// Command to run.
#[clap(subcommand)]
pub cmd: RootCommand,
Expand Down
14 changes: 3 additions & 11 deletions crates/bin/pd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use std::error::Error;
use std::io::IsTerminal as _;

use console_subscriber::ConsoleLayer;
use metrics_tracing_context::{MetricsLayer, TracingContextLayer};
use metrics_util::layers::Stack;

Expand Down Expand Up @@ -32,7 +31,7 @@ use url::Url;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Validate options immediately.
let Opt { tokio_console, cmd } = <Opt as clap::Parser>::parse();
let Opt { cmd } = <Opt as clap::Parser>::parse();

// Instantiate tracing layers.
// The MetricsLayer handles enriching metrics output with labels from tracing spans.
Expand All @@ -44,19 +43,12 @@ async fn main() -> anyhow::Result<()> {
// The `EnvFilter` layer is used to filter events based on `RUST_LOG`.
let filter_layer = EnvFilter::try_from_default_env().or_else(|_| EnvFilter::try_new("info"))?;

// Register the tracing subscribers, conditionally enabling tokio console support
// Register the tracing subscribers.
let registry = tracing_subscriber::registry()
.with(filter_layer)
.with(fmt_layer)
.with(metrics_layer);
if tokio_console {
// The ConsoleLayer enables collection of data for `tokio-console`.
// The `spawn` call will panic if AddrInUse, so we only spawn if enabled.
let console_layer = ConsoleLayer::builder().with_default_env().spawn();
registry.with(console_layer).init();
} else {
registry.init();
}
registry.init();

tracing::info!(?cmd, version = env!("CARGO_PKG_VERSION"), "running command");
match cmd {
Expand Down
1 change: 0 additions & 1 deletion tools/summonerd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ bytes = {workspace = true}
camino = {workspace = true}
chrono = {workspace = true}
clap = {workspace = true, features = ["derive", "env", "color"]}
console-subscriber = {workspace = true}
decaf377 = {workspace = true}
futures = {workspace = true}
hex = {workspace = true}
Expand Down
14 changes: 2 additions & 12 deletions tools/summonerd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use ark_serialize::CanonicalSerialize;
use camino::Utf8Path;
use camino::Utf8PathBuf;
use clap::Parser;
use console_subscriber::ConsoleLayer;
use coordinator::Coordinator;
use decaf377::Bls12_377;
use metrics_tracing_context::MetricsLayer;
Expand Down Expand Up @@ -86,9 +85,6 @@ operating the orchestration.
version,
)]
struct Opt {
/// Enable Tokio Console support.
#[clap(long)]
tokio_console: bool,
/// Command to run.
#[clap(subcommand)]
pub cmd: Command,
Expand Down Expand Up @@ -356,8 +352,6 @@ async fn main() -> Result<()> {
// Instantiate tracing layers.
// The MetricsLayer handles enriching metrics output with labels from tracing spans.
let metrics_layer = MetricsLayer::new();
// The ConsoleLayer enables collection of data for `tokio-console`.
let console_layer = ConsoleLayer::builder().with_default_env().spawn();
// The `FmtLayer` is used to print to the console.
let fmt_layer = tracing_subscriber::fmt::layer()
.with_ansi(io::stdout().is_terminal())
Expand All @@ -369,16 +363,12 @@ async fn main() -> Result<()> {

let opt = Opt::parse();

// Register the tracing subscribers, conditionally enabling tokio console support
// Register the tracing subscribers.
let registry = tracing_subscriber::registry()
.with(filter_layer)
.with(fmt_layer)
.with(metrics_layer);
if opt.tokio_console {
registry.with(console_layer).init();
} else {
registry.init();
}
registry.init();

opt.exec().await
}
Loading