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: fixed random number generation to match to maxRandInt

Ankit Nayan578dafd1ff56
diff --git a/pkg/query-service/telemetry/telemetry.go b/pkg/query-service/telemetry/telemetry.go
index 1d2fa5429e..687f8dddec 100644
--- a/pkg/query-service/telemetry/telemetry.go
+++ b/pkg/query-service/telemetry/telemetry.go
@@ -39,9 +39,9 @@ var once sync.Once
func (a *Telemetry) IsSampled() bool {
- number := a.minRandInt + rand.Intn(a.maxRandInt-a.minRandInt)
+ random_number := a.minRandInt + rand.Intn(a.maxRandInt-a.minRandInt) + 1
- if (number % a.maxRandInt) == 0 {
+ if (random_number % a.maxRandInt) == 0 {
return true
} else {
return false