diff --git a/components/ide-proxy/BUILD.yaml b/components/ide-proxy/BUILD.yaml index 637431c122da4f..971e66b8d818a8 100644 --- a/components/ide-proxy/BUILD.yaml +++ b/components/ide-proxy/BUILD.yaml @@ -5,7 +5,7 @@ packages: - "conf/**" - "static/**" deps: - - components/local-app:app + - components/local-app:app-with-manifest argdeps: - imageRepoBase config: diff --git a/components/ide-proxy/Dockerfile b/components/ide-proxy/Dockerfile index be49a00b4f7ffc..5fe74c5151b87e 100644 --- a/components/ide-proxy/Dockerfile +++ b/components/ide-proxy/Dockerfile @@ -7,7 +7,7 @@ FROM cgr.dev/chainguard/wolfi-base:latest@sha256:5fd82be4dfccc650c1985d57847f1af RUN apk add brotli gzip # Gitpod CLI and Local App -COPY components-local-app--app/bin/* /bin/ +COPY components-local-app--app-with-manifest/bin/* /bin/ RUN for FILE in `ls /bin/gitpod-local-companion*`;do \ gzip -v -f -9 -k "$FILE"; \ diff --git a/components/local-app/cmd/root.go b/components/local-app/cmd/root.go index 363a866223ec76..0505c5fd7ed752 100644 --- a/components/local-app/cmd/root.go +++ b/components/local-app/cmd/root.go @@ -98,7 +98,7 @@ var rootCmd = &cobra.Command{ if gpctx, err := cfg.GetActiveContext(); err == nil && gpctx != nil { telemetryEnabled = telemetryEnabled && gpctx.Host.String() == "https://gitpod.io" } - telemetry.Init(telemetryEnabled, cfg.Telemetry.Identity, constants.Version.String()) + telemetry.Init(telemetryEnabled, cfg.Telemetry.Identity, constants.Version.String(), level) telemetry.RecordCommand(cmd) if !isVersionCommand(cmd) { diff --git a/components/local-app/pkg/telemetry/telemetry.go b/components/local-app/pkg/telemetry/telemetry.go index 60b8077b45457d..81fbb520d82ff6 100644 --- a/components/local-app/pkg/telemetry/telemetry.go +++ b/components/local-app/pkg/telemetry/telemetry.go @@ -8,6 +8,8 @@ import ( "crypto/sha256" "errors" "fmt" + "io" + "log" "log/slog" "math/rand" "net" @@ -33,8 +35,8 @@ var opts struct { client segment.Client } -// Init initialises the telemetry -func Init(enabled bool, identity, version string) { +// Init initializes the telemetry +func Init(enabled bool, identity, version string, logLevel slog.Level) { opts.Enabled = enabled if !enabled { return @@ -44,7 +46,18 @@ func Init(enabled bool, identity, version string) { opts.Identity = identity if segmentKey != "" { - opts.client = segment.New(segmentKey) + var logger segment.Logger + if logLevel == slog.LevelDebug { + logger = segment.StdLogger(log.New(os.Stderr, "telemetry ", log.LstdFlags)) + } else { + // we don't want to log anything + log := log.New(os.Stderr, "telemetry ", log.LstdFlags) + log.SetOutput(io.Discard) + logger = segment.StdLogger(log) + } + opts.client, _ = segment.NewWithConfig(segmentKey, segment.Config{ + Logger: logger, + }) } } diff --git a/components/proxy/conf/Caddyfile b/components/proxy/conf/Caddyfile index fae3467ca8b897..80adcf48b0d4eb 100644 --- a/components/proxy/conf/Caddyfile +++ b/components/proxy/conf/Caddyfile @@ -336,7 +336,7 @@ https://{$GITPOD_DOMAIN} { } @ide_bin { - path /static/bin/gitpod-* + path /static/bin/* } handle @ide_bin { import compression