mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
TraceView: Allow span links defined on dataFrame (#40563)
* Align range to seconds in log queries * Use default display processor if there is none in FieldDisplayProxy * Allow links defined in dataframe * Remove debug log * Fix typings for span links * Lint go * Fix tests * Update tests * Add test for the display proxy * Streamline the fallback for diplayProcessor
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"sort"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
@@ -201,8 +202,13 @@ func (e *cloudWatchExecutor) executeStartQuery(ctx context.Context, logsClient c
|
||||
logStreamIdentifierInternal + "|" + parameters.Get("queryString").MustString("")
|
||||
|
||||
startQueryInput := &cloudwatchlogs.StartQueryInput{
|
||||
StartTime: aws.Int64(startTime.Unix()),
|
||||
EndTime: aws.Int64(endTime.Unix()),
|
||||
StartTime: aws.Int64(startTime.Unix()),
|
||||
// Usually grafana time range allows only second precision, but you can create ranges with milliseconds
|
||||
// for example when going from trace to logs for that trace and trace length is sub second. In that case
|
||||
// StartTime is effectively floored while here EndTime is ceiled and so we should get the logs user wants
|
||||
// and also a little bit more but as CW logs accept only seconds as integers there is not much to do about
|
||||
// that.
|
||||
EndTime: aws.Int64(int64(math.Ceil(float64(endTime.UnixNano()) / 1e9))),
|
||||
LogGroupNames: aws.StringSlice(parameters.Get("logGroupNames").MustStringArray()),
|
||||
QueryString: aws.String(modifiedQueryString),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user