ulranh / hana_sql_exporter

hana_sql_exporter - SAP Hana SQL Exporter for Prometheus
Apache License 2.0
28 stars 11 forks source link

Connect Exporter to Hana Cloud #6

Open Abhinand-Gokul opened 2 years ago

Abhinand-Gokul commented 2 years ago

Hello,

How would we connect the exporter to monitor Hana Cloud instance please? From the library go-hdb's documentation that is being used https://github.com/SAP/go-hdb#hana-cloud-connection, it says we can connect when ConnStr is constructed with the Root CA being passed but I am not able to get this working when encrypting with

./hana_sql_exporter pw --tenant h00 --config ./hana_sql_exporter.toml

If I construct the connection string as mentioned in go-hdb documentation then I get : ./hana_sql_exporter pw --tenant H00 --config ./hana_sql_exporter.toml Password: time="06-10-2022 18:17:30" level=error msg="Can't connect to tenant" error="SQL Error 10 - authentication failed" tenant=h00

If I try to escape special characters like @ or ? with a \ or trying to place it within single quotes then there is a problem parsing the contents of the contents of the config file :

./hana_sql_exporter pw --tenant H00 --config ./hana_sql_exporter.toml

Problem with configfile decoding: Near line 6 (last key parsed 'Tenants.ConnStr'): invalid escape character '?'; only the following escape characters are allowed: \b, \t, \n, \f, \r, \", \\, \uXXXX, and \UXXXXXXXX

Regards, Abhi