Skip to content

Commit

Permalink
Remove EnableOpenTelemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieMagee committed Oct 23, 2023
1 parent 7723e48 commit 5f240e3
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 10 deletions.
1 change: 0 additions & 1 deletion cmd/dependabot/internal/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ var (
file string
cache string
debugging bool
enableOpenTelemetry bool
proxyCertPath string
collectorConfigPath string
extraHosts []string
Expand Down
2 changes: 0 additions & 2 deletions cmd/dependabot/internal/cmd/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ var testCmd = &cobra.Command{
CollectorImage: collectorImage,
Creds: scenario.Input.Credentials,
Debug: debugging,
EnableOpenTelemetry: enableOpenTelemetry,
Expected: scenario.Output,
ExtraHosts: extraHosts,
InputName: file,
Expand Down Expand Up @@ -94,7 +93,6 @@ func init() {
testCmd.Flags().StringVar(&collectorConfigPath, "collector-config", "", "path to an OpenTelemetry collector config file")
testCmd.Flags().BoolVar(&pullImages, "pull", true, "pull the image if it isn't present")
testCmd.Flags().BoolVar(&debugging, "debug", false, "run an interactive shell inside the updater")
testCmd.Flags().BoolVar(&enableOpenTelemetry, "enable-opentelemetry", false, "enable OpenTelemetry tracing")
testCmd.Flags().StringArrayVarP(&volumes, "volume", "v", nil, "mount volumes in Docker")
testCmd.Flags().StringArrayVar(&extraHosts, "extra-hosts", nil, "Docker extra hosts setting on the proxy")
testCmd.Flags().DurationVarP(&timeout, "timeout", "t", 0, "max time to run an update")
Expand Down
2 changes: 0 additions & 2 deletions cmd/dependabot/internal/cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func NewUpdateCommand() *cobra.Command {
CollectorImage: collectorImage,
Creds: input.Credentials,
Debug: debugging,
EnableOpenTelemetry: enableOpenTelemetry,
Expected: nil, // update subcommand doesn't use expectations
ExtraHosts: extraHosts,
InputName: file,
Expand Down Expand Up @@ -102,7 +101,6 @@ func NewUpdateCommand() *cobra.Command {
cmd.Flags().StringVar(&collectorConfigPath, "collector-config", "", "path to an OpenTelemetry collector config file")
cmd.Flags().BoolVar(&pullImages, "pull", true, "pull the image if it isn't present")
cmd.Flags().BoolVar(&debugging, "debug", false, "run an interactive shell inside the updater")
cmd.Flags().BoolVar(&enableOpenTelemetry, "enable-opentelemetry", false, "enable OpenTelemetry tracing")
cmd.Flags().StringArrayVarP(&volumes, "volume", "v", nil, "mount volumes in Docker")
cmd.Flags().StringArrayVar(&extraHosts, "extra-hosts", nil, "Docker extra hosts setting on the proxy")
cmd.Flags().DurationVarP(&timeout, "timeout", "t", 0, "max time to run an update")
Expand Down
6 changes: 2 additions & 4 deletions internal/infra/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ type RunParams struct {
PullImages bool
// run an interactive shell?
Debug bool
// EnableOpenTelemetry enables OpenTelemetry tracing
EnableOpenTelemetry bool
// Volumes are used to mount directories in Docker
Volumes []string
// Timeout specifies an optional maximum duration the CLI will run an update.
Expand Down Expand Up @@ -335,7 +333,7 @@ func runContainers(ctx context.Context, params RunParams, api *server.API) error
return err
}

if params.EnableOpenTelemetry == true {
if params.CollectorConfigPath != "" {
err = pullImage(ctx, cli, params.CollectorImage)
if err != nil {
return err
Expand Down Expand Up @@ -365,7 +363,7 @@ func runContainers(ctx context.Context, params RunParams, api *server.API) error
go prox.TailLogs(ctx, cli)
}

if params.EnableOpenTelemetry {
if params.CollectorConfigPath != "" {
collector, err := NewCollector(ctx, cli, networks, &params, prox)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion internal/infra/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func NewUpdater(ctx context.Context, cli *client.Client, net *Networks, params *
Tty: true, // prevent container from stopping
}

if params.EnableOpenTelemetry == true {
if params.CollectorConfigPath != "" {
containerCfg.Env = append(containerCfg.Env, "OTEL_ENABLED=true")
}

Expand Down

0 comments on commit 5f240e3

Please sign in to comment.