Skip to content

Commit

Permalink
Re-evaluate fields in GRPCHandler
Browse files Browse the repository at this point in the history
Signed-off-by: Annanay <[email protected]>
  • Loading branch information
Annanay committed Jan 29, 2019
1 parent fc534f8 commit 287fb43
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions cmd/query/app/grpc_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,18 @@ type GRPCHandler struct {
archiveSpanReader spanstore.Reader
dependencyReader dependencystore.Reader
logger *zap.Logger
queryParser queryParser
tracer opentracing.Tracer
}

// NewGRPCHandler returns a GRPCHandler
func NewGRPCHandler(spanReader spanstore.Reader, dependencyReader dependencystore.Reader, options ...HandlerOption) *GRPCHandler {
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
}
Expand All @@ -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
Expand Down

0 comments on commit 287fb43

Please sign in to comment.