From ac08ea0a9e215f3bfde9dcfcbd92e74d7ad6bef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannig=20Perr=C3=A9?= Date: Sat, 16 May 2020 10:26:30 +0200 Subject: [PATCH] FAQ: unable to convert current value to float. --- README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d0459ae1..86984726 100644 --- a/README.md +++ b/README.md @@ -233,7 +233,25 @@ Then run build: make linux -# Troubleshooting +# FAQ/Troubleshooting + +## Unable to convert current value to float (metric=par,metri...in.go:285 + +Oracle is trying to send a value that we cannot convert to float. This could be anything like 'UNLIMITED' or 'UNDEFINED' or 'WHATEVER'. + +In this case, you must handle this problem by testing it in the SQL request. Here an example available in default metrics: + +```toml +[[metric]] +context = "resource" +labels = [ "resource_name" ] +metricsdesc = { current_utilization= "Generic counter metric from v$resource_limit view in Oracle (current value).", limit_value="Generic counter metric from v$resource_limit view in Oracle (UNLIMITED: -1)." } +request="SELECT resource_name,current_utilization,CASE WHEN TRIM(limit_value) LIKE 'UNLIMITED' THEN '-1' ELSE TRIM(limit_value) END as limit_value FROM v$resource_limit" +``` + +If the value of limite_value is 'UNLIMITED', the request send back the value -1. + +You can increase the log level (`-log.level debug`) in order to get the statement generating this error. ## error while loading shared libraries: libclntsh.so.xx.x: cannot open shared object file: No such file or directory