mullerpeter / databricks-grafana

Grafana Databricks integration allowing direct connection to Databricks to query and visualize Databricks data in Grafana.
https://mullerpeter.github.io/databricks-grafana/
Apache License 2.0
55 stars 4 forks source link

Allow configuration of Min interval #89

Closed liebsc21 closed 1 week ago

liebsc21 commented 2 months ago

Is your feature request related to a problem? Please describe. The minimal resolution (Min interval) in the time series of a panel defaults to 1min, see Bild (4)

Describe the solution you'd like I like to configure the plugin to default to a smaller resolution, say 1 millisecond. In other words I do not want to change this parameter in every single query of a panel

As I use provisioning to provide a datasource in Grafana, I tried to change the parameter in question via the corresponding YAML file:

  jsonData:
    min_interval: 10s

and many other ways to write min_interval did not succeed.

Additional context I use

liebsc21 commented 1 month ago

I noticed that the minimal time resolution can be set in the module.js of the downloaded assets by changing the value of this.interval=r.timeInterval||"1m" . I implemented a string substitution in my deployment process and thus have a workaround. However allowing this to be an input parameter that can be set in the corresponding YAML file in a provisioing workflow would still be welcome.

mullerpeter commented 1 month ago

Hey @liebsc21 Thanks for opening the issue, as the Datasource settings extend from the standard SQL Datasource settings, I think you should be able to set it as timeInterval in the yaml, as this is then used here: https://github.com/mullerpeter/databricks-grafana/blob/b9f638101e67383eb9541bc33576ac00531cdaab/src/components/grafana-sql/src/datasource/SqlDatasource.ts#L78

I'll try to also expose that setting via the UI Settings in the next release

liebsc21 commented 2 weeks ago

Thanks. Setting

jsonData:
    timeInterval: 1ms

in the yaml file works and is enough for us. From my point of view this issue can be closed.

mullerpeter commented 1 week ago

👍 Glad this works for you.

Closing this for now, might add it to the UI in the future.