common icon indicating copy to clipboard operation
common copied to clipboard

dto.MetricFamily is based on deprecated proto github.com/golang/protobuf/proto

Open ytsssun opened this issue 3 years ago • 6 comments

Migrate to a new dto.MetricFamily based on new google.golang.org/protobuf/proto

ytsssun avatar May 19 '22 23:05 ytsssun

I have a vague memory that I tried that already, and it turned out to be a breaking change.

Happy to stand corrected.

beorn7 avatar May 25 '22 17:05 beorn7

FYI: I believe this is related to the error I'm getting today after running "go get -u"

../../../go/pkg/mod/github.com/prometheus/[email protected]/expfmt/decode.go:89:38: cannot use v (variable of type *io_prometheus_client.MetricFamily) as type protoreflect.ProtoMessage in argument to pbutil.ReadDelimited: *io_prometheus_client.MetricFamily does not implement protoreflect.ProtoMessage (missing ProtoReflect method)

This appears related to this commit: https://github.com/matttproud/golang_protobuf_extensions/commit/d8e45f28e59a34ac89667fb05d8585297f784b85

golang_protobuf_extensions been updated to google.golang.org/protobuf/proto. promethus/common depends on golang_protobuf_extensions.

A workaround is to use v1.0.2 in my mod file.

github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect

timc4662 avatar Oct 25 '22 09:10 timc4662

Same issue as @timc4662 today...

xor22h avatar Oct 25 '22 09:10 xor22h

Me too @timc4662, thank you 😄 But I think the library shold be updated asap.

rafi0101 avatar Oct 25 '22 09:10 rafi0101

thanks ,solve my problem

HobbyBear avatar Dec 02 '22 07:12 HobbyBear

The github.com/matttproud/golang_protobuf_extensions library is already implemented in the official library, and this issue will be resolved after deprecation.

edoger avatar Jun 05 '23 02:06 edoger