sql_exporter icon indicating copy to clipboard operation
sql_exporter copied to clipboard

errors in metric and target files

Open MarcoEsquivelGarcia opened this issue 4 years ago • 2 comments

Hi i clone the repo and try to build this , but i go the next errors

.\metric.go:88:28: cannot use mf.config.ValueType() (type "github.com/free/sql_exporter/vendor/github.com/prometheus/client_golang/prometheus".ValueType) as type "github.com/prometheus/client_golang/prometheus".ValueType in return argument .\metric.go:234:12: undefined: "github.com/prometheus/client_golang/prometheus".LabelPairSorter .\target.go:67:12: undefined: "github.com/prometheus/client_golang/prometheus".LabelPairSorter PS C:\Users\marco esquivel\Documents\GitHub\sql_exporter>

maybe i missing something. can you help me with?

i

MarcoEsquivelGarcia avatar Nov 13 '19 22:11 MarcoEsquivelGarcia

Have not dealt with this recently, but it may have to do with vendoring (i.e. a frozen-in-time copy of the third-party modules that SQL Exporter depends on is checked out into the vendor directory in the root of the SQL Exporter repository).

This may help: https://github.com/golang/go/wiki/Modules#how-do-i-use-vendoring-with-modules-is-vendoring-going-away

It seems to say that you should add -mod=vendor to your command line in order for the vendored dependencies to be used.

free avatar Nov 14 '19 09:11 free

Maybe an idea to add this to the readme somewhere? :) Im trying to build the artifacts and ran into the same thing.

a-nldisr avatar Dec 04 '19 16:12 a-nldisr