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: dont request query progress reporting if reporting query start failed (#5958)

Raj Kamal Singh83d01e7a0d46
diff --git a/pkg/query-service/app/http_handler.go b/pkg/query-service/app/http_handler.go
index f63f251e11..9411b595a0 100644
--- a/pkg/query-service/app/http_handler.go
+++ b/pkg/query-service/app/http_handler.go
@@ -3656,15 +3656,18 @@ func (aH *APIHandler) queryRangeV3(ctx context.Context, queryRangeParams *v3.Que
// Hook up query progress tracking if requested
queryIdHeader := r.Header.Get("X-SIGNOZ-QUERY-ID")
if len(queryIdHeader) > 0 {
- ctx = context.WithValue(ctx, "queryId", queryIdHeader)
-
onQueryFinished, err := aH.reader.ReportQueryStartForProgressTracking(queryIdHeader)
+
if err != nil {
zap.L().Error(
"couldn't report query start for progress tracking",
zap.String("queryId", queryIdHeader), zap.Error(err),
)
+
} else {
+ // Adding queryId to the context signals clickhouse queries to report progress
+ ctx = context.WithValue(ctx, "queryId", queryIdHeader)
+
defer func() {
go onQueryFinished()
}()