mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 17:35:55 +08:00
fix: telemetry nil pointer error fix (#6051)
This commit is contained in:
parent
3866f89d3e
commit
f69aaa2cfb
@ -12,6 +12,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-co-op/gocron"
|
"github.com/go-co-op/gocron"
|
||||||
|
"go.uber.org/zap"
|
||||||
"gopkg.in/segmentio/analytics-go.v3"
|
"gopkg.in/segmentio/analytics-go.v3"
|
||||||
|
|
||||||
"go.signoz.io/signoz/pkg/query-service/constants"
|
"go.signoz.io/signoz/pkg/query-service/constants"
|
||||||
@ -258,7 +259,11 @@ func createTelemetry() {
|
|||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
// Define heartbeat function
|
// Define heartbeat function
|
||||||
heartbeatFunc := func() {
|
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 {
|
if len(tagsInfo.Env) != 0 {
|
||||||
telemetry.SendEvent(TELEMETRY_EVENT_ENVIRONMENT, map[string]interface{}{"value": tagsInfo.Env}, "", true, false)
|
telemetry.SendEvent(TELEMETRY_EVENT_ENVIRONMENT, map[string]interface{}{"value": tagsInfo.Env}, "", true, false)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user