Open pirat013 opened 2 years ago
The problem occurs because the CPU column on the database returns an Int value and this column is used as Labels for the metric. The code expect strings and does not check the result set value type, raising the presented exception. The code could be adjusted to be more resilient in such scenario (like converting the resultset field into string before manipulating that), and also providing a better message in case of error.
For reference, converting the CPU field explicitly to string (varchar) on the SQL query avoids the problem:
Select host, to_varchar(CPU) CPU, data_read_time, data_read_size, data_write_time, data_write_size, log_write_time, log_write_size from M_LOAD_HISTORY_SERVICE;
Running specific, custom HANA queries and transforming them into a Prometheus metric format with a dedicated hanadb_exporter instance is reporting an error.
The query which was used is:
"Select host, CPU, data_read_time, data_read_size, data_write_time, data_write_size, log_write_time, log_write_size from M_LOAD_HISTORY_SERVICE;"
The exporter was started manually with the new profile and the custom metrics file. After triggering the exporter via curl from an external host, this message was shown:
The metric file looks like this:
The server who has triggered the command is getting this message: