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 ...@@ -75,6 +75,10 @@ var NewSqlQueryEndpoint = func(config *SqlQueryEndpointConfiguration, rowTransfo
queryEndpoint.timeColumnNames = config.TimeColumnNames queryEndpoint.timeColumnNames = config.TimeColumnNames
} }
if len(config.MetricColumnTypes) > 0 {
queryEndpoint.metricColumnTypes = config.MetricColumnTypes
}
engineCache.Lock() engineCache.Lock()
defer engineCache.Unlock() defer engineCache.Unlock()
...@@ -249,6 +253,7 @@ func (e *sqlQueryEndpoint) transformToTimeSeries(query *Query, rows *core.Rows, ...@@ -249,6 +253,7 @@ func (e *sqlQueryEndpoint) transformToTimeSeries(query *Query, rows *core.Rows,
columnType := columnTypes[i].DatabaseTypeName() columnType := columnTypes[i].DatabaseTypeName()
for _, mct := range e.metricColumnTypes { for _, mct := range e.metricColumnTypes {
e.log.Info(mct)
if columnType == mct { if columnType == mct {
metricIndex = i metricIndex = i
continue 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