Skip to content

Commit

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

Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
  • Loading branch information
sai chaithanya authored Sep 16, 2021
1 parent f282d6f commit 1411319
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import (
"github.com/container-storage-interface/spec/lib/go/csi"
config "github.com/openebs/jiva-operator/pkg/config"
"github.com/openebs/jiva-operator/pkg/kubernetes/client"
analytics "github.com/openebs/jiva-operator/pkg/usage"
"github.com/openebs/lib-csi/pkg/common/env"
"github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -95,6 +97,14 @@ func (d *CSIDriver) Run() error {
s := NewNonBlockingGRPCServer(d.config.Endpoint, d.ids, d.cs, d.ns)

s.Start()

// 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(analytics.OpenEBSEnableAnalytics) {
analytics.New().Build().InstallBuilder(true).Send()
go analytics.PingCheck()
}

s.Wait()

return nil
Expand Down

0 comments on commit 1411319

Please sign in to comment.