chop-dbhi / prometheus-sql

Service that exposes Prometheus metrics for a SQL result set.
BSD 2-Clause "Simplified" License
202 stars 55 forks source link

Without docker #118

Closed oak-11 closed 2 years ago

oak-11 commented 2 years ago

Can this be used directly on Windows?

haxorof commented 2 years ago

Yes, you can download the binary for Windows you find in the releases.

oak-11 commented 2 years ago

Thanks. However I am getting this error - C:\windows-amd64>prometheus-sql 2022/05/08 22:28:17 prometheus-sql starting up... Usage of prometheus-sql: -config string Configuration file to define common data sources etc. -host string Host of the service. (default "0.0.0.0") -lax Tolerate invalid files in queryDir -port int Port of the service. (default 8080) -queries string Path to file containing queries. (default "queries.yml") -queryDir string Path to directory containing queries. -service string Query of SQL agent service. 2022/05/08 22:28:17 Error: URL to SQL Agent service required.

haxorof commented 2 years ago

As the error states you cannot start prometheus-sql without any arguments. You need to specify the URL to where you run your SQL agent and then a config file.

Do have a look at the examples in this repo even if they are using docker you see that -service etc are specified.

oak-11 commented 2 years ago

I am using Windows and have sql server installed on it (localhost). I do not see any related examples for using -service for sql server on Windows. I tried giving driver: sqlserver and other connection details in the queries.yml file but it didn't help.

haxorof commented 2 years ago

prometheus-sql does not connect to any databases itself. The service that do connect to the databases are SQL agent which prometheus-sql wants a URL to: https://github.com/chop-dbhi/sql-agent

So you need to run that too to be able to get it all working.

oak-11 commented 2 years ago

Thanks. But this sql-agent can be run only using docker right? I do not see any exe file for Windows. Installation note also mentions so.

haxorof commented 2 years ago

True, it does not seem it got any binary for Windows and that can be due to the fact it integrate with other databases like Oracle.

oak-11 commented 2 years ago

Ok, thanks for your quick replies.