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: update active user event (#4271)
Vishal Sharmad93cc767a6cb
diff --git a/pkg/query-service/app/clickhouseReader/reader.go b/pkg/query-service/app/clickhouseReader/reader.goindex dba0a2e30b..0340474596 100644--- a/pkg/query-service/app/clickhouseReader/reader.go+++ b/pkg/query-service/app/clickhouseReader/reader.go@@ -3381,9 +3381,9 @@ func (r *ClickHouseReader) GetLogsInfoInLastHeartBeatInterval(ctx context.ContexqueryStr := fmt.Sprintf("select count() from %s.%s where timestamp > toUnixTimestamp(now()-toIntervalMinute(%d))*1000000000;", r.logsDB, r.logsTable, 30)- r.db.QueryRow(ctx, queryStr).Scan(&totalLogLines)+ err := r.db.QueryRow(ctx, queryStr).Scan(&totalLogLines)- return totalLogLines, nil+ return totalLogLines, err}func (r *ClickHouseReader) GetTagsInfoInLastHeartBeatInterval(ctx context.Context) (*model.TagsInfo, error) {diff --git a/pkg/query-service/telemetry/telemetry.go b/pkg/query-service/telemetry/telemetry.goindex 4797e7d740..8bb8f4b334 100644--- a/pkg/query-service/telemetry/telemetry.go+++ b/pkg/query-service/telemetry/telemetry.go@@ -199,6 +199,12 @@ func createTelemetry() {for {select {case <-activeUserTicker.C:+ if telemetry.activeUser["logs"] != 0 {+ getLogsInfoInLastHeartBeatInterval, err := telemetry.reader.GetLogsInfoInLastHeartBeatInterval(context.Background())+ if err != nil && getLogsInfoInLastHeartBeatInterval == 0 {+ telemetry.activeUser["logs"] = 0+ }+ }if (telemetry.activeUser["traces"] != 0) || (telemetry.activeUser["metrics"] != 0) || (telemetry.activeUser["logs"] != 0) {telemetry.activeUser["any"] = 1}