Skip to content

Print query that caused a panic#10995

Merged
codesome merged 1 commit intoprometheus:mainfrom
prymitive:errors
Jul 14, 2022
Merged

Print query that caused a panic#10995
codesome merged 1 commit intoprometheus:mainfrom
prymitive:errors

Conversation

@prymitive
Copy link
Copy Markdown
Contributor

We print the stacktrace of a panic when query causes one, but there's no
information about the query itself, which makes it harder to debug and
reproduce the issue.
This adds the 'expr' string to the logged panic.

Signed-off-by: Łukasz Mierzwa [email protected]

We print the stacktrace of a panic when query causes one, but there's no
information about the query itself, which makes it harder to debug and
reproduce the issue.
This adds the 'expr' string to the logged panic.

Signed-off-by: Łukasz Mierzwa <[email protected]>
@codesome codesome merged commit 54a3c3b into prometheus:main Jul 14, 2022
@prymitive prymitive deleted the errors branch July 14, 2022 09:41
buf = buf[:runtime.Stack(buf, false)]

level.Error(ev.logger).Log("msg", "runtime panic in parser", "err", e, "stacktrace", string(buf))
level.Error(ev.logger).Log("msg", "runtime panic in parser", "expr", expr.String(), "err", e, "stacktrace", string(buf))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "in parser" correct? Won't this happen for panic during evaluation too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants