Details
-
Improvement
-
Status: Open
-
Low
-
Resolution: Unresolved
-
None
-
None
-
None
-
Yes
-
Yes
-
No
Description
Hello there,
I might be wrong in here as I am no expert.
I was trying to add replay_lag metric, so I have added a custom ColumnUsage and a conversion function to output a float64.
case CUSTOMCOLUMNUSAGE: thisMap[columnName] = MetricMap{ vtype: prometheus.GaugeValue, desc: ..., conversion: func(in interface{}) (float64, bool) { // my conversion here }, }
However I was receiving this error Unexpected error parsing column: ... and I have noticed that dbToFloat64 is used no matter the type of column :
Shouldn't be instead:
value, ok := metricMapping.conversion(columnData[idx])
After I changed it my metric was converted correctly and I could query it on Grafana. Is this correct or am I missing something?
If needed I can make a pull request.
On a side note, if you are interested I can open another issue for adding replication lag to the metrics.
Thanks