grafana / grafonnet

Jsonnet library for generating Grafana dashboards.
https://grafana.github.io/grafonnet/
Apache License 2.0
320 stars 18 forks source link

Support Microsoft SQL Server Source #208

Open titt opened 1 month ago

titt commented 1 month ago

Currently, there are no query target helpers/functions for Microsoft SQL Server. It would be great to support Microsoft SQL Server as this data source is quite popular.

titt commented 1 month ago

I have created a short workaround by adding some file in the code deployed by the jb install:

{ '#new':: d.func.new( 'Creates a new Microsoft SQL Server query target for panels.', args=[ d.arg('datasource', d.T.string), d.arg('rawSql', d.T.string), d.arg('format', d.T.string), d.arg('rawEditor', d.T.bolean), d.arg('rawQuery', d.T.bolean), d.arg('queryText', d.T.string),
] ), new(datasource, rawSql, format='time_series', rawEditor=true, rawQuery=true, queryText=rawSql): self.withDatasource(datasource)