Connecting to SAP ASE database with Prometheus sql_exporter

194 Views Asked by At

I am attempting to use this prometheus sql_exporter to connect to a SAP ASE database. I followed the instructions to add the Go driver for that database, rebuilt the binary, and updated the connection string to connect to the database. I have it in this format data_source_name: 'tds://SAPSR3:mypassword@myHostname:4901/DBName.

When attempting to view the metrics collected curl localhost:9399/metrics, I am seeing

ts=2023-04-17T16:47:17.947Z caller=klog.go:84 level=debug func=Infof msg="Error gathering metrics: [from Gatherer #1] context deadlineexceeded"

Like the database connection is timing out. I am able to log into the DB using the same credentials for isql.

I tried updating the data source name format by removing the DB name, changing port, changing to localhost from the regular hostname, etc.

If I change the connection string, I see the error

ts=2023-04-17T17:33:02.764Z caller=klog.go:84 level=debug func=Infof msg="Error gathering metrics: [from Gatherer #1] Msg: 4002, Level: 14, State: 1\nServer: DBName, Line: 0:\nLogin failed.\n"

So it seems to me that with the original data source name, it is making connection to the DB, otherwise the login would fail.

Is there something else I should be looking for in my ASE settings that could impact this?

1

There are 1 best solutions below

0
Jeryl Cook On

Your issue could be with the prometheus configuration (prometheus.yml). try to first simply increase the scrape _interval, and scrape_timeout in the promtheus yaml file. this could help with the "context deadlineexceeded" you are getting.