mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-28 14:39:57 +00:00
TUN-8052: Update go to 1.21.5
Also update golang.org/x/net and google.golang.org/grpc to fix vulnerabilities, although cloudflared is using them in a way that is not exposed to those risks
This commit is contained in:
17
vendor/go.opentelemetry.io/otel/sdk/trace/sampler_env.go
generated
vendored
17
vendor/go.opentelemetry.io/otel/sdk/trace/sampler_env.go
generated
vendored
@@ -73,25 +73,26 @@ func samplerFromEnv() (Sampler, error) {
|
||||
case samplerAlwaysOff:
|
||||
return NeverSample(), nil
|
||||
case samplerTraceIDRatio:
|
||||
ratio, err := parseTraceIDRatio(samplerArg, hasSamplerArg)
|
||||
return ratio, err
|
||||
if !hasSamplerArg {
|
||||
return TraceIDRatioBased(1.0), nil
|
||||
}
|
||||
return parseTraceIDRatio(samplerArg)
|
||||
case samplerParentBasedAlwaysOn:
|
||||
return ParentBased(AlwaysSample()), nil
|
||||
case samplerParsedBasedAlwaysOff:
|
||||
return ParentBased(NeverSample()), nil
|
||||
case samplerParentBasedTraceIDRatio:
|
||||
ratio, err := parseTraceIDRatio(samplerArg, hasSamplerArg)
|
||||
if !hasSamplerArg {
|
||||
return ParentBased(TraceIDRatioBased(1.0)), nil
|
||||
}
|
||||
ratio, err := parseTraceIDRatio(samplerArg)
|
||||
return ParentBased(ratio), err
|
||||
default:
|
||||
return nil, errUnsupportedSampler(sampler)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func parseTraceIDRatio(arg string, hasSamplerArg bool) (Sampler, error) {
|
||||
if !hasSamplerArg {
|
||||
return TraceIDRatioBased(1.0), nil
|
||||
}
|
||||
func parseTraceIDRatio(arg string) (Sampler, error) {
|
||||
v, err := strconv.ParseFloat(arg, 64)
|
||||
if err != nil {
|
||||
return TraceIDRatioBased(1.0), samplerArgParseError{err}
|
||||
|
Reference in New Issue
Block a user