@@ -6,11 +6,9 @@ import (
66 "io"
77 "net/http"
88 "os"
9- "time"
109
1110 "github.com/scaleway/scaleway-cli/internal/account"
1211 "github.com/scaleway/scaleway-cli/internal/interactive"
13- "github.com/scaleway/scaleway-cli/internal/matomo"
1412 "github.com/scaleway/scaleway-sdk-go/logger"
1513 "github.com/scaleway/scaleway-sdk-go/scw"
1614 "github.com/spf13/pflag"
@@ -182,33 +180,6 @@ func Bootstrap(config *BootstrapConfig) (exitCode int, result interface{}, err e
182180 ctx = account .InjectHTTPClient (ctx , httpClient )
183181 ctx = injectMeta (ctx , meta )
184182
185- // Send Matomo telemetry when exiting the bootstrap
186- start := time .Now ()
187- defer func () {
188- // skip telemetry report when at least one of the following criteria matches:
189- // - telemetry is explicitly disable in bootstrap config
190- // - no command was executed
191- // - telemetry is disabled on the ran command
192- // - telemetry is disabled from the config (user must consent)
193- if config .DisableTelemetry ||
194- meta .command == nil ||
195- meta .command .DisableTelemetry ||
196- matomo .IsTelemetryDisabled () {
197- logger .Debugf ("skipping telemetry report\n " )
198- return
199- }
200- matomoErr := matomo .SendCommandTelemetry (& matomo.SendCommandTelemetryRequest {
201- Command : meta .command .getPath (),
202- Version : config .BuildInfo .Version .String (),
203- ExecutionTime : time .Since (start ),
204- })
205- if matomoErr != nil {
206- logger .Debugf ("error during telemetry reporting: %s\n " , matomoErr )
207- } else {
208- logger .Debugf ("telemetry successfully sent\n " )
209- }
210- }()
211-
212183 // Check CLI new version when exiting the bootstrap
213184 defer func () { // if we plan to remove defer, do not forget logger is not set until cobra pre init func
214185 config .BuildInfo .checkVersion (ctx )
0 commit comments