From e1f7baeeb9a53d6f1e54962d61473b610c59b981 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Tue, 12 May 2026 14:32:23 +0200 Subject: [PATCH] node: default OpenTelemetry sample ratio to 1.0 The --rpc.telemetry.sample-ratio CLI flag declares a default of 1.0, but cmd/utils.setOpenTelemetry only copies the flag value into the node config when ctx.IsSet returns true. Without a corresponding default on node.DefaultConfig.OpenTelemetry.SampleRatio, omitting the flag leaves the runtime ratio at the float64 zero value, which causes sdktrace.TraceIDRatioBased(0) to drop 100% of spans. Users see "OpenTelemetry trace export enabled" but no traces ever leave geth. Seed the default in DefaultConfig so the documented behavior matches runtime behavior. --- node/defaults.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node/defaults.go b/node/defaults.go index 403a7f88a3..3410fa2ae5 100644 --- a/node/defaults.go +++ b/node/defaults.go @@ -76,6 +76,9 @@ var DefaultConfig = Config{ DiscoveryV5: true, }, DBEngine: "", // Use whatever exists, will default to Pebble if non-existent and supported + OpenTelemetry: OpenTelemetryConfig{ + SampleRatio: 1.0, + }, } // DefaultDataDir is the default data directory to use for the databases and other