Browse Source

promql: clarify error message when panic occurs during query evaluation

Signed-off-by: Charles Korn <charles.korn@grafana.com>
pull/14621/head
Charles Korn 4 months ago
parent
commit
f91009aa2e
No known key found for this signature in database
  1. 2
      promql/engine.go

2
promql/engine.go

@ -1057,7 +1057,7 @@ func (ev *evaluator) recover(expr parser.Expr, ws *annotations.Annotations, errp
buf := make([]byte, 64<<10)
buf = buf[:runtime.Stack(buf, false)]
level.Error(ev.logger).Log("msg", "runtime panic in parser", "expr", expr.String(), "err", e, "stacktrace", string(buf))
level.Error(ev.logger).Log("msg", "runtime panic during query evaluation", "expr", expr.String(), "err", e, "stacktrace", string(buf))
*errp = fmt.Errorf("unexpected error: %w", err)
case errWithWarnings:
*errp = err.err

Loading…
Cancel
Save