floyd871 / prometheus_oracle_exporter

Prometheus Oracle Database exporter
MIT License
109 stars 77 forks source link

With new version 1.1.4 exporter multi column value #49

Closed sdpdb closed 4 years ago

sdpdb commented 4 years ago

Hi @floyd871 Thanks for release multi column support Exporter.

Issue is , which multi column value exporter not able to display proper output. Mean column1 as "name" and column2 as "value" .

For instance, exporter o/p: oracledb_query{column="value ",database="orcl",dbinstance="orcl",name="test",row="9"} 208

sql : SELECT component, current_size/1024/1024 as value FROM v$sga_dynamic_components where component='shared pool';

we are expecting exporter o/p like : oracledb_query{column="shared pool",database="orcl",dbinstance="orcl",name="test",row="9"} 208

Can you please suggest how can we achieve this ?

floyd871 commented 4 years ago

The label "Column" always shows the name of the column in the query. If you want to rename it use "AS". So in your case:

SELECT component, current_size/1024/1024 as shared_pool FROM v$sga_dynamic_components where component='shared pool';