Grafana proxy to datasource timeout

Hello ,
I set-up a mongodb datasouce and I want to display some graphs . In the database are a lot of values over 100k and sometime the aggregation query take too much time so in the dashboard I get "Resource Error " - Failed to load resource: the server responded with a status of 502 (Bad Gateway) but the query is still running in datasource proxy and finish well after some time .
Is there any way to increase the timeout for the proxy request to db . In log is mention something like - time_ms=120008

Here are also log entries
t=2019-04-24T17:59:42+0300 lvl=info msg=“Proxying incoming request”
logger=data-proxy-log userid=1 orgid=1 username=admin datasource=grafana-mongodb-datasource
uri=/api/datasources/proxy/1/query method=POST body="{“timezone”:“browser”,“panelId”:2,“dashboardId”:9,
“range”:{“from”:“2019-04-22T21:00:00.000Z”,“to”:“2019-04-23T07:59:59.000Z”, …",“db”:“testDB”}}"
t=2019-04-24T18:01:42+0300 lvl=info msg=“Request Completed” logger=context userId=1 orgId=1 uname=admin method=POST
path=/api/datasources/proxy/1/query status=502 remote_addr=[::1] time_ms=120008
size=0 referer=“http://localhost:3000/d/nvX_XNzZk/new-dashboard-copy?orgId=1&fullscreen&edit&panelId=2

1 Like