Skip to content

Commit

Permalink
fix span to log
Browse files Browse the repository at this point in the history
Signed-off-by: Callum Styan <[email protected]>
  • Loading branch information
cstyan committed Mar 28, 2024
1 parent 03ff9b7 commit b51ff81
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/querier/queryrange/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ func (r *LokiRequest) WithShards(shards logql.Shards) *LokiRequest {
func (r *LokiRequest) LogToSpan(sp opentracing.Span) {
sp.LogFields(
otlog.String("query", r.GetQuery()),
otlog.String("start", timestamp.Time(r.GetStart().UnixNano()).String()),
otlog.String("end", timestamp.Time(r.GetEnd().UnixNano()).String()),
otlog.String("start", timestamp.Time(r.StartTs.UnixNano()/(int64(time.Millisecond)/int64(time.Nanosecond))).String()),
otlog.String("end", timestamp.Time(r.GetEnd().UnixNano()/(int64(time.Millisecond)/int64(time.Nanosecond))).String()),
otlog.Int64("step (ms)", r.GetStep()),
otlog.Int64("interval (ms)", r.GetInterval()),
otlog.Int64("limit", int64(r.GetLimit())),
Expand Down Expand Up @@ -178,8 +178,8 @@ func (r *LokiSeriesRequest) GetStep() int64 {
func (r *LokiSeriesRequest) LogToSpan(sp opentracing.Span) {
sp.LogFields(
otlog.String("matchers", strings.Join(r.GetMatch(), ",")),
otlog.String("start", timestamp.Time(r.GetStart().UnixNano()).String()),
otlog.String("end", timestamp.Time(r.GetEnd().UnixNano()).String()),
otlog.String("start", timestamp.Time(r.GetStart().UnixNano()/(int64(time.Millisecond)/int64(time.Nanosecond))).String()),
otlog.String("end", timestamp.Time(r.GetEnd().UnixNano()/(int64(time.Millisecond)/int64(time.Nanosecond))).String()),
otlog.String("shards", strings.Join(r.GetShards(), ",")),
)
}
Expand Down Expand Up @@ -249,8 +249,8 @@ func (r *LabelRequest) WithQuery(query string) queryrangebase.Request {

func (r *LabelRequest) LogToSpan(sp opentracing.Span) {
sp.LogFields(
otlog.String("start", timestamp.Time(r.GetStart().UnixNano()).String()),
otlog.String("end", timestamp.Time(r.GetEnd().UnixNano()).String()),
otlog.String("start", timestamp.Time(r.Start.UnixNano()/(int64(time.Millisecond)/int64(time.Nanosecond))).String()),
otlog.String("end", timestamp.Time(r.End.UnixNano()/(int64(time.Millisecond)/int64(time.Nanosecond))).String()),
)
}

Expand Down

0 comments on commit b51ff81

Please sign in to comment.