Commit e32cf75c by Marcus Efraimsson

fix usage of metric column types so that you don't need to specify metric alias

parent 3aa47909
......@@ -75,6 +75,10 @@ var NewSqlQueryEndpoint = func(config *SqlQueryEndpointConfiguration, rowTransfo
queryEndpoint.timeColumnNames = config.TimeColumnNames
}
if len(config.MetricColumnTypes) > 0 {
queryEndpoint.metricColumnTypes = config.MetricColumnTypes
}
engineCache.Lock()
defer engineCache.Unlock()
......@@ -249,6 +253,7 @@ func (e *sqlQueryEndpoint) transformToTimeSeries(query *Query, rows *core.Rows,
columnType := columnTypes[i].DatabaseTypeName()
for _, mct := range e.metricColumnTypes {
e.log.Info(mct)
if columnType == mct {
metricIndex = i
continue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment