From 287fb43d777c8a8791aabd9ba9ef2d5a8666b781 Mon Sep 17 00:00:00 2001 From: Annanay Date: Wed, 30 Jan 2019 00:50:48 +0530 Subject: [PATCH] Re-evaluate fields in GRPCHandler Signed-off-by: Annanay --- cmd/query/app/grpc_handler.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/cmd/query/app/grpc_handler.go b/cmd/query/app/grpc_handler.go index cc90cd9c8f0a..e432d3eb8d6e 100644 --- a/cmd/query/app/grpc_handler.go +++ b/cmd/query/app/grpc_handler.go @@ -35,8 +35,6 @@ type GRPCHandler struct { archiveSpanReader spanstore.Reader dependencyReader dependencystore.Reader logger *zap.Logger - queryParser queryParser - tracer opentracing.Tracer } // NewGRPCHandler returns a GRPCHandler @@ -44,18 +42,11 @@ func NewGRPCHandler(spanReader spanstore.Reader, dependencyReader dependencystor gH := &GRPCHandler{ spanReader: spanReader, dependencyReader: dependencyReader, - queryParser: queryParser{ - traceQueryLookbackDuration: defaultTraceQueryLookbackDuration, - timeNow: time.Now, - }, } if gH.logger == nil { gH.logger = zap.NewNop() } - if gH.tracer == nil { - gH.tracer = opentracing.NoopTracer{} - } return gH } @@ -82,6 +73,9 @@ func (g *GRPCHandler) GetTrace(ctx context.Context, r *api_v2.GetTraceRequest) ( } trace, err = g.archiveSpanReader.GetTrace(ctx, traceID) + if err != nil { + g.logger.Error("Could not fetch spans from backend", zap.Error(err)) + } } return &api_v2.GetTraceResponse{Trace: trace}, nil