Getting error while trying to use env variable/variable in custom-metrics.toml

94 views Asked by At

I am trying to deploy iamseth/oracledb_exporter image .I want to run custom queries in my oracle database using this exporter and metrics to be shown on grafana. Now in the custom-metrics.toml file(it comes with the image) I have inserted my custom query(a function which is defined in oracle db and is called from here) with a custom variable as function argument.and I want to pass the var in the query

[[TABLE]]
   TABLENAME = "Product"
[[metric]]
   context = "count_of_product"
   metricsdesc = {row_count ="total row_count from product tables."}
   labels = ["row_count"]
   request = "select oraexporter_row_count("${tablename}") as row_count"
   metricstype = { row_count = "counter" }

while deployment of image I am receiving the error like

panic: Error while loading /tmp/custom-metrics.toml

level=error msg="Near line 16 (last key parsed 'metric'): expected a top-level item to end with a newline, comment, or EOF, but got '$' instead" source="main.go:525"

--the error is coming when I am trying to pass the table name variable in the function.

what is the correct way to pass the var here? even if the variable is env variable defined in the kubernetes deployment file then how to pass that env var?

0

There are 0 answers