ThePrez / prometheus-exporter-jdbc

Prometheus Client for IBM i
GNU General Public License v3.0
23 stars 7 forks source link

Added querie does not show up in metrics #34

Open rqmartins73 opened 7 months ago

rqmartins73 commented 7 months ago

Hi there ThePrez,

I added the bit below to the config.json file, but I'm not getting these metrics on prometheus.

{
  "name": "Disk Statistics",
  "interval": 20,
  "prefix": "DASD",
  "enabled": true,
  "sql": "SELECT ASP_NUMBER,UNIT_NUMBER,UNIT_STORAGE_CAPACITY,UNIT_SPACE_AVAILABLE,UNIT_SPACE_AVAILABLE_GB,PERCENT_USED FROM TABLE (QSYS2.SYSDISKSTAT('NO'))"
},

I confirmed it is using the config.json file, because if I renamed it it asks me to create a default one.

In the log file I don't see any related errors Using config file: config.json Verifying metrics collection.... Metrics collection verified.

Am I missing something?

Thanks in advance. Regards.

harwii commented 2 months ago

Hi, I encountered the exact same problem when adding new queries.

Is there a way to resolve this issue?

Regards, Patrick

krka01 commented 2 months ago

I have in the past encountered the same issue, seems like the Prometheus exporter copies the config.json file to the home directory of the user that runs the exporter. Solution is to delete the config.json in the users home directory before starting the Prometheus exporter after a change to the configuration have been made.

rqmartins73 commented 2 months ago

I have in the past encountered the same issue, seems like the Prometheus exporter copies the config.json file to the home directory of the user that runs the exporter. Solution is to delete the config.json in the users home directory before starting the Prometheus exporter after a change to the configuration have been made.

In my case, it does not copies the config.json to my home directory. And deleting the one in the .jar folder, it asks to create a default one, if I say yes it creates the default config.json in the .jar folder...