mullerpeter / databricks-grafana

Grafana Databricks integration allowing direct connection to Databricks to query and visualize Databricks data in Grafana.
Apache License 2.0
55 stars 4 forks source link

HTTP Response code: 500 at first request when using Serverless SQL warehouses #22

Closed y4ns0l0 closed 1 year ago

y4ns0l0 commented 1 year ago

Description

Hi Peter,

Thanks for your contribution (+1 ⭐ ), your plugin works very well. We implemented it a few weeks ago and done some pretty nice dashboards with it based on Detla table in Databricks.

We are using Serverless SQL warehouses and we are facing an issue with the first request on the datasource when warehouse is stopped. When warehouse has started, everything works fine.

Steps to Reproduce

  1. Create a Serverless SQL warehouses
  2. Configure Datasource
  3. Try a first request on Datasource when the warehouse is stopped
  4. Got HTTP Response code: 500 when warehouse is starting
  5. Try a second request on Datasource : OK

plugin logs :

logger=plugin.mullerpeter-databricks-datasource t=2023-08-31T09:02:20.285047045Z level=info msg="Query Ful" query="map[Interval:3e+11 JSON:map[datasource:map[type:mullerpeter-databricks-datasource uid:EWLC3BCVz] datasourceId:27 intervalMs:300000 maxDataPoints:605 querySettings:map[convertLongToWide:true fillMode:1] rawSqlQuery:SELECT COUNT(*) FROM catalog.schema.table; refId:A] MaxDataPoints:605 QueryType: RefID:A TimeRange:map[From:2023-08-29T09:02:20.166Z To:2023-08-31T09:02:20.166Z]]"
logger=plugin.mullerpeter-databricks-datasource t=2023-08-31T09:02:20.285083045Z level=info msg="Raw SQL Query selected" query="SELECT COUNT(*) FROM catalog.schema.table;"
logger=plugin.mullerpeter-databricks-datasource t=2023-08-31T09:02:20.285105246Z level=info msg=Query query="SELECT COUNT(*) FROM catalog.schema.table;"
logger=plugin.mullerpeter-databricks-datasource t=2023-08-31T09:02:25.024604271Z level=info msg=Error err="HTTP Response code: 500"
logger=context userId=2 orgId=1 uname=yann.matysiak@********** t=2023-08-31T09:02:25.024882076Z level=info msg="Request Completed" method=POST path=/api/ds/query status=400 remote_addr=10.8.0.115 time_ms=4741 duration=4.741577067s size=79 referer="https://**************/d/pylnZNkSz/test-dashboard?from=now-2d&orgId=1&to=now" handler=/api/ds/query
logger=cleanup t=2023-08-31T09:05:16.640513989Z level=info msg="Completed cleanup jobs" duration=13.697795ms

Versions

Keep the work up ! 👍

mullerpeter commented 1 year ago

Hi Yann

Thanks for opening the issue. The upgrade of the databricks-sql-go dependency should have fixed the issue. As this is a major version upgrade of the dependency, it could have introduced some other issues. But on first glance everything seems to be working fine on my side. Please let me know if this breaks anything for you.

y4ns0l0 commented 1 year ago

Hi Peter,

I confirm, no more issue while serverless warehouse is starting. Great job ! 🥇