added tracing command for testing + extra logging
This commit is contained in:
@@ -896,6 +896,7 @@ impl<R, S> FreshHandler<R, S> {
|
||||
{
|
||||
let trace_id =
|
||||
opentelemetry::trace::TraceId::from_hex(trace_id).expect("Invalid trace ID format");
|
||||
warn!("🫂TraceID: {trace_id}🫂");
|
||||
|
||||
// We don't need to try and preserve the SpanID, just the TraceID (right?) so
|
||||
// just making a new SpanID for the moment
|
||||
|
||||
@@ -12,6 +12,7 @@ use clap::{Parser, Subcommand};
|
||||
use nym_bin_common::bin_info;
|
||||
use std::future::Future;
|
||||
use std::sync::OnceLock;
|
||||
use tracing::instrument;
|
||||
|
||||
pub(crate) mod commands;
|
||||
mod helpers;
|
||||
@@ -54,6 +55,7 @@ impl Cli {
|
||||
.block_on(fut))
|
||||
}
|
||||
|
||||
#[instrument]
|
||||
pub(crate) fn execute(self) -> anyhow::Result<()> {
|
||||
match self.command {
|
||||
// Sync commands get logger w. no OTEL
|
||||
@@ -90,6 +92,10 @@ impl Cli {
|
||||
setup_tracing_logger().map_err(NymNodeError::TracingSetupFailure)?;
|
||||
reset_sphinx_keys::execute(args).await
|
||||
})??,
|
||||
Commands::TestTracing => Self::execute_async(async move {
|
||||
setup_tracing_logger().map_err(NymNodeError::TracingSetupFailure)?;
|
||||
Ok::<(), crate::error::NymNodeError>(())
|
||||
})??,
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -145,6 +151,10 @@ pub(crate) enum Commands {
|
||||
/// was running on this machine in mixnet mode
|
||||
#[clap(hide = true)]
|
||||
TestThroughput(test_throughput::Args),
|
||||
|
||||
/// Test local tracing for instrumentation and
|
||||
/// TraceID aligmnet
|
||||
TestTracing,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user