Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Added a panic recovery middleware after the logger so that we know what the query was that triggered a panic#1784

Merged
Dieterbe merged 1 commit intomasterfrom
recover_after_logging
Apr 16, 2020
Merged

Added a panic recovery middleware after the logger so that we know what the query was that triggered a panic#1784
Dieterbe merged 1 commit intomasterfrom
recover_after_logging

Conversation

@fkaleo
Copy link
Copy Markdown
Contributor

@fkaleo fkaleo commented Apr 16, 2020

No description provided.

@Dieterbe
Copy link
Copy Markdown
Contributor

Dieterbe commented Apr 16, 2020

Great that this logs the entry we needed + fixes the metrics
but I don't like that it repeats the entire stacktrace, and in such an ugly way...

...
metrictank_1    | /home/dieter/go/src/github.com/grafana/metrictank/vendor/github.com/go-macaron/inject/inject.go:135 (0xab10d8)
metrictank_1    | /home/dieter/go/src/github.com/grafana/metrictank/vendor/gopkg.in/macaron.v1/context.go:121 (0xacbe48)
metrictank_1    | /home/dieter/go/src/github.com/grafana/metrictank/vendor/gopkg.in/macaron.v1/router.go:187 (0xaddb66)
metrictank_1    | /home/dieter/go/src/github.com/grafana/metrictank/vendor/gopkg.in/macaron.v1/router.go:294 (0xad7fcd)
metrictank_1    | /home/dieter/go/src/github.com/grafana/metrictank/vendor/gopkg.in/macaron.v1/macaron.go:220 (0xad0bea)
metrictank_1    | /usr/lib/go/src/net/http/server.go:2807 (0x7420e2)
metrictank_1    | /usr/lib/go/src/net/http/server.go:1895 (0x73db5b)
metrictank_1    | /usr/lib/go/src/runtime/asm_amd64.s:1373 (0x467100)
grafana_1       | t=2020-04-16T17:47:17+0000 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/datasources/proxy/2/render status=500 remote_addr=172.19.0.1 time_ms=3 size=6076 referer="http://localhost:3000/dashboard/new?panelId=2&edit&fullscreen&orgId=1&from=now-5m&to=now"
metrictank_1    | 2020-04-16 17:47:17.695 [INFO] ts=2020-04-16T17:47:17.695183308Z traceID=66f58767d7e167d8, sampled=true msg="POST /render?format=json&from=-5min&maxDataPoints=1870&meta=true&target=asPercent%28metrictank.stats.docker-env.default.tank.metrics_active.gauge32%2CconstantLine%28100%29%29&until=now (500) 2.598738ms" orgID=1 sourceIP="172.19.0.1, 172.19.0.1" error="%3Chtml%3E%0A%3Chead%3E%3Ctitle%3EPANIC:%20runtime%20error:%20integer%20divide%20by%20zero%3C%2Ftitle%3E%0A%3Cmeta%20charset=%22utf-8%22%20%2F%3E%0A%3Cstyle%20type=%22text%2Fcss%22%3E%0Ahtml%2C%20body%20%7B%0A%09font-family:%20%22Roboto%22%2C%20sans-serif%3B%0A%09color:%20%23333333%3B%0A%09background-color:%20%23ea5343%3B%0A%09margin:%200px%3B%0A%7D%0Ah1%20%7B%0A%09color:%20%23d04526%3B%0A%09background-color:%20%23ffffff%3B%0A%09padding:%2020px%3B%0A%09border-bottom:%201px%20dashed%20%232b3848%3B%0A%7D%0Apre%20%7B%0A%09margin:%2020px%3B%0A%09padding:%2020px%3B%0A%09border:%202px%20solid%20%232b3848%3B%0A%09background-color:%20%23ffffff%3B%0A%09white-space:%20pre-wrap%3B%20%20%20%20%20%20%20%2F%2A%20css-3%20%2A%2F%0A%09white-space:%20-moz-pre-wrap%3B%20%20%2....

@Dieterbe Dieterbe merged commit 2add62b into master Apr 16, 2020
@Dieterbe Dieterbe deleted the recover_after_logging branch April 16, 2020 17:57
@Dieterbe
Copy link
Copy Markdown
Contributor

fix #1782

@Dieterbe Dieterbe added this to the sprint-10 milestone Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants