Skip to content

Commit

Permalink
Disable metric label extraction from tracing due to high cpu cost
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedSoliman committed May 28, 2024
1 parent 8bc0ad1 commit 17f2f12
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions crates/tracing-instrumentation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ mod tracer;
use crate::pretty::PrettyFields;
use crate::processor::ResourceModifyingSpanProcessor;
use crate::tracer::SpanModifyingTracer;
use metrics_tracing_context::MetricsLayer;
use opentelemetry::trace::{TraceError, TracerProvider};
use opentelemetry::KeyValue;
use opentelemetry_contrib::trace::exporter::jaeger_json::JaegerJsonExporter;
Expand Down Expand Up @@ -189,11 +188,13 @@ pub fn init_tracing_and_logging(
let filter = EnvFilter::try_new(&common_opts.log_filter)?;
let (filter, reload_handle) = tracing_subscriber::reload::Layer::new(filter);
// Logging layer
let layers = layers
.with(build_logging_layer(common_opts)?.with_filter(filter))
// Enables auto extraction of selected span labels in emitted metrics.
// allowed labels are defined in restate_node_ctrl::metrics::ALLOWED_LABELS.
.with(MetricsLayer::new());
let layers = layers.with(build_logging_layer(common_opts)?.with_filter(filter));
// Enables auto extraction of selected span labels in emitted metrics.
// allowed labels are defined in restate_node_ctrl::metrics::ALLOWED_LABELS.
//
// This is temporarily disabled due to its performance cost. This will be re-enabled when it
// gets benchmarked and optimized.
//.with(MetricsLayer::new());

// Console subscriber layer
#[cfg(feature = "console-subscriber")]
Expand Down

0 comments on commit 17f2f12

Please sign in to comment.