Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(telemetry): Track enterprise feature usage #7495

Merged
merged 1 commit into from
Mar 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"runtime"
"time"

"github.com/dgraph-io/dgraph/ee"
"github.com/dgraph-io/dgraph/protos/pb"
"github.com/dgraph-io/dgraph/x"
"github.com/golang/glog"
Expand All @@ -32,19 +33,20 @@ import (

// Telemetry holds information about the state of the zero and alpha server.
type Telemetry struct {
Arch string `json:",omitempty"`
Cid string `json:",omitempty"`
ClusterSize int `json:",omitempty"`
DiskUsageMB int64 `json:",omitempty"`
NumAlphas int `json:",omitempty"`
NumGroups int `json:",omitempty"`
NumTablets int `json:",omitempty"`
NumZeros int `json:",omitempty"`
OS string `json:",omitempty"`
SinceHours int `json:",omitempty"`
Version string `json:",omitempty"`
NumGraphQLPM uint64 `json:",omitempty"`
NumGraphQL uint64 `json:",omitempty"`
Arch string `json:",omitempty"`
Cid string `json:",omitempty"`
ClusterSize int `json:",omitempty"`
DiskUsageMB int64 `json:",omitempty"`
NumAlphas int `json:",omitempty"`
NumGroups int `json:",omitempty"`
NumTablets int `json:",omitempty"`
NumZeros int `json:",omitempty"`
OS string `json:",omitempty"`
SinceHours int `json:",omitempty"`
Version string `json:",omitempty"`
NumGraphQLPM uint64 `json:",omitempty"`
NumGraphQL uint64 `json:",omitempty"`
EEFeaturesList []string `json:",omitempty"`
}

const url = "https://ping.dgraph.io/3.0/projects/5b809dfac9e77c0001783ad0/events"
Expand Down Expand Up @@ -87,6 +89,7 @@ func NewAlpha(ms *pb.MembershipState) *Telemetry {

// Post reports the Telemetry to the stats server.
func (t *Telemetry) Post() error {
t.EEFeaturesList = ee.GetEEFeaturesList()
data, err := json.Marshal(t)
if err != nil {
return err
Expand Down