mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-15 19:25:52 +08:00
fix: dont request query progress reporting if reporting query start failed (#5958)
This commit is contained in:
parent
f8e97c9c5c
commit
83d01e7a0d
@ -3656,15 +3656,18 @@ func (aH *APIHandler) queryRangeV3(ctx context.Context, queryRangeParams *v3.Que
|
|||||||
// Hook up query progress tracking if requested
|
// Hook up query progress tracking if requested
|
||||||
queryIdHeader := r.Header.Get("X-SIGNOZ-QUERY-ID")
|
queryIdHeader := r.Header.Get("X-SIGNOZ-QUERY-ID")
|
||||||
if len(queryIdHeader) > 0 {
|
if len(queryIdHeader) > 0 {
|
||||||
ctx = context.WithValue(ctx, "queryId", queryIdHeader)
|
|
||||||
|
|
||||||
onQueryFinished, err := aH.reader.ReportQueryStartForProgressTracking(queryIdHeader)
|
onQueryFinished, err := aH.reader.ReportQueryStartForProgressTracking(queryIdHeader)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error(
|
zap.L().Error(
|
||||||
"couldn't report query start for progress tracking",
|
"couldn't report query start for progress tracking",
|
||||||
zap.String("queryId", queryIdHeader), zap.Error(err),
|
zap.String("queryId", queryIdHeader), zap.Error(err),
|
||||||
)
|
)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
// Adding queryId to the context signals clickhouse queries to report progress
|
||||||
|
ctx = context.WithValue(ctx, "queryId", queryIdHeader)
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
go onQueryFinished()
|
go onQueryFinished()
|
||||||
}()
|
}()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user