Skip to content

Commit

Permalink
Merge pull request #2966 from redpanda-data/add-telemetry-toggle
Browse files Browse the repository at this point in the history
Add telemetry toggle cli flag
  • Loading branch information
Jeffail authored Oct 28, 2024
2 parents 23f5308 + 355c28c commit 1c5a28f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ All notable changes to this project will be documented in this file.
- New `snowflake_streaming` output. (@rockwotj)
- Redpanda Connect will now use an optional `/etc/redpanda/connector_list.yaml` config to determine which connectors are available to run. (@Jeffail)
- (Benthos) Field `follow_redirects` added to the `http` processor. (@ooesili)
- New CLI flag `--secrets` added. (@Jeffail)
- New CLI flag `--disable-telemetry` added. (@Jeffail)

### Changed

Expand Down
21 changes: 15 additions & 6 deletions internal/cli/enterprise.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ func InitEnterpriseCLI(binaryName, version, dateBuilt string, schema *service.Co
return "", false
}

var disableTelemetry bool

opts = append(opts,
service.CLIOptSetVersion(version, dateBuilt),
service.CLIOptSetBinaryName(binaryName),
Expand Down Expand Up @@ -80,8 +82,9 @@ func InitEnterpriseCLI(binaryName, version, dateBuilt string, schema *service.Co
service.CLIOptAddTeeLogger(slog.New(rpLogger)),
service.CLIOptOnConfigParse(func(pConf *service.ParsedConfig) error {
// Kick off telemetry exporter.
telemetry.ActivateExporter(instanceID, version, fbLogger, schema, pConf)

if !disableTelemetry {
telemetry.ActivateExporter(instanceID, version, fbLogger, schema, pConf)
}
return rpLogger.InitOutputFromParsed(pConf.Namespace("redpanda"))
}),
service.CLIOptOnStreamStart(func(s *service.RunningStreamSummary) error {
Expand All @@ -96,12 +99,18 @@ func InitEnterpriseCLI(binaryName, version, dateBuilt string, schema *service.Co
Usage: "Attempt to load secrets from a provided URN. If more than one entry is specified they will be attempted in order until a value is found. Environment variable lookups are specified with the URN `env:`, which by default is the only entry. In order to disable all secret lookups specify a single entry of `none:`.",
Value: cli.NewStringSlice("env:"),
},
&cli.BoolFlag{
Name: "disable-telemetry",
Usage: "Disable anonymous telemetry from being emitted by this Connect instance.",
},
}, func(c *cli.Context) error {
secretsURNs := c.StringSlice("secrets")
if len(secretsURNs) > 0 {
disableTelemetry = c.Bool("disable-telemetry")

if secretsURNs := c.StringSlice("secrets"); len(secretsURNs) > 0 {
var err error
secretLookupFn, err = secrets.ParseLookupURNs(c.Context, slog.New(rpLogger), secretsURNs...)
return err
if secretLookupFn, err = secrets.ParseLookupURNs(c.Context, slog.New(rpLogger), secretsURNs...); err != nil {
return err
}
}
return nil
}),
Expand Down
2 changes: 1 addition & 1 deletion internal/telemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ Telemetry data is sent from an instance of Redpanda Connect that has been runnin

## How do I avoid it?

Any custom build of Redpanda Connect will not send this data, as it is only included in the build artifacts published by us either through Github releases or our official Docker images. You can also prevent telemetry by blocking the internet traffic, Redpanda Connect will continue operating as normal if it is unable to deliver telemetry data.
Any custom build of Redpanda Connect will not send this data, as it is only included in the build artifacts published by us either through Github releases or our official Docker images. You can also prevent telemetry with the cli flag `--disable-telemetry`, where Redpanda Connect will continue operating as normal without sending any telemetry data.

0 comments on commit 1c5a28f

Please sign in to comment.