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 45c04be
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions npm/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,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
if config.Toggles.EnableV2NPM {
Expand Down Expand Up @@ -198,10 +203,6 @@ func start(config npmconfig.Config, flags npmconfig.Flags) error {
dp.RunPeriodicTasks()
}
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 45c04be

Please sign in to comment.