Skip to content

Commit

Permalink
chore(analytic): send install event on cStor-csi controller start
Browse files Browse the repository at this point in the history
This commit sends install & ping events of cStor-csi controller service

Signed-off-by: mittachaitu <[email protected]>
  • Loading branch information
mittachaitu authored and kmova committed Sep 16, 2021
1 parent d553e13 commit 77ffa28
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/driver/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (

"github.com/container-storage-interface/spec/lib/go/csi"
config "github.com/openebs/cstor-csi/pkg/config"
"github.com/openebs/cstor-csi/pkg/env"
analytics "github.com/openebs/cstor-csi/pkg/usage"
utils "github.com/openebs/cstor-csi/pkg/utils"
"github.com/sirupsen/logrus"
)
Expand Down Expand Up @@ -118,6 +120,14 @@ func (d *CSIDriver) Run() error {
s := utils.NewNonBlockingGRPCServer()

s.Start(d.config.Endpoint, d.ids, d.cs, d.ns)

// Send Event only after starting controller.
// ControllerServer(cs) will be non-empty only if driver is running as controller service
if d.cs != nil && env.Truthy(env.OpenEBSEnableAnalytics) {
analytics.New().Build().InstallBuilder(true).Send()
go analytics.PingCheck()
}

s.Wait()

return nil
Expand Down

0 comments on commit 77ffa28

Please sign in to comment.