From c047805f87058d0d2ae85eb1ba52e1e3c4926c19 Mon Sep 17 00:00:00 2001 From: Ashley Jeffs Date: Mon, 28 Oct 2024 11:42:46 +0000 Subject: [PATCH 1/2] Add disable telemetry cli toggle --- CHANGELOG.md | 2 ++ internal/cli/enterprise.go | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d443ff6a6..9e9ba86b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/internal/cli/enterprise.go b/internal/cli/enterprise.go index 17ad3caff..3a155fb87 100644 --- a/internal/cli/enterprise.go +++ b/internal/cli/enterprise.go @@ -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), @@ -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 { @@ -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 }), From 355c28c10bbbf9e7453c6c5af4613482848c1cf3 Mon Sep 17 00:00:00 2001 From: Ashley Jeffs Date: Mon, 28 Oct 2024 14:03:45 +0000 Subject: [PATCH 2/2] Update README --- internal/telemetry/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/telemetry/README.md b/internal/telemetry/README.md index 04fce69e6..d8556fdf5 100644 --- a/internal/telemetry/README.md +++ b/internal/telemetry/README.md @@ -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.