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.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
chore: reduce events
Ankit Nayana906f94b8af9
diff --git a/pkg/query-service/telemetry/ignoredPaths.go b/pkg/query-service/telemetry/ignored.gosimilarity index 50%rename from pkg/query-service/telemetry/ignoredPaths.gorename to pkg/query-service/telemetry/ignored.goindex e564cce2a2..e0faad4461 100644--- a/pkg/query-service/telemetry/ignoredPaths.go+++ b/pkg/query-service/telemetry/ignored.go@@ -11,3 +11,18 @@ func IgnoredPaths() map[string]struct{} {return ignoredPaths}++func ignoreEvents(event string, attributes map[string]interface{}) bool {++ if event == TELEMETRY_EVENT_ACTIVE_USER || event == TELEMETRY_EVENT_ACTIVE_USER_PH {+ for attr_key, attr_val := range attributes {++ if attr_key == "any" && attr_val.(int8) == 0 {+ return true+ }++ }+ }++ return false+}diff --git a/pkg/query-service/telemetry/telemetry.go b/pkg/query-service/telemetry/telemetry.goindex a2b6031fad..8d1967dbc4 100644--- a/pkg/query-service/telemetry/telemetry.go+++ b/pkg/query-service/telemetry/telemetry.go@@ -46,13 +46,14 @@ const IP_NOT_FOUND_PLACEHOLDER = "NA"const DEFAULT_NUMBER_OF_SERVICES = 6const HEART_BEAT_DURATION = 6 * time.Hour+const ACTIVE_USER_DURATION = 30 * time.Minute// const HEART_BEAT_DURATION = 30 * time.Second// const ACTIVE_USER_DURATION = 30 * time.Secondconst RATE_LIMIT_CHECK_DURATION = 1 * time.Minute-const RATE_LIMIT_VALUE = 2+const RATE_LIMIT_VALUE = 1// const RATE_LIMIT_CHECK_DURATION = 20 * time.Second// const RATE_LIMIT_VALUE = 5@@ -301,6 +302,11 @@ func (a *Telemetry) SendEvent(event string, data map[string]interface{}, opts ..return}+ // drop events with properties matching+ if ignoreEvents(event, data) {+ return+ }+if rateLimitFlag {if a.rateLimits[event] < RATE_LIMIT_VALUE {a.rateLimits[event] += 1