Skip to content

Commit

Permalink
avoids recording stats in the sharded engine (#2249)
Browse files Browse the repository at this point in the history
  • Loading branch information
owen-d authored Jun 22, 2020
1 parent 42dccae commit 15378cf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/logql/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func (ng *Engine) Query(params Params) Query {
parse: func(_ context.Context, query string) (Expr, error) {
return ParseExpr(query)
},
record: true,
}
}

Expand All @@ -114,6 +115,7 @@ type query struct {
params Params
parse func(context.Context, string) (Expr, error)
evaluator Evaluator
record bool
}

// Exec Implements `Query`. It handles instrumentation & defers to Eval.
Expand Down Expand Up @@ -142,7 +144,10 @@ func (q *query) Exec(ctx context.Context) (Result, error) {
status = "400"
}
}
RecordMetrics(ctx, q.params, status, statResult)

if q.record {
RecordMetrics(ctx, q.params, status, statResult)
}

return Result{
Data: data,
Expand Down

0 comments on commit 15378cf

Please sign in to comment.