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.

fix: mutex lock to avoid concurrent map writes (#2796)

Vishal Sharma26a806a7fe1c
diff --git a/pkg/query-service/telemetry/telemetry.go b/pkg/query-service/telemetry/telemetry.go
index 8d1967dbc4..0b88b19822 100644
--- a/pkg/query-service/telemetry/telemetry.go
+++ b/pkg/query-service/telemetry/telemetry.go
@@ -308,9 +308,13 @@ func (a *Telemetry) SendEvent(event string, data map[string]interface{}, opts ..
}
if rateLimitFlag {
- if a.rateLimits[event] < RATE_LIMIT_VALUE {
+ telemetry.mutex.Lock()
+ limit := a.rateLimits[event]
+ if limit < RATE_LIMIT_VALUE {
a.rateLimits[event] += 1
+ telemetry.mutex.Unlock()
} else {
+ telemetry.mutex.Unlock()
return
}
}