Skip to content

Commit

Permalink
cmd/uplink: ability to set experimental flag from environment variable
Browse files Browse the repository at this point in the history
Change-Id: I440764a54ac83e5a85e14f64843260d9c4f993fd
  • Loading branch information
elek authored and Storj Robot committed Nov 29, 2022
1 parent 75b77d5 commit e617db8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/uplink/external.go
Expand Up @@ -24,6 +24,7 @@ import (
"go.uber.org/zap"
"golang.org/x/term"

"storj.io/common/experiment"
"storj.io/common/rpc/rpctracing"
jaeger "storj.io/monkit-jaeger"
"storj.io/private/version"
Expand Down Expand Up @@ -216,6 +217,11 @@ func (ex *external) Wrap(ctx context.Context, cmd clingy.Command) (err error) {
}
}

exp := os.Getenv("STORJ_EXPERIMENTAL")
if exp != "" {
ctx = experiment.With(ctx, exp)
}

// N.B.: Tracing is currently disabled by default (sample == 0, traceID == 0) and is
// something a user can only opt into. as a result, we don't check ex.analyticsEnabled()
// in this if statement. If we do ever start turning on trace samples by default, we
Expand Down

0 comments on commit e617db8

Please sign in to comment.