SQL Server plugin for Grafana

All of my data resides in MS SQL Server. Do I need to migrate the data I need to one of the Grafana data-sources first?

Thanks

2 Likes

For now yes. We are working on adding SQL support but first on the list of supported data sources are MySQL and Postgres.

So MS SQL support might take a while (6-24 months) until we add support.

If you are talking about something small then you could make your own web service that talks to your Sql Server and uses the Simple JSON data source to get the data into Grafana: https://github.com/grafana/simple-json-datasource

Someone developed a SQL datasource that takes SQL Server. It looks like it could suit your needs.

I noticed in your blog post that a PostgreSQL datasource is high on your priority list. Are you looking for contributors for that project? Any idea what the timeline is like?

We hope to have at least a beta out over the next several weeks. We are starting with Postgres and then MySQL. We’ve gotten some great PRs and feedback from the community, and we’d always love help.

1 Like

solugebefola thanks for posting this, it may be just the one that I need. I’m new to Grafana and eager to learn what it seems to be a fantastic product. Unfortunately I do not understand these instructions due of not been familiar with the product. Could anyone please give a more detailed instructions on how to do the below? Thank you.

Install sqlproxyserver
Run npm install on the plugin directory
Run server side code /serverside/sqlproxyserver.js
Add new datasource Add a new datasource to Grafana and set the url to:

http://myserver:port/?con=mssql://user:name@server/database

I was able to figure out how to run npm, unfortunately struggling with this
Run server side code /serverside/sqlproxyserver.js
how and where would I run this? Do I need to replace the serverside to something?
Thanks in advance for your help

I’m surprised that no one knows how to do it. Thanks anyway.

@alphatech, any luck with the /serverside/sqlproxyserver.js ? I’m facing the same issue.

unfortunately not but Grafana team is helping with Mysql.

I got as far as starting sqlproxyserver.js using “node grafana-simple-sql-datasource-master/src/serverside/sqlproxyserver.js”, tried running on port 666 and 1433, not sure if it matters. Then I set up the data source and am receiving this:

Error

{“data”:{“code”:“MODULE_NOT_FOUND”},“status”:500,“config”:{“method”:“POST”,“transformRequest”:[null],“transformResponse”:[null],“jsonpCallbackParam”:“callback”,“url”:“api/datasources/proxy/1”,“data”:{“type”:“test”,“body”:null,“url”:null},“retry”:0,“headers”:{“X-Grafana-Org-Id”:1,“Accept”:“application/json, text/plain, /”,“Content-Type”:“application/json;charset=utf-8”}},“statusText”:“Internal Server Error”}

Not sure how to proceed, I will say for those that are trying to start sqlproxyserver.js that there were a lot of dependencies I needed to install to get it to run.

ie,

npm install lodash
npm install mssql
npm install moment
npm install express
npm install node-gyp

Hi @bluenine,

This is gbrian Sorry did not see this post.
We are following same case at https://github.com/gbrian/grafana-simple-sql-datasource/issues/2
Please join us there.

Run it from command prompt similar to following :

C:\grafana-4.3.2\data\plugins\grafana-simple-sql-datasource-master>node dist\serverside\sqlproxyserver.js

Server is listening to port 666

@bluenine and anyone having the MODULE_NOT_FOUND issue:
Now is fixed. Found that grafana is stripping the url of the datasource when proxied.
Download latest version

I am getting success when I connect to the url, but when I try to add it as a datasource in grafana I am getting the following error output on the proxy any ideas?

TypeError: Cannot read property ‘1’ of null
at SQLProxyServer.getConnection (/var/lib/grafana/plugins/grafana-simple-sql-datasource-master/dist/serverside/sqlproxyserver.js:37:44)
at /var/lib/grafana/plugins/grafana-simple-sql-datasource-master/dist/serverside/sqlproxyserver.js:71:13
at Layer.handle [as handle_request] (/var/lib/grafana/plugins/grafana-simple-sql-datasource-master/node_modules/express/lib/router/layer.js:95:5)
at next (/var/lib/grafana/plugins/grafana-simple-sql-datasource-master/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/var/lib/grafana/plugins/grafana-simple-sql-datasource-master/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/var/lib/grafana/plugins/grafana-simple-sql-datasource-master/node_modules/express/lib/router/layer.js:95:5)
at /var/lib/grafana/plugins/grafana-simple-sql-datasource-master/node_modules/express/lib/router/index.js:281:22
at param (/var/lib/grafana/plugins/grafana-simple-sql-datasource-master/node_modules/express/lib/router/index.js:354:14)
at param (/var/lib/grafana/plugins/grafana-simple-sql-datasource-master/node_modules/express/lib/router/index.js:365:14)
at Function.process_params (/var/lib/grafana/plugins/grafana-simple-sql-datasource-master/node_modules/express/lib/router/index.js:410:3)

Hi all,

Grafana v5.1 will ship with a built-in Microsoft SQL Server (MSSQL) data source plugin that allows you to query and visualize data from any Microsoft SQL Server 2005 or newer.

v5.1 is not yet released, but you can try it out using the nightly builds or building from source.

Please see documentation for further information.

Marcus