Skip to content

Commit

Permalink
log: [NPM] init telemetry before dataplane
Browse files Browse the repository at this point in the history
Signed-off-by: Hunter Gregory <[email protected]>
  • Loading branch information
huntergregory committed Jan 6, 2025
1 parent bbe5cb9 commit abc036d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions npm/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit abc036d

Please sign in to comment.