diff --git a/plugin/storage/es/spanstore/reader.go b/plugin/storage/es/spanstore/reader.go index 1f1f602a8eb..840ba06762a 100644 --- a/plugin/storage/es/spanstore/reader.go +++ b/plugin/storage/es/spanstore/reader.go @@ -162,7 +162,7 @@ func getLoggingTimeRangeIndexFn(logger *zap.Logger, fn timeRangeIndexFn) timeRan } return func(indexName string, indexDateLayout string, startTime time.Time, endTime time.Time, reduceDuration time.Duration) []string { indices := fn(indexName, indexDateLayout, startTime, endTime, reduceDuration) - // logger.Debug("Reading from ES indices", zap.Strings("index", indices)) + logger.Debug("Reading from ES indices", zap.Strings("index", indices)) return indices } } diff --git a/plugin/storage/es/spanstore/writer.go b/plugin/storage/es/spanstore/writer.go index 050905b8116..2291ce07277 100644 --- a/plugin/storage/es/spanstore/writer.go +++ b/plugin/storage/es/spanstore/writer.go @@ -128,7 +128,7 @@ func (s *SpanWriter) WriteSpan(_ context.Context, span *model.Span) error { s.writeService(serviceIndexName, jsonSpan) } s.writeSpan(spanIndexName, jsonSpan) - // s.logger.Debug("Wrote span to ES index", zap.String("index", spanIndexName)) + s.logger.Debug("Wrote span to ES index", zap.String("index", spanIndexName)) return nil } diff --git a/plugin/storage/integration/integration.go b/plugin/storage/integration/integration.go index 058838b3b93..9e2f8efaf66 100644 --- a/plugin/storage/integration/integration.go +++ b/plugin/storage/integration/integration.go @@ -205,12 +205,12 @@ func (s *StorageIntegration) testArchiveTrace(t *testing.T) { var actual *model.Trace found := s.waitForCondition(t, func(_ *testing.T) bool { - var err error iterTraces := s.ArchiveTraceReader.GetTraces(context.Background(), tracestore.GetTraceParams{TraceID: v1adapter.FromV1TraceID(tID)}) traces, err := v1adapter.V1TracesFromSeq2(iterTraces) - if len(traces) > 0 { - actual = traces[0] + if len(traces) == 0 { + return false } + actual = traces[0] return err == nil && len(actual.Spans) >= len(expected.Spans) }) require.True(t, found) @@ -230,9 +230,10 @@ func (s *StorageIntegration) testGetLargeSpan(t *testing.T) { found := s.waitForCondition(t, func(_ *testing.T) bool { iterTraces := s.TraceReader.GetTraces(context.Background(), tracestore.GetTraceParams{TraceID: expectedTraceID}) traces, err := v1adapter.V1TracesFromSeq2(iterTraces) - if len(traces) > 0 { - actual = traces[0] + if len(traces) == 0 { + return false } + actual = traces[0] return err == nil && len(actual.Spans) >= len(expected.Spans) }) @@ -310,9 +311,10 @@ func (s *StorageIntegration) testGetTrace(t *testing.T) { t.Log(err) return false } - if len(traces) > 0 { - actual = traces[0] + if len(traces) == 0 { + return false } + actual = traces[0] return len(actual.Spans) == len(expected.Spans) }) if !assert.True(t, found) {