mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
cmd/utils: guard SampleRatio flag with IsSet check
This commit is contained in:
parent
77779d1098
commit
2715d72eaa
1 changed files with 3 additions and 1 deletions
|
|
@ -1584,7 +1584,9 @@ func setOpenTelemetry(ctx *cli.Context, cfg *node.Config) {
|
||||||
if ctx.IsSet(RPCTelemetryTagsFlag.Name) {
|
if ctx.IsSet(RPCTelemetryTagsFlag.Name) {
|
||||||
tcfg.Tags = ctx.String(RPCTelemetryTagsFlag.Name)
|
tcfg.Tags = ctx.String(RPCTelemetryTagsFlag.Name)
|
||||||
}
|
}
|
||||||
tcfg.SampleRatio = ctx.Float64(RPCTelemetrySampleRatioFlag.Name)
|
if ctx.IsSet(RPCTelemetrySampleRatioFlag.Name) {
|
||||||
|
tcfg.SampleRatio = ctx.Float64(RPCTelemetrySampleRatioFlag.Name)
|
||||||
|
}
|
||||||
|
|
||||||
if tcfg.Endpoint != "" && !tcfg.Enabled {
|
if tcfg.Endpoint != "" && !tcfg.Enabled {
|
||||||
log.Warn(fmt.Sprintf("OpenTelemetry endpoint configured but telemetry is not enabled, use --%s to enable.", RPCTelemetryFlag.Name))
|
log.Warn(fmt.Sprintf("OpenTelemetry endpoint configured but telemetry is not enabled, use --%s to enable.", RPCTelemetryFlag.Name))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue