From e48cfc9d42fb7747b8b5feb0757c3a2c212a2c5a Mon Sep 17 00:00:00 2001 From: Hunter Gregory <42728408+huntergregory@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:03:30 -0800 Subject: [PATCH] log: [NPM] init telemetry before dataplane Signed-off-by: Hunter Gregory <42728408+huntergregory@users.noreply.github.com> --- npm/cmd/start.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/npm/cmd/start.go b/npm/cmd/start.go index 0969720f94..900fb8fa8a 100644 --- a/npm/cmd/start.go +++ b/npm/cmd/start.go @@ -131,7 +131,11 @@ func start(config npmconfig.Config, flags npmconfig.Flags) error { }), ) } - k8sServerVersion := k8sServerVersion(clientset) + + err = metrics.CreateTelemetryHandle(config.NPMVersion(), version, npm.GetAIMetadata()) + if err != nil { + klog.Infof("CreateTelemetryHandle failed with error %v. AITelemetry is not initialized.", err) + } var dp dataplane.GenericDataplane stopChannel := wait.NeverStop @@ -197,11 +201,9 @@ func start(config npmconfig.Config, flags npmconfig.Flags) error { } dp.RunPeriodicTasks() } + + k8sServerVersion := k8sServerVersion(clientset) npMgr := npm.NewNetworkPolicyManager(config, factory, podFactory, dp, exec.New(), version, k8sServerVersion) - err = metrics.CreateTelemetryHandle(config.NPMVersion(), version, npm.GetAIMetadata()) - if err != nil { - klog.Infof("CreateTelemetryHandle failed with error %v. AITelemetry is not initialized.", err) - } go restserver.NPMRestServerListenAndServe(config, npMgr)