Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

chore: added group analytics

Ankit Nayan4875652ecb32
diff --git a/pkg/query-service/telemetry/telemetry.go b/pkg/query-service/telemetry/telemetry.go
index 43d27484e5..0774b7bb91 100644
--- a/pkg/query-service/telemetry/telemetry.go
+++ b/pkg/query-service/telemetry/telemetry.go
@@ -5,6 +5,7 @@ import (
"io/ioutil"
"net/http"
"os"
+ "strings"
"sync"
"time"
@@ -35,12 +36,13 @@ var telemetry *Telemetry
var once sync.Once
type Telemetry struct {
- operator analytics.Client
- ipAddress string
- isEnabled bool
- isAnonymous bool
- distinctId string
- reader interfaces.Reader
+ operator analytics.Client
+ ipAddress string
+ isEnabled bool
+ isAnonymous bool
+ distinctId string
+ reader interfaces.Reader
+ companyDomain string
}
func createTelemetry() {
@@ -106,6 +108,7 @@ func (a *Telemetry) IdentifyUser(user *model.User) {
if !a.isTelemetryEnabled() || a.isTelemetryAnonymous() {
return
}
+ a.setCompanyDomain(user.Email)
a.operator.Enqueue(analytics.Identify{
UserId: a.ipAddress,
@@ -113,6 +116,21 @@ func (a *Telemetry) IdentifyUser(user *model.User) {
})
}
+
+func (a *Telemetry) setCompanyDomain(email string) {
+
+ email_split := strings.Split(email, "@")
+ if len(email_split) != 2 {
+ a.companyDomain = email
+ }
+ a.companyDomain = email_split[1]
+
+}
+
+func (a *Telemetry) getCompanyDomain() string {
+ return a.companyDomain
+}
+
func (a *Telemetry) checkEvents(event string) bool {
sendEvent := true
if event == TELEMETRY_EVENT_USER && a.isTelemetryAnonymous() {
@@ -136,6 +154,7 @@ func (a *Telemetry) SendEvent(event string, data map[string]interface{}) {
properties := analytics.NewProperties()
properties.Set("version", version.GetVersion())
properties.Set("deploymentType", getDeploymentType())
+ properties.Set("companyDomain", a.getCompanyDomain())
for k, v := range data {
properties.Set(k, v)