Skip to content

Commit

Permalink
fix: telemetry nil pointer error fix (SigNoz#6051)
Browse files Browse the repository at this point in the history
  • Loading branch information
nityanandagohain authored Sep 23, 2024
1 parent 3866f89 commit f69aaa2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/query-service/telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"time"

"github.com/go-co-op/gocron"
"go.uber.org/zap"
"gopkg.in/segmentio/analytics-go.v3"

"go.signoz.io/signoz/pkg/query-service/constants"
Expand Down Expand Up @@ -258,7 +259,11 @@ func createTelemetry() {
ctx := context.Background()
// Define heartbeat function
heartbeatFunc := func() {
tagsInfo, _ := telemetry.reader.GetTagsInfoInLastHeartBeatInterval(ctx, HEART_BEAT_DURATION)
tagsInfo, err := telemetry.reader.GetTagsInfoInLastHeartBeatInterval(ctx, HEART_BEAT_DURATION)
if err != nil {
zap.L().Error("heartbeatFunc: failed to get tags info", zap.Error(err))
return
}

if len(tagsInfo.Env) != 0 {
telemetry.SendEvent(TELEMETRY_EVENT_ENVIRONMENT, map[string]interface{}{"value": tagsInfo.Env}, "", true, false)
Expand Down

0 comments on commit f69aaa2

Please sign in to comment.