Closed Kricket closed 1 year ago
I want to second this! Been working with the exporter for some time now, been thinking of doing a post like this. More specific logging would be helpful.
Side note: I ended up figuring out what the problem was - I was using the HTTP port 8123 instead of the TCP port 9000.
How did I figure this out (being a newcomer to Clickhouse as well...)?
I found this alternative and tried to use it. It was harder to get running, but once I did it at least gave me the message "failed to connect", which led me to eventually figure out the problem.
@Kricket @jakob-reesalu The difficulty here is that the error handling (this also includes message propagation) in the exporter depends on each underlying driver's error handling. So we need to catch all the possible scenarios and map them to specific human-readable errors, which limits flexibility of adding more drivers, since there is no single standard.
Nevertheless, I'll try to take a look at the UX improvements next year. I also plan to release a static documentation webpage to cover configuration, functionality and limitations in a better way. Thanks for reporting. 👍
@Kricket answering some of your questions:
The connection in this implementation happens the first time when you hit the endpoint and not when you start the server, so when you tried open the connection, the driver was successfully loaded and the connection string seems to be valid, so we can create a handle and try to connect to the database using the underlying driver.
Query-specific errors and timeouts are reported back and available in the logs.
If the database is unavailable for some reason or amount of time this would cause a cascade issue for connected clients. In our case, we don't want to exit, yet report that there is a connection timeout.
I agree though, that context deadline exceeded
may sound pretty misleading if you don't deal with Golang regularly or this particular code, so we definitely miss better human-readable messages here. The challenge with that I explained above, but I'll see what I can do. 😉 Still happy that you've found a solution to your problem. 👍
Is your feature request related to a problem? Please describe.
I'm currently trying to use sql_exporter to fetch data from a Clickhouse database. For now, I'm just trying to get a simple query to work. Here's my configuration:
With the collector file:
When I run it, I get the following output:
As you can see, even with debug logging, I have no idea what the problem is:
As a test, I tried changing the database connection string:
Describe the solution you'd like
At the very least, the logging should provide more information about what's going on with the database. As it is, I have no idea what the problem is, much less what I might do about it.
Describe alternatives you've considered
Using a different tool
Additional context