client_golang icon indicating copy to clipboard operation
client_golang copied to clipboard

io_prometheus_client.MetricFamily does not implement protoreflect.ProtoMessage (missing method ProtoReflect)

Open puneet336 opened this issue 1 year ago • 0 comments

I am using centos 7 OS on my server and in order to setup custom exporter , i tried installing client libraries as mentioned in the client procedure here and here is the error message -

[puneet@server]~/27042023/nodeexporters/lsfnodeexporter>go get github.com/prometheus/client_golang/prometheus
# github.com/prometheus/common/expfmt
../../../go/src/github.com/prometheus/common/expfmt/decode.go:89:38: cannot use v (variable of type *io_prometheus_client.MetricFamily) as protoreflect.ProtoMessage value in argument to pbutil.ReadDelimited: *io_prometheus_client.MetricFamily does not implement protoreflect.ProtoMessage (missing method ProtoReflect)
../../../go/src/github.com/prometheus/common/expfmt/encode.go:120:40: cannot use v (variable of type *io_prometheus_client.MetricFamily) as protoreflect.ProtoMessage value in argument to pbutil.WriteDelimited: *io_prometheus_client.MetricFamily does not implement protoreflect.ProtoMessage (missing method ProtoReflect)

I am Unable to install goland client libraries and i am not sure on the fix. I am stuck here, Could you please help ?

Here's how i installed go -

[puneet@server]~/MySoftwares/GOLANG/1.20.3> wget https://go.dev/dl/go1.20.3.linux-amd64.tar.gz
[puneet@server]~/MySoftwares/GOLANG/1.20.3> tar -xf go1.20.3.linux-amd64.tar.gz
[puneet@server]~/MySoftwares/GOLANG/1.20.3>export PATH=$PWD/go/bin/:$PATH
[puneet@server]~/MySoftwares/GOLANG/1.20.3>which go
/home/puneet/MySoftwares/GOLANG/1.20.3/go/bin/go
[puneet@server]~/27042023/nodeexporters/lsfnodeexporter>go version
go version go1.20.3 linux/amd64

i am ready to use any version of go and client_golang which are compatible and works smoothly. earlier i used to use python and everything was smooth there. I was able to focus more on coding and less on setup.

meddling with go and go libraries for the first time.

puneet336 avatar Apr 30 '23 11:04 puneet336