Skip to content

Commit

Permalink
[storage] Fix childspan context while tracing cassandra queries (#1131)
Browse files Browse the repository at this point in the history
Signed-off-by: Annanay <[email protected]>
  • Loading branch information
annanay25 authored and yurishkuro committed Oct 19, 2018
1 parent 7d9d212 commit 4a07b78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/storage/cassandra/spanstore/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func (s *SpanReader) queryByTagsAndLogs(ctx context.Context, tq *spanstore.Trace

results := make([]dbmodel.UniqueTraceIDs, 0, len(tq.Tags))
for k, v := range tq.Tags {
childSpan := opentracing.StartSpan("queryByTag")
childSpan, _ := opentracing.StartSpanFromContext(ctx, "queryByTag")
childSpan.LogFields(otlog.String("tag.key", k), otlog.String("tag.value", v))
query := s.session.Query(
queryByTag,
Expand Down Expand Up @@ -330,7 +330,7 @@ func (s *SpanReader) queryByDuration(ctx context.Context, traceQuery *spanstore.
endTimeByHour := traceQuery.StartTimeMax.Round(durationBucketSize)

for timeBucket := endTimeByHour; timeBucket.After(startTimeByHour) || timeBucket.Equal(startTimeByHour); timeBucket = timeBucket.Add(-1 * durationBucketSize) {
childSpan := opentracing.StartSpan("queryForTimeBucket")
childSpan, _ := opentracing.StartSpanFromContext(ctx, "queryForTimeBucket")
childSpan.LogFields(otlog.String("timeBucket", timeBucket.String()))
query := s.session.Query(
queryByDuration,
Expand Down

0 comments on commit 4a07b78

Please sign in to comment.