--- metrics.pb.go.old 2022-11-08 23:31:00.000000000 +1300 +++ metrics.pb.go.new 2022-11-08 23:31:00.000000000 +1300 @@ -6,7 +6,7 @@ import ( fmt "fmt" proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" math "math" )
@@ -629,12 +629,12 @@
}
type Exemplar struct {
- Label []*LabelPair
`protobuf:"bytes,1,rep,name=label" json:"label,omitempty"`
- Value *float64
`protobuf:"fixed64,2,opt,name=value" json:"value,omitempty"`
- Timestamp *timestamp.Timestamp
`protobuf:"bytes,3,opt,name=timestamp" json:"timestamp,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
+ Label []*LabelPair
`protobuf:"bytes,1,rep,name=label" json:"label,omitempty"`
+ Value *float64
`protobuf:"fixed64,2,opt,name=value" json:"value,omitempty"`
+ Timestamp *timestamppb.Timestamp
`protobuf:"bytes,3,opt,name=timestamp" json:"timestamp,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
}
func (m *Exemplar) Reset() { *m = Exemplar{} }
@@ -676,7 +676,7 @@
return 0
}
-func (m *Exemplar) GetTimestamp() *timestamp.Timestamp {
+func (m *Exemplar) GetTimestamp() *timestamppb.Timestamp {
if m != nil {
return m.Timestamp
}
I was surprised that the protobuf _compiler_ was responsible for this
change, but verified with an older snapshot of the package (3.12.4-1+b5)
that the previous behaviour was restored. Snapshot versions 3.14.0-1 and
later produce the newer style generated pb.go file, referencing
timestamppb.Timestamp.
The upstream changelogs for the protobuf compiler do not list any Go-related changes in version 3.13.x, however for version 3.14.0 the following is mentioned:
Go:* Update go_package options to reference google.golang.org/protobuf module.
I strongly suspect that this resulted in the change in the generated pb.go file. The Makefile in prometheus/client_model also pins the protobuf compiler version to 3.13.0:
# Need to be on a previous version that doesn't cause the updated WKT go_package values to be added.
PROTOC_VERSION := 3.13.0
OpenPGP_signature
Description: OpenPGP digital signature

