From ae114a8896bdef54363b8b1c8b7601b6d352999e Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Tue, 6 Dec 2022 14:02:03 +0100 Subject: [PATCH] Pass caller to registry telemetry --- pkg/registry/registry.go | 2 ++ pkg/segment/integrations.go | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/pkg/registry/registry.go b/pkg/registry/registry.go index 4c45928b95b..3d71c80449b 100644 --- a/pkg/registry/registry.go +++ b/pkg/registry/registry.go @@ -13,6 +13,7 @@ import ( dfutil "github.com/devfile/library/pkg/util" indexSchema "github.com/devfile/registry-support/index/generator/schema" "github.com/devfile/registry-support/registry-library/library" + "k8s.io/klog" "github.com/redhat-developer/odo/pkg/api" "github.com/redhat-developer/odo/pkg/devfile" @@ -40,6 +41,7 @@ func NewRegistryClient(fsys filesystem.Filesystem, preferenceClient preference.C // PullStackFromRegistry pulls stack from registry with all stack resources (all media types) to the destination directory func (o RegistryClient) PullStackFromRegistry(registry string, stack string, destDir string, options library.RegistryOptions) error { + klog.V(3).Infof("sending telemetry data: %#v", options.Telemetry) return library.PullStackFromRegistry(registry, stack, destDir, options) } diff --git a/pkg/segment/integrations.go b/pkg/segment/integrations.go index f59c1095c0e..57f1d38eca8 100644 --- a/pkg/segment/integrations.go +++ b/pkg/segment/integrations.go @@ -22,6 +22,11 @@ func getTelemetryForDevfileRegistry(ctx context.Context) (registryLibrary.Teleme } envConfig := envcontext.GetEnvConfig(ctx) + + if envConfig.TelemetryCaller != "" { + td.Client += "-" + envConfig.TelemetryCaller + } + if envConfig.OdoDebugTelemetryFile != nil { return td, nil }