Skip to content

Commit

Permalink
feat: 更新 trace 上报信息 --story=116406750 (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
shamcleren authored Mar 7, 2024
1 parent d6498bc commit 5aa4e6b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions pkg/unify-query/service/http/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,23 +286,26 @@ func queryTs(ctx context.Context, query *structured.QueryTs) (interface{}, error
return nil, err
}

var factor float64
if ok, factor, err = downsample.CheckDownSampleRange(query.Step, query.DownSampleRange); ok {
if err == nil {
var (
factor float64
downSampleError error
)
if ok, factor, downSampleError = downsample.CheckDownSampleRange(query.Step, query.DownSampleRange); ok {
if downSampleError == nil {
var info *TimeInfo
if info, err = getTimeInfo(&structured.CombinedQueryParams{
if info, downSampleError = getTimeInfo(&structured.CombinedQueryParams{
Start: query.Start,
End: query.End,
Step: query.DownSampleRange,
}); err == nil {
}); downSampleError == nil {
log.Debugf(context.TODO(), "respData to down sample: %+v", info)
resp.Downsample(factor)
}
}
}

resp.Status = metadata.GetStatus(ctx)
return resp, nil
return resp, err
}

func structToPromQL(ctx context.Context, query *structured.QueryTs) (*structured.QueryPromQL, error) {
Expand Down

0 comments on commit 5aa4e6b

Please sign in to comment.