diff --git a/.bingo/README.md b/.bingo/README.md index 7e7673362d0..7a5c2d4f6da 100755 --- a/.bingo/README.md +++ b/.bingo/README.md @@ -6,6 +6,7 @@ This is directory which stores Go modules with pinned buildable package that is * Run `bingo get ` to install that have own module file in this directory. * For Makefile: Make sure to put `include .bingo/Variables.mk` in your Makefile, then use $() variable where is the .bingo/.mod. * For shell: Run `source .bingo/variables.env` to source all environment variable for each tool. +* For go: Import `.bingo/variables.go` to for variable names. * See https://github.com/bwplotka/bingo or -h on how to add, remove or change binaries dependencies. ## Requirements diff --git a/.bingo/Variables.mk b/.bingo/Variables.mk index 6227d0c6bf4..5b5b4ea31f7 100644 --- a/.bingo/Variables.mk +++ b/.bingo/Variables.mk @@ -131,12 +131,36 @@ $(PROMU): $(BINGO_DIR)/promu.mod @echo "(re)installing $(GOBIN)/promu-v0.5.0" @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=promu.mod -o=$(GOBIN)/promu-v0.5.0 "github.com/prometheus/promu" +PROTOC_GEN_GO_GRPC := $(GOBIN)/protoc-gen-go-grpc-v1.5.1 +$(PROTOC_GEN_GO_GRPC): $(BINGO_DIR)/protoc-gen-go-grpc.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/protoc-gen-go-grpc-v1.5.1" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=protoc-gen-go-grpc.mod -o=$(GOBIN)/protoc-gen-go-grpc-v1.5.1 "google.golang.org/grpc/cmd/protoc-gen-go-grpc" + +PROTOC_GEN_GO_VTPROTO := $(GOBIN)/protoc-gen-go-vtproto-v0.6.1-0.20250313105119-ba97887b0a25 +$(PROTOC_GEN_GO_VTPROTO): $(BINGO_DIR)/protoc-gen-go-vtproto.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/protoc-gen-go-vtproto-v0.6.1-0.20250313105119-ba97887b0a25" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=protoc-gen-go-vtproto.mod -o=$(GOBIN)/protoc-gen-go-vtproto-v0.6.1-0.20250313105119-ba97887b0a25 "github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto" + +PROTOC_GEN_GO := $(GOBIN)/protoc-gen-go-v1.35.1 +$(PROTOC_GEN_GO): $(BINGO_DIR)/protoc-gen-go.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/protoc-gen-go-v1.35.1" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=protoc-gen-go.mod -o=$(GOBIN)/protoc-gen-go-v1.35.1 "google.golang.org/protobuf/cmd/protoc-gen-go" + PROTOC_GEN_GOGOFAST := $(GOBIN)/protoc-gen-gogofast-v1.3.2 $(PROTOC_GEN_GOGOFAST): $(BINGO_DIR)/protoc-gen-gogofast.mod @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. @echo "(re)installing $(GOBIN)/protoc-gen-gogofast-v1.3.2" @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=protoc-gen-gogofast.mod -o=$(GOBIN)/protoc-gen-gogofast-v1.3.2 "github.com/gogo/protobuf/protoc-gen-gogofast" +PROTOC_GEN_GOTAG := $(GOBIN)/protoc-gen-gotag-v1.0.2 +$(PROTOC_GEN_GOTAG): $(BINGO_DIR)/protoc-gen-gotag.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/protoc-gen-gotag-v1.0.2" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=protoc-gen-gotag.mod -o=$(GOBIN)/protoc-gen-gotag-v1.0.2 "github.com/srikrsna/protoc-gen-gotag" + SHFMT := $(GOBIN)/shfmt-v3.8.0 $(SHFMT): $(BINGO_DIR)/shfmt.mod @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. diff --git a/.bingo/protoc-gen-go-grpc.mod b/.bingo/protoc-gen-go-grpc.mod new file mode 100644 index 00000000000..1c21c980fab --- /dev/null +++ b/.bingo/protoc-gen-go-grpc.mod @@ -0,0 +1,5 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.23 + +require google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 diff --git a/.bingo/protoc-gen-go-grpc.sum b/.bingo/protoc-gen-go-grpc.sum new file mode 100644 index 00000000000..3718c72a21c --- /dev/null +++ b/.bingo/protoc-gen-go-grpc.sum @@ -0,0 +1,8 @@ +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 h1:F29+wU6Ee6qgu9TddPgooOdaqsxTMunOoj8KA5yuS5A= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1/go.mod h1:5KF+wpkbTSbGcR9zteSqZV6fqFOWBl4Yde8En8MryZA= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.1 h1:/WILD1UcXj/ujCxgoL/DvRgt2CP3txG8+FwkUbb9110= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.1/go.mod h1:YNKnb2OAApgYn2oYY47Rn7alMr1zWjb2U8Q0aoGWiNc= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/.bingo/protoc-gen-go-vtproto.mod b/.bingo/protoc-gen-go-vtproto.mod new file mode 100644 index 00000000000..1f56482333f --- /dev/null +++ b/.bingo/protoc-gen-go-vtproto.mod @@ -0,0 +1,5 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.23 + +require github.com/planetscale/vtprotobuf v0.6.1-0.20250313105119-ba97887b0a25 // cmd/protoc-gen-go-vtproto diff --git a/.bingo/protoc-gen-go-vtproto.sum b/.bingo/protoc-gen-go-vtproto.sum new file mode 100644 index 00000000000..15287c2ae2c --- /dev/null +++ b/.bingo/protoc-gen-go-vtproto.sum @@ -0,0 +1,6 @@ +github.com/planetscale/vtprotobuf v0.6.0 h1:nBeETjudeJ5ZgBHUz1fVHvbqUKnYOXNhsIEabROxmNA= +github.com/planetscale/vtprotobuf v0.6.0/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= +github.com/planetscale/vtprotobuf v0.6.1-0.20250313105119-ba97887b0a25 h1:S1hI5JiKP7883xBzZAr1ydcxrKNSVNm7+3+JwjxZEsg= +github.com/planetscale/vtprotobuf v0.6.1-0.20250313105119-ba97887b0a25/go.mod h1:ZQntvDG8TkPgljxtA0R9frDoND4QORU1VXz015N5Ks4= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/.bingo/protoc-gen-go.mod b/.bingo/protoc-gen-go.mod new file mode 100644 index 00000000000..0c0d89b4ab3 --- /dev/null +++ b/.bingo/protoc-gen-go.mod @@ -0,0 +1,5 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.23 + +require google.golang.org/protobuf v1.35.1 // cmd/protoc-gen-go diff --git a/.bingo/protoc-gen-go.sum b/.bingo/protoc-gen-go.sum new file mode 100644 index 00000000000..858bec83651 --- /dev/null +++ b/.bingo/protoc-gen-go.sum @@ -0,0 +1,4 @@ +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/.bingo/protoc-gen-gotag.mod b/.bingo/protoc-gen-gotag.mod new file mode 100644 index 00000000000..c6f6e62c88e --- /dev/null +++ b/.bingo/protoc-gen-gotag.mod @@ -0,0 +1,7 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.23 + +retract v0.6.0 + +require github.com/srikrsna/protoc-gen-gotag v1.0.2 diff --git a/.bingo/protoc-gen-gotag.sum b/.bingo/protoc-gen-gotag.sum new file mode 100644 index 00000000000..13f0bf4d1b2 --- /dev/null +++ b/.bingo/protoc-gen-gotag.sum @@ -0,0 +1,71 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= +github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/lyft/protoc-gen-star/v2 v2.0.3 h1:/3+/2sWyXeMLzKd1bX+ixWKgEMsULrIivpDsuaF441o= +github.com/lyft/protoc-gen-star/v2 v2.0.3/go.mod h1:amey7yeodaJhXSbf/TlLvWiqQfLOSpEk//mLlc+axEk= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.5.1 h1:VHu76Lk0LSP1x254maIu2bplkWpfBWI+B+6fdoZprcg= +github.com/spf13/afero v1.5.1/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/srikrsna/protoc-gen-gotag v1.0.2 h1:4okv8GlbVbvmL678VX0AobxaMkERlBbHvgWhUnbcrPM= +github.com/srikrsna/protoc-gen-gotag v1.0.2/go.mod h1:HiXK5kcp/ZRnNPahuJm3tzfGDoD8xzvLNdg5/PYKq7Q= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/.bingo/variables.env b/.bingo/variables.env index c8cead57d24..50367474af8 100644 --- a/.bingo/variables.env +++ b/.bingo/variables.env @@ -46,7 +46,15 @@ PROMTOOL="${GOBIN}/promtool-v0.47.0" PROMU="${GOBIN}/promu-v0.5.0" +PROTOC_GEN_GO_GRPC="${GOBIN}/protoc-gen-go-grpc-v1.5.1" + +PROTOC_GEN_GO_VTPROTO="${GOBIN}/protoc-gen-go-vtproto-v0.6.1-0.20250313105119-ba97887b0a25" + +PROTOC_GEN_GO="${GOBIN}/protoc-gen-go-v1.35.1" + PROTOC_GEN_GOGOFAST="${GOBIN}/protoc-gen-gogofast-v1.3.2" +PROTOC_GEN_GOTAG="${GOBIN}/protoc-gen-gotag-v1.0.2" + SHFMT="${GOBIN}/shfmt-v3.8.0" diff --git a/.gitignore b/.gitignore index 139d9936c52..61c35b404b1 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ benchmarks/ /.idea /*.iml +.vscode/ website/public/ website/docs-pre-processed/ diff --git a/Makefile b/Makefile index fd3f4acc619..405de3052d6 100644 --- a/Makefile +++ b/Makefile @@ -292,8 +292,14 @@ go-format: $(GOIMPORTS) .PHONY: proto proto: ## Generates Go files from Thanos proto files. -proto: check-git $(GOIMPORTS) $(PROTOC) $(PROTOC_GEN_GOGOFAST) - @GOIMPORTS_BIN="$(GOIMPORTS)" PROTOC_BIN="$(PROTOC)" PROTOC_GEN_GOGOFAST_BIN="$(PROTOC_GEN_GOGOFAST)" PROTOC_VERSION="$(PROTOC_VERSION)" scripts/genproto.sh +proto: check-git $(GOIMPORTS) $(PROTOC) $(PROTOC_GEN_GOGOFAST) $(PROTOC_GEN_GO) $(PROTOC_GEN_GO_GRPC) $(PROTOC_GEN_GO_VTPROTO) $(PROTOC_GEN_GOTAG) + @GOIMPORTS_BIN="$(GOIMPORTS)" PROTOC_BIN="$(PROTOC)" \ + PROTOC_GEN_GOGOFAST_BIN="$(PROTOC_GEN_GOGOFAST)" \ + PROTOC_GEN_GO_BIN="$(PROTOC_GEN_GO)" \ + PROTOC_GEN_GO_GRPC_BIN="$(PROTOC_GEN_GO_GRPC)" \ + PROTOC_GEN_GO_VTPROTO_BIN="$(PROTOC_GEN_GO_VTPROTO)" \ + PROTOC_GEN_GOTAG_BIN="$(PROTOC_GEN_GOTAG)" \ + PROTOC_VERSION="$(PROTOC_VERSION)" scripts/genproto.sh .PHONY: capnp capnp: ## Generates Go files from Thanos capnproto files. diff --git a/cmd/thanos/config.go b/cmd/thanos/config.go index f72d19fd79f..576f6d294a2 100644 --- a/cmd/thanos/config.go +++ b/cmd/thanos/config.go @@ -8,6 +8,7 @@ package main import ( "net/url" + "sort" "strconv" "strings" "time" @@ -17,7 +18,7 @@ import ( "github.com/pkg/errors" "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/model/labels" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/extkingpin" "github.com/thanos-io/thanos/pkg/shipper" @@ -268,24 +269,24 @@ func (ac *alertMgrConfig) registerFlag(cmd extflag.FlagClause) *alertMgrConfig { return ac } -func parseFlagLabels(s []string) (labels.Labels, error) { - var lset labels.ScratchBuilder +func parseFlagLabels(s []string) (labelpb.Labels, error) { + lset := labelpb.Labels{} for _, l := range s { parts := strings.SplitN(l, "=", 2) if len(parts) != 2 { - return labels.EmptyLabels(), errors.Errorf("unrecognized label %q", l) + return nil, errors.Errorf("unrecognized label %q", l) } if !model.LabelName.IsValid(model.LabelName(parts[0])) { - return labels.EmptyLabels(), errors.Errorf("unsupported format for label %s", l) + return nil, errors.Errorf("unsupported format for label %s", l) } val, err := strconv.Unquote(parts[1]) if err != nil { - return labels.EmptyLabels(), errors.Wrap(err, "unquote label value") + return nil, errors.Wrap(err, "unquote label value") } - lset.Add(parts[0], val) + lset = append(lset, &labelpb.Label{Name: parts[0], Value: val}) } - lset.Sort() - return lset.Labels(), nil + sort.Sort(lset) + return lset, nil } type goMemLimitConfig struct { diff --git a/cmd/thanos/main.go b/cmd/thanos/main.go index 713ee4ca500..f5d1f743347 100644 --- a/cmd/thanos/main.go +++ b/cmd/thanos/main.go @@ -30,6 +30,7 @@ import ( "github.com/thanos-io/thanos/pkg/extkingpin" "github.com/thanos-io/thanos/pkg/logging" "github.com/thanos-io/thanos/pkg/tracing/client" + _ "github.com/thanos-io/thanos/pkg/vtproto" ) func main() { diff --git a/cmd/thanos/query.go b/cmd/thanos/query.go index f82ed44963b..2ed8bbf95d2 100644 --- a/cmd/thanos/query.go +++ b/cmd/thanos/query.go @@ -26,7 +26,6 @@ import ( "github.com/prometheus/prometheus/discovery" "github.com/prometheus/prometheus/discovery/file" "github.com/prometheus/prometheus/discovery/targetgroup" - "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/promql" "github.com/thanos-io/promql-engine/api" @@ -456,7 +455,7 @@ func runQuery( queryReplicaLabels []string, queryPartitionLabels []string, queryDeduplicationFunc string, - selectorLset labels.Labels, + selectorLset labelpb.Labels, flagsMap map[string]string, endpointAddrs []string, endpointGroupAddrs []string, @@ -884,7 +883,7 @@ func runQuery( infoSrv := info.NewInfoServer( component.Query.String(), - info.WithLabelSetFunc(func() []labelpb.ZLabelSet { return proxyStore.LabelSet() }), + info.WithLabelSetFunc(func() []*labelpb.LabelSet { return proxyStore.LabelSet() }), info.WithStoreInfoFunc(func() (*infopb.StoreInfo, error) { if httpProbe.IsReady() { mint, maxt := proxyStore.TimeRange() diff --git a/cmd/thanos/receive.go b/cmd/thanos/receive.go index 714612bba10..4b16b0e98dd 100644 --- a/cmd/thanos/receive.go +++ b/cmd/thanos/receive.go @@ -134,7 +134,7 @@ func runReceive( grpcLogOpts []grpc_logging.Option, logFilterMethods []string, tsdbOpts *tsdb.Options, - lset labels.Labels, + lset labelpb.Labels, comp component.SourceStoreAPI, hashFunc metadata.HashFunc, receiveMode receive.ReceiverMode, @@ -275,7 +275,7 @@ func runReceive( writer := receive.NewWriter(log.With(logger, "component", "receive-writer"), dbs, &receive.WriterOptions{ Intern: conf.writerInterning, TooFarInFutureTimeWindow: int64(time.Duration(*conf.tsdbTooFarInFutureTimeWindow)), - }) + }, reg) var limitsConfig *receive.RootLimitsConfig if conf.writeLimitsConfig != nil { @@ -461,7 +461,7 @@ func runReceive( reg, dbs.TSDBLocalClients, comp, - labels.Labels{}, + labelpb.EmptyLabels(), 0, store.LazyRetrieval, options..., @@ -475,7 +475,7 @@ func runReceive( infoSrv := info.NewInfoServer( component.Receive.String(), - info.WithLabelSetFunc(func() []labelpb.ZLabelSet { return proxy.LabelSet() }), + info.WithLabelSetFunc(func() []*labelpb.LabelSet { return proxy.LabelSet() }), info.WithStoreInfoFunc(func() (*infopb.StoreInfo, error) { if httpProbe.IsReady() { minTime, maxTime := proxy.TimeRange() @@ -1096,10 +1096,10 @@ func (rc *receiveConfig) registerFlag(cmd extkingpin.FlagClause) { cmd.Flag("receive.hashrings", "Alternative to 'receive.hashrings-file' flag (lower priority). Content of file that contains the hashring configuration.").PlaceHolder("").StringVar(&rc.hashringsFileContent) - hashringAlgorithmsHelptext := strings.Join([]string{string(receive.AlgorithmHashmod), string(receive.AlgorithmKetama)}, ", ") + hashringAlgorithmsHelptext := strings.Join([]string{string(receive.AlgorithmHashmod), string(receive.AlgorithmKetama), string(receive.AlgorithmRendezvous)}, ", ") cmd.Flag("receive.hashrings-algorithm", "The algorithm used when distributing series in the hashrings. Must be one of "+hashringAlgorithmsHelptext+". Will be overwritten by the tenant-specific algorithm in the hashring config."). Default(string(receive.AlgorithmHashmod)). - EnumVar(&rc.hashringsAlgorithm, string(receive.AlgorithmHashmod), string(receive.AlgorithmKetama), string(receive.AlgorithmAlignedKetama)) + EnumVar(&rc.hashringsAlgorithm, string(receive.AlgorithmHashmod), string(receive.AlgorithmKetama), string(receive.AlgorithmRendezvous)) rc.refreshInterval = extkingpin.ModelDuration(cmd.Flag("receive.hashrings-file-refresh-interval", "Refresh interval to re-read the hashring configuration file. (used as a fallback)"). Default("5m")) diff --git a/cmd/thanos/rule.go b/cmd/thanos/rule.go index 41d996e0200..91dc351b7b7 100644 --- a/cmd/thanos/rule.go +++ b/cmd/thanos/rule.go @@ -29,7 +29,7 @@ import ( "github.com/prometheus/common/model" "github.com/prometheus/common/route" "github.com/prometheus/prometheus/config" - "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/relabel" "github.com/prometheus/prometheus/notifier" "github.com/prometheus/prometheus/promql" @@ -105,7 +105,7 @@ type ruleConfig struct { ruleFiles []string objStoreConfig *extflag.PathOrContent dataDir string - lset labels.Labels + lset labelpb.Labels ignoredLabelNames []string storeRateLimits store.SeriesSelectLimits ruleConcurrentEval int64 @@ -490,7 +490,7 @@ func runRule( }, conf.dataDir, 1*time.Minute, nil, false) if err := remoteStore.ApplyConfig(&config.Config{ GlobalConfig: config.GlobalConfig{ - ExternalLabels: labelsTSDBToProm(conf.lset), + ExternalLabels: labelpb.ToPromLabels(conf.lset), }, RemoteWriteConfigs: rwCfg.RemoteWriteConfigs, }); err != nil { @@ -590,7 +590,7 @@ func runRule( var ( ruleMgr *thanosrules.Manager - alertQ = alert.NewQueue(logger, reg, 10000, 100, labelsTSDBToProm(conf.lset), conf.alertmgr.alertExcludeLabels, alertRelabelConfigs) + alertQ = alert.NewQueue(logger, reg, 10000, 100, conf.lset, conf.alertmgr.alertExcludeLabels, alertRelabelConfigs) ) { if conf.extendedFunctionsEnabled { @@ -748,7 +748,7 @@ func runRule( tsdbStore := store.NewTSDBStore(logger, tsdbDB, component.Rule, conf.lset) infoOptions = append( infoOptions, - info.WithLabelSetFunc(func() []labelpb.ZLabelSet { + info.WithLabelSetFunc(func() []*labelpb.LabelSet { return tsdbStore.LabelSet() }), info.WithStoreInfoFunc(func() (*infopb.StoreInfo, error) { @@ -856,7 +856,7 @@ func runRule( } }() - s := shipper.New(logger, reg, conf.dataDir, bkt, func() labels.Labels { return conf.lset }, metadata.RulerSource, nil, conf.shipper.allowOutOfOrderUpload, metadata.HashFunc(conf.shipper.hashFunc), conf.shipper.metaFileName) + s := shipper.New(logger, reg, conf.dataDir, bkt, func() labelpb.Labels { return conf.lset }, metadata.RulerSource, nil, conf.shipper.allowOutOfOrderUpload, metadata.HashFunc(conf.shipper.hashFunc), conf.shipper.metaFileName) ctx, cancel := context.WithCancel(context.Background()) @@ -895,10 +895,6 @@ func removeLockfileIfAny(logger log.Logger, dataDir string) error { return nil } -func labelsTSDBToProm(lset labels.Labels) (res labels.Labels) { - return lset.Copy() -} - func queryFuncCreator( logger log.Logger, queriers []*clientconfig.HTTPClient, diff --git a/cmd/thanos/sidecar.go b/cmd/thanos/sidecar.go index 127584ea947..358ffaef759 100644 --- a/cmd/thanos/sidecar.go +++ b/cmd/thanos/sidecar.go @@ -22,7 +22,6 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/model/labels" "github.com/thanos-io/objstore" "github.com/thanos-io/objstore/client" @@ -261,7 +260,7 @@ func runSidecar( return errors.Wrap(err, "initial external labels query") } - if m.Labels().Len() == 0 { + if len(m.Labels()) == 0 { return errors.New("no external labels configured on Prometheus server, uniquely identifying external labels must be configured; see https://thanos.io/tip/thanos/storage.md#external-labels for details.") } promUp.Set(1) @@ -325,7 +324,7 @@ func runSidecar( infoSrv := info.NewInfoServer( component.Sidecar.String(), - info.WithLabelSetFunc(func() []labelpb.ZLabelSet { + info.WithLabelSetFunc(func() []*labelpb.LabelSet { return promStore.LabelSet() }), info.WithStoreInfoFunc(func() (*infopb.StoreInfo, error) { @@ -406,7 +405,7 @@ func runSidecar( defer cancel() if err := runutil.Retry(2*time.Second, extLabelsCtx.Done(), func() error { - if m.Labels().Len() == 0 { + if len(m.Labels()) == 0 { return errors.New("not uploading as no external labels are configured yet - is Prometheus healthy/reachable?") } return nil @@ -476,7 +475,7 @@ type promMetadata struct { mtx sync.Mutex mint int64 maxt int64 - labels labels.Labels + labels labelpb.Labels promVersion string limitMinTime thanosmodel.TimeOrDurationValue @@ -511,7 +510,7 @@ func (s *promMetadata) UpdateTimestamps(ctx context.Context) error { return nil } -func (s *promMetadata) Labels() labels.Labels { +func (s *promMetadata) Labels() labelpb.Labels { s.mtx.Lock() defer s.mtx.Unlock() diff --git a/cmd/thanos/store.go b/cmd/thanos/store.go index 886bea73771..92933c67c54 100644 --- a/cmd/thanos/store.go +++ b/cmd/thanos/store.go @@ -514,7 +514,7 @@ func runStore( infoSrv := info.NewInfoServer( component.Store.String(), - info.WithLabelSetFunc(func() []labelpb.ZLabelSet { + info.WithLabelSetFunc(func() []*labelpb.LabelSet { return bs.LabelSet() }), info.WithStoreInfoFunc(func() (*infopb.StoreInfo, error) { diff --git a/cmd/thanos/streamer.go b/cmd/thanos/streamer.go index e1d04e7f866..7d71c08f208 100644 --- a/cmd/thanos/streamer.go +++ b/cmd/thanos/streamer.go @@ -123,7 +123,7 @@ func NewStreamer( }, nil } -type aggrChunkByTimestamp []storepb.AggrChunk +type aggrChunkByTimestamp []*storepb.AggrChunk func (c aggrChunkByTimestamp) Len() int { return len(c) } func (c aggrChunkByTimestamp) Swap(i, j int) { c[i], c[j] = c[j], c[i] } @@ -136,7 +136,7 @@ func (c aggrChunkByTimestamp) Less(i, j int) bool { func convertToSeriesReq(config *StreamerConfig, streamerReq *streamer.StreamerRequest) *storepb.SeriesRequest { req := &storepb.SeriesRequest{ Aggregates: []storepb.Aggr{storepb.Aggr_RAW}, - Matchers: make([]storepb.LabelMatcher, 0), + Matchers: make([]*storepb.LabelMatcher, 0), MinTime: streamerReq.StartTimestampMs, MaxTime: streamerReq.EndTimestampMs, SkipChunks: streamerReq.SkipChunks, @@ -145,14 +145,14 @@ func convertToSeriesReq(config *StreamerConfig, streamerReq *streamer.StreamerRe req.WithoutReplicaLabels = []string{config.replicaLabel} } for _, labelMatcher := range streamerReq.LabelMatchers { - req.Matchers = append(req.Matchers, storepb.LabelMatcher{ + req.Matchers = append(req.Matchers, &storepb.LabelMatcher{ Type: storepb.LabelMatcher_Type(labelMatcher.Type), Name: labelMatcher.Name, Value: labelMatcher.Value, }) } if streamerReq.Metric != "" { - req.Matchers = append(req.Matchers, storepb.LabelMatcher{ + req.Matchers = append(req.Matchers, &storepb.LabelMatcher{ Type: storepb.LabelMatcher_EQ, Name: labels.MetricName, Value: streamerReq.Metric, diff --git a/cmd/thanos/streamer_test.go b/cmd/thanos/streamer_test.go index cc26c177173..237ed38e9cb 100644 --- a/cmd/thanos/streamer_test.go +++ b/cmd/thanos/streamer_test.go @@ -37,7 +37,7 @@ func TestConvertToSeriesReq(t *testing.T) { expectedReq := &storepb.SeriesRequest{ Aggregates: []storepb.Aggr{storepb.Aggr_RAW}, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Name: "instance", Value: "localhost:9090", Type: storepb.LabelMatcher_EQ}, {Name: "__name__", Value: "cpu_usage", Type: storepb.LabelMatcher_EQ}, }, diff --git a/cmd/thanos/tools_bucket.go b/cmd/thanos/tools_bucket.go index 1f2ec22f262..cdfdd8a9622 100644 --- a/cmd/thanos/tools_bucket.go +++ b/cmd/thanos/tools_bucket.go @@ -31,10 +31,10 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" prommodel "github.com/prometheus/common/model" "github.com/prometheus/common/route" - "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/model/relabel" "github.com/prometheus/prometheus/tsdb" "github.com/prometheus/prometheus/tsdb/chunkenc" + "github.com/thanos-io/thanos/pkg/store/labelpb" "golang.org/x/text/language" "golang.org/x/text/message" "gopkg.in/yaml.v3" @@ -1006,7 +1006,7 @@ func printTSV(w io.Writer, t Table) error { return nil } -func printBlockData(blockMetas []*metadata.Meta, selectorLabels labels.Labels, sortBy []string, printer tablePrinter) error { +func printBlockData(blockMetas []*metadata.Meta, selectorLabels labelpb.Labels, sortBy []string, printer tablePrinter) error { header := inspectColumns var lines [][]string @@ -1076,9 +1076,9 @@ func getKeysAlphabetically(labels map[string]string) []string { // matchesSelector checks if blockMeta contains every label from // the selector with the correct value. -func matchesSelector(blockMeta *metadata.Meta, selectorLabels labels.Labels) bool { +func matchesSelector(blockMeta *metadata.Meta, selectorLabels labelpb.Labels) bool { matches := true - selectorLabels.Range(func(l labels.Label) { + selectorLabels.Range(func(l *labelpb.Label) { val, ok := blockMeta.Thanos.Labels[l.Name] matches = matches && ok && val == l.Value }) @@ -1604,7 +1604,7 @@ func registerBucketUploadBlocks(app extkingpin.AppClause, objStoreConfig *extfla bkt = objstoretracing.WrapWithTraces(objstore.WrapWithMetrics(bkt, extprom.WrapRegistererWithPrefix("thanos_", reg), bkt.Name())) - s := shipper.New(logger, reg, tbc.path, bkt, func() labels.Labels { return lset }, metadata.BucketUploadSource, + s := shipper.New(logger, reg, tbc.path, bkt, func() labelpb.Labels { return lset }, metadata.BucketUploadSource, nil, false, metadata.HashFunc(""), shipper.DefaultMetaFilename) ctx, cancel := context.WithCancel(context.Background()) diff --git a/cmd/thanos/tools_metric.go b/cmd/thanos/tools_metric.go index dc70593ad28..9e66bf0e2aa 100644 --- a/cmd/thanos/tools_metric.go +++ b/cmd/thanos/tools_metric.go @@ -64,7 +64,7 @@ func registerStreamMetric(app extkingpin.AppClause) { func streamMetric(conf *rawMetricConfig, logger log.Logger) error { nowMs := time.Now().Unix() * 1000 startMs := nowMs - int64(conf.hoursAgo)*3600*1000 - conn, err := grpc.Dial( + conn, err := grpc.NewClient( conf.storeAddr, grpc.WithTransportCredentials(insecure.NewCredentials()), ) @@ -73,7 +73,7 @@ func streamMetric(conf *rawMetricConfig, logger log.Logger) error { return err } storeClient := storepb.NewStoreClient(conn) - labelMatchers := []storepb.LabelMatcher{ + labelMatchers := []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "__name__", Value: conf.metric}, } addMatcher := func(mtype storepb.LabelMatcher_Type, matcher string) { @@ -82,7 +82,7 @@ func streamMetric(conf *rawMetricConfig, logger log.Logger) error { level.Error(logger).Log("msg", "ignoring an invalid label matcher", "matcher", matcher) return } - labelMatchers = append(labelMatchers, storepb.LabelMatcher{ + labelMatchers = append(labelMatchers, &storepb.LabelMatcher{ Type: mtype, Name: parts[0], Value: parts[1], diff --git a/go.mod b/go.mod index e65755728f4..ab1f94519c7 100644 --- a/go.mod +++ b/go.mod @@ -122,10 +122,12 @@ require ( github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/mitchellh/go-ps v1.0.0 github.com/onsi/gomega v1.34.0 + github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 github.com/prometheus-community/prom-label-proxy v0.8.1-0.20240127162815-c1195f9aabc0 + github.com/puzpuzpuz/xsync/v3 v3.5.1 github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771 + github.com/srikrsna/protoc-gen-gotag v1.0.2 go.opentelemetry.io/contrib/propagators/autoprop v0.54.0 - go4.org/intern v0.0.0-20230525184215-6c62f75575cb golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) @@ -163,7 +165,6 @@ require ( go.opentelemetry.io/collector/semconv v0.108.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect go.opentelemetry.io/contrib/propagators/ot v1.29.0 // indirect - go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2 // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect @@ -300,9 +301,6 @@ replace ( github.com/vimeo/galaxycache => github.com/thanos-community/galaxycache v0.0.0-20211122094458-3a32041a1f1e - // Pinning grpc due https://github.com/grpc/grpc-go/issues/7314 - google.golang.org/grpc => google.golang.org/grpc v1.63.2 - // Overriding to use latest commit. gopkg.in/alecthomas/kingpin.v2 => github.com/alecthomas/kingpin v1.3.8-0.20210301060133-17f40c25f497 ) diff --git a/go.sum b/go.sum index 70c875ec93b..8dff76e8199 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,6 @@ capnproto.org/go/capnp/v3 v3.0.0-alpha.29 h1:Kp8kq5GVl1ANe0mxv+cl1ISEPAv45phpdMIPpB8cgN8= capnproto.org/go/capnp/v3 v3.0.0-alpha.29/go.mod h1:+ysMHvOh1EWNOyorxJWs1omhRFiDoKxKkWQACp54jKM= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= @@ -37,153 +38,54 @@ cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRY cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= -cloud.google.com/go v0.110.2/go.mod h1:k04UEeEtb6ZBRTv3dZz4CeJC3jKGxyhl0sAiVVquxiw= -cloud.google.com/go v0.110.4/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= -cloud.google.com/go v0.110.6/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= -cloud.google.com/go v0.110.7/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= -cloud.google.com/go v0.110.8/go.mod h1:Iz8AkXJf1qmxC3Oxoep8R1T36w8B92yU29PcBhHO5fk= -cloud.google.com/go v0.110.9/go.mod h1:rpxevX/0Lqvlbc88b7Sc1SPNdyK1riNBTUU6JXhYNpM= -cloud.google.com/go v0.110.10/go.mod h1:v1OoFqYxiBkUrruItNM3eT4lLByNjxmJSV/xDKJNnic= -cloud.google.com/go v0.111.0/go.mod h1:0mibmpKP1TyOOFYQY5izo0LnT+ecvOQ0Sg3OdmMiNRU= -cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= cloud.google.com/go v0.115.1 h1:Jo0SM9cQnSkYfp44+v+NQXHpcHqlnRJk2qxh6yvxxxQ= cloud.google.com/go v0.115.1/go.mod h1:DuujITeaufu3gL68/lOFIirVNJwQeyf5UXyi+Wbgknc= cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= cloud.google.com/go/accessapproval v1.6.0/go.mod h1:R0EiYnwV5fsRFiKZkPHr6mwyk2wxUJ30nL4j2pcFY2E= -cloud.google.com/go/accessapproval v1.7.1/go.mod h1:JYczztsHRMK7NTXb6Xw+dwbs/WnOJxbo/2mTI+Kgg68= -cloud.google.com/go/accessapproval v1.7.2/go.mod h1:/gShiq9/kK/h8T/eEn1BTzalDvk0mZxJlhfw0p+Xuc0= -cloud.google.com/go/accessapproval v1.7.3/go.mod h1:4l8+pwIxGTNqSf4T3ds8nLO94NQf0W/KnMNuQ9PbnP8= -cloud.google.com/go/accessapproval v1.7.4/go.mod h1:/aTEh45LzplQgFYdQdwPMR9YdX0UlhBmvB84uAmQKUc= -cloud.google.com/go/accessapproval v1.7.5/go.mod h1:g88i1ok5dvQ9XJsxpUInWWvUBrIZhyPDPbk4T01OoJ0= cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= cloud.google.com/go/accesscontextmanager v1.6.0/go.mod h1:8XCvZWfYw3K/ji0iVnp+6pu7huxoQTLmxAbVjbloTtM= -cloud.google.com/go/accesscontextmanager v1.7.0/go.mod h1:CEGLewx8dwa33aDAZQujl7Dx+uYhS0eay198wB/VumQ= -cloud.google.com/go/accesscontextmanager v1.8.0/go.mod h1:uI+AI/r1oyWK99NN8cQ3UK76AMelMzgZCvJfsi2c+ps= -cloud.google.com/go/accesscontextmanager v1.8.1/go.mod h1:JFJHfvuaTC+++1iL1coPiG1eu5D24db2wXCDWDjIrxo= -cloud.google.com/go/accesscontextmanager v1.8.2/go.mod h1:E6/SCRM30elQJ2PKtFMs2YhfJpZSNcJyejhuzoId4Zk= -cloud.google.com/go/accesscontextmanager v1.8.3/go.mod h1:4i/JkF2JiFbhLnnpnfoTX5vRXfhf9ukhU1ANOTALTOQ= -cloud.google.com/go/accesscontextmanager v1.8.4/go.mod h1:ParU+WbMpD34s5JFEnGAnPBYAgUHozaTmDJU7aCU9+M= -cloud.google.com/go/accesscontextmanager v1.8.5/go.mod h1:TInEhcZ7V9jptGNqN3EzZ5XMhT6ijWxTGjzyETwmL0Q= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/aiplatform v1.27.0/go.mod h1:Bvxqtl40l0WImSb04d0hXFU7gDOiq9jQmorivIiWcKg= cloud.google.com/go/aiplatform v1.35.0/go.mod h1:7MFT/vCaOyZT/4IIFfxH4ErVg/4ku6lKv3w0+tFTgXQ= -cloud.google.com/go/aiplatform v1.36.1/go.mod h1:WTm12vJRPARNvJ+v6P52RDHCNe4AhvjcIZ/9/RRHy/k= -cloud.google.com/go/aiplatform v1.37.0/go.mod h1:IU2Cv29Lv9oCn/9LkFiiuKfwrRTq+QQMbW+hPCxJGZw= -cloud.google.com/go/aiplatform v1.45.0/go.mod h1:Iu2Q7sC7QGhXUeOhAj/oCK9a+ULz1O4AotZiqjQ8MYA= -cloud.google.com/go/aiplatform v1.48.0/go.mod h1:Iu2Q7sC7QGhXUeOhAj/oCK9a+ULz1O4AotZiqjQ8MYA= -cloud.google.com/go/aiplatform v1.50.0/go.mod h1:IRc2b8XAMTa9ZmfJV1BCCQbieWWvDnP1A8znyz5N7y4= -cloud.google.com/go/aiplatform v1.51.0/go.mod h1:IRc2b8XAMTa9ZmfJV1BCCQbieWWvDnP1A8znyz5N7y4= -cloud.google.com/go/aiplatform v1.51.1/go.mod h1:kY3nIMAVQOK2XDqDPHaOuD9e+FdMA6OOpfBjsvaFSOo= -cloud.google.com/go/aiplatform v1.51.2/go.mod h1:hCqVYB3mY45w99TmetEoe8eCQEwZEp9WHxeZdcv9phw= -cloud.google.com/go/aiplatform v1.52.0/go.mod h1:pwZMGvqe0JRkI1GWSZCtnAfrR4K1bv65IHILGA//VEU= -cloud.google.com/go/aiplatform v1.54.0/go.mod h1:pwZMGvqe0JRkI1GWSZCtnAfrR4K1bv65IHILGA//VEU= -cloud.google.com/go/aiplatform v1.57.0/go.mod h1:pwZMGvqe0JRkI1GWSZCtnAfrR4K1bv65IHILGA//VEU= -cloud.google.com/go/aiplatform v1.58.0/go.mod h1:pwZMGvqe0JRkI1GWSZCtnAfrR4K1bv65IHILGA//VEU= -cloud.google.com/go/aiplatform v1.58.2/go.mod h1:c3kCiVmb6UC1dHAjZjcpDj6ZS0bHQ2slL88ZjC2LtlA= -cloud.google.com/go/aiplatform v1.60.0/go.mod h1:eTlGuHOahHprZw3Hio5VKmtThIOak5/qy6pzdsqcQnM= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= -cloud.google.com/go/analytics v0.17.0/go.mod h1:WXFa3WSym4IZ+JiKmavYdJwGG/CvpqiqczmL59bTD9M= cloud.google.com/go/analytics v0.18.0/go.mod h1:ZkeHGQlcIPkw0R/GW+boWHhCOR43xz9RN/jn7WcqfIE= -cloud.google.com/go/analytics v0.19.0/go.mod h1:k8liqf5/HCnOUkbawNtrWWc+UAzyDlW89doe8TtoDsE= -cloud.google.com/go/analytics v0.21.2/go.mod h1:U8dcUtmDmjrmUTnnnRnI4m6zKn/yaA5N9RlEkYFHpQo= -cloud.google.com/go/analytics v0.21.3/go.mod h1:U8dcUtmDmjrmUTnnnRnI4m6zKn/yaA5N9RlEkYFHpQo= -cloud.google.com/go/analytics v0.21.4/go.mod h1:zZgNCxLCy8b2rKKVfC1YkC2vTrpfZmeRCySM3aUbskA= -cloud.google.com/go/analytics v0.21.5/go.mod h1:BQtOBHWTlJ96axpPPnw5CvGJ6i3Ve/qX2fTxR8qWyr8= -cloud.google.com/go/analytics v0.21.6/go.mod h1:eiROFQKosh4hMaNhF85Oc9WO97Cpa7RggD40e/RBy8w= -cloud.google.com/go/analytics v0.22.0/go.mod h1:eiROFQKosh4hMaNhF85Oc9WO97Cpa7RggD40e/RBy8w= -cloud.google.com/go/analytics v0.23.0/go.mod h1:YPd7Bvik3WS95KBok2gPXDqQPHy08TsCQG6CdUCb+u0= cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk= cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= cloud.google.com/go/apigateway v1.5.0/go.mod h1:GpnZR3Q4rR7LVu5951qfXPJCHquZt02jf7xQx7kpqN8= -cloud.google.com/go/apigateway v1.6.1/go.mod h1:ufAS3wpbRjqfZrzpvLC2oh0MFlpRJm2E/ts25yyqmXA= -cloud.google.com/go/apigateway v1.6.2/go.mod h1:CwMC90nnZElorCW63P2pAYm25AtQrHfuOkbRSHj0bT8= -cloud.google.com/go/apigateway v1.6.3/go.mod h1:k68PXWpEs6BVDTtnLQAyG606Q3mz8pshItwPXjgv44Y= -cloud.google.com/go/apigateway v1.6.4/go.mod h1:0EpJlVGH5HwAN4VF4Iec8TAzGN1aQgbxAWGJsnPCGGY= -cloud.google.com/go/apigateway v1.6.5/go.mod h1:6wCwvYRckRQogyDDltpANi3zsCDl6kWi0b4Je+w2UiI= cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc= cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= cloud.google.com/go/apigeeconnect v1.5.0/go.mod h1:KFaCqvBRU6idyhSNyn3vlHXc8VMDJdRmwDF6JyFRqZ8= -cloud.google.com/go/apigeeconnect v1.6.1/go.mod h1:C4awq7x0JpLtrlQCr8AzVIzAaYgngRqWf9S5Uhg+wWs= -cloud.google.com/go/apigeeconnect v1.6.2/go.mod h1:s6O0CgXT9RgAxlq3DLXvG8riw8PYYbU/v25jqP3Dy18= -cloud.google.com/go/apigeeconnect v1.6.3/go.mod h1:peG0HFQ0si2bN15M6QSjEW/W7Gy3NYkWGz7pFz13cbo= -cloud.google.com/go/apigeeconnect v1.6.4/go.mod h1:CapQCWZ8TCjnU0d7PobxhpOdVz/OVJ2Hr/Zcuu1xFx0= -cloud.google.com/go/apigeeconnect v1.6.5/go.mod h1:MEKm3AiT7s11PqTfKE3KZluZA9O91FNysvd3E6SJ6Ow= cloud.google.com/go/apigeeregistry v0.4.0/go.mod h1:EUG4PGcsZvxOXAdyEghIdXwAEi/4MEaoqLMLDMIwKXY= cloud.google.com/go/apigeeregistry v0.5.0/go.mod h1:YR5+s0BVNZfVOUkMa5pAR2xGd0A473vA5M7j247o1wM= -cloud.google.com/go/apigeeregistry v0.6.0/go.mod h1:BFNzW7yQVLZ3yj0TKcwzb8n25CFBri51GVGOEUcgQsc= -cloud.google.com/go/apigeeregistry v0.7.1/go.mod h1:1XgyjZye4Mqtw7T9TsY4NW10U7BojBvG4RMD+vRDrIw= -cloud.google.com/go/apigeeregistry v0.7.2/go.mod h1:9CA2B2+TGsPKtfi3F7/1ncCCsL62NXBRfM6iPoGSM+8= -cloud.google.com/go/apigeeregistry v0.8.1/go.mod h1:MW4ig1N4JZQsXmBSwH4rwpgDonocz7FPBSw6XPGHmYw= -cloud.google.com/go/apigeeregistry v0.8.2/go.mod h1:h4v11TDGdeXJDJvImtgK2AFVvMIgGWjSb0HRnBSjcX8= -cloud.google.com/go/apigeeregistry v0.8.3/go.mod h1:aInOWnqF4yMQx8kTjDqHNXjZGh/mxeNlAf52YqtASUs= cloud.google.com/go/apikeys v0.4.0/go.mod h1:XATS/yqZbaBK0HOssf+ALHp8jAlNHUgyfprvNcBIszU= cloud.google.com/go/apikeys v0.5.0/go.mod h1:5aQfwY4D+ewMMWScd3hm2en3hCj+BROlyrt3ytS7KLI= -cloud.google.com/go/apikeys v0.6.0/go.mod h1:kbpXu5upyiAlGkKrJgQl8A0rKNNJ7dQ377pdroRSSi8= cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno= cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= cloud.google.com/go/appengine v1.6.0/go.mod h1:hg6i0J/BD2cKmDJbaFSYHFyZkgBEfQrDg/X0V5fJn84= -cloud.google.com/go/appengine v1.7.0/go.mod h1:eZqpbHFCqRGa2aCdope7eC0SWLV1j0neb/QnMJVWx6A= -cloud.google.com/go/appengine v1.7.1/go.mod h1:IHLToyb/3fKutRysUlFO0BPt5j7RiQ45nrzEJmKTo6E= -cloud.google.com/go/appengine v1.8.1/go.mod h1:6NJXGLVhZCN9aQ/AEDvmfzKEfoYBlfB80/BHiKVputY= -cloud.google.com/go/appengine v1.8.2/go.mod h1:WMeJV9oZ51pvclqFN2PqHoGnys7rK0rz6s3Mp6yMvDo= -cloud.google.com/go/appengine v1.8.3/go.mod h1:2oUPZ1LVZ5EXi+AF1ihNAF+S8JrzQ3till5m9VQkrsk= -cloud.google.com/go/appengine v1.8.4/go.mod h1:TZ24v+wXBujtkK77CXCpjZbnuTvsFNT41MUaZ28D6vg= -cloud.google.com/go/appengine v1.8.5/go.mod h1:uHBgNoGLTS5di7BvU25NFDuKa82v0qQLjyMJLuPQrVo= cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= -cloud.google.com/go/area120 v0.7.0/go.mod h1:a3+8EUD1SX5RUcCs3MY5YasiO1z6yLiNLRiFrykbynY= cloud.google.com/go/area120 v0.7.1/go.mod h1:j84i4E1RboTWjKtZVWXPqvK5VHQFJRF2c1Nm69pWm9k= -cloud.google.com/go/area120 v0.8.1/go.mod h1:BVfZpGpB7KFVNxPiQBuHkX6Ed0rS51xIgmGyjrAfzsg= -cloud.google.com/go/area120 v0.8.2/go.mod h1:a5qfo+x77SRLXnCynFWPUZhnZGeSgvQ+Y0v1kSItkh4= -cloud.google.com/go/area120 v0.8.3/go.mod h1:5zj6pMzVTH+SVHljdSKC35sriR/CVvQZzG/Icdyriw0= -cloud.google.com/go/area120 v0.8.4/go.mod h1:jfawXjxf29wyBXr48+W+GyX/f8fflxp642D/bb9v68M= -cloud.google.com/go/area120 v0.8.5/go.mod h1:BcoFCbDLZjsfe4EkCnEq1LKvHSK0Ew/zk5UFu6GMyA0= cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0= cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= -cloud.google.com/go/artifactregistry v1.11.1/go.mod h1:lLYghw+Itq9SONbCa1YWBoWs1nOucMH0pwXN1rOBZFI= cloud.google.com/go/artifactregistry v1.11.2/go.mod h1:nLZns771ZGAwVLzTX/7Al6R9ehma4WUEhZGWV6CeQNQ= -cloud.google.com/go/artifactregistry v1.12.0/go.mod h1:o6P3MIvtzTOnmvGagO9v/rOjjA0HmhJ+/6KAXrmYDCI= -cloud.google.com/go/artifactregistry v1.13.0/go.mod h1:uy/LNfoOIivepGhooAUpL1i30Hgee3Cu0l4VTWHUC08= -cloud.google.com/go/artifactregistry v1.14.1/go.mod h1:nxVdG19jTaSTu7yA7+VbWL346r3rIdkZ142BSQqhn5E= -cloud.google.com/go/artifactregistry v1.14.2/go.mod h1:Xk+QbsKEb0ElmyeMfdHAey41B+qBq3q5R5f5xD4XT3U= -cloud.google.com/go/artifactregistry v1.14.3/go.mod h1:A2/E9GXnsyXl7GUvQ/2CjHA+mVRoWAXC0brg2os+kNI= -cloud.google.com/go/artifactregistry v1.14.4/go.mod h1:SJJcZTMv6ce0LDMUnihCN7WSrI+kBSFV0KIKo8S8aYU= -cloud.google.com/go/artifactregistry v1.14.6/go.mod h1:np9LSFotNWHcjnOgh8UVK0RFPCTUGbO0ve3384xyHfE= -cloud.google.com/go/artifactregistry v1.14.7/go.mod h1:0AUKhzWQzfmeTvT4SjfI4zjot72EMfrkvL9g9aRjnnM= cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ= cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= cloud.google.com/go/asset v1.11.1/go.mod h1:fSwLhbRvC9p9CXQHJ3BgFeQNM4c9x10lqlrdEUYXlJo= -cloud.google.com/go/asset v1.12.0/go.mod h1:h9/sFOa4eDIyKmH6QMpm4eUK3pDojWnUhTgJlk762Hg= -cloud.google.com/go/asset v1.13.0/go.mod h1:WQAMyYek/b7NBpYq/K4KJWcRqzoalEsxz/t/dTk4THw= -cloud.google.com/go/asset v1.14.1/go.mod h1:4bEJ3dnHCqWCDbWJ/6Vn7GVI9LerSi7Rfdi03hd+WTQ= -cloud.google.com/go/asset v1.15.0/go.mod h1:tpKafV6mEut3+vN9ScGvCHXHj7FALFVta+okxFECHcg= -cloud.google.com/go/asset v1.15.1/go.mod h1:yX/amTvFWRpp5rcFq6XbCxzKT8RJUam1UoboE179jU4= -cloud.google.com/go/asset v1.15.2/go.mod h1:B6H5tclkXvXz7PD22qCA2TDxSVQfasa3iDlM89O2NXs= -cloud.google.com/go/asset v1.15.3/go.mod h1:yYLfUD4wL4X589A9tYrv4rFrba0QlDeag0CMcM5ggXU= -cloud.google.com/go/asset v1.16.0/go.mod h1:yYLfUD4wL4X589A9tYrv4rFrba0QlDeag0CMcM5ggXU= -cloud.google.com/go/asset v1.17.0/go.mod h1:yYLfUD4wL4X589A9tYrv4rFrba0QlDeag0CMcM5ggXU= -cloud.google.com/go/asset v1.17.1/go.mod h1:byvDw36UME5AzGNK7o4JnOnINkwOZ1yRrGrKIahHrng= -cloud.google.com/go/asset v1.17.2/go.mod h1:SVbzde67ehddSoKf5uebOD1sYw8Ab/jD/9EIeWg99q4= cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= cloud.google.com/go/assuredworkloads v1.10.0/go.mod h1:kwdUQuXcedVdsIaKgKTp9t0UJkE5+PAVNhdQm4ZVq2E= -cloud.google.com/go/assuredworkloads v1.11.1/go.mod h1:+F04I52Pgn5nmPG36CWFtxmav6+7Q+c5QyJoL18Lry0= -cloud.google.com/go/assuredworkloads v1.11.2/go.mod h1:O1dfr+oZJMlE6mw0Bp0P1KZSlj5SghMBvTpZqIcUAW4= -cloud.google.com/go/assuredworkloads v1.11.3/go.mod h1:vEjfTKYyRUaIeA0bsGJceFV2JKpVRgyG2op3jfa59Zs= -cloud.google.com/go/assuredworkloads v1.11.4/go.mod h1:4pwwGNwy1RP0m+y12ef3Q/8PaiWrIDQ6nD2E8kvWI9U= -cloud.google.com/go/assuredworkloads v1.11.5/go.mod h1:FKJ3g3ZvkL2D7qtqIGnDufFkHxwIpNM9vtmhvt+6wqk= cloud.google.com/go/auth v0.9.3 h1:VOEUIAADkkLtyfr3BLa3R8Ed/j6w1jTBmARx+wb5w5U= cloud.google.com/go/auth v0.9.3/go.mod h1:7z6VY+7h3KUdRov5F1i8NDP5ZzWKYmEPO842BgCsmTk= cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY= @@ -193,41 +95,15 @@ cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/I cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8= cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= cloud.google.com/go/automl v1.12.0/go.mod h1:tWDcHDp86aMIuHmyvjuKeeHEGq76lD7ZqfGLN6B0NuU= -cloud.google.com/go/automl v1.13.1/go.mod h1:1aowgAHWYZU27MybSCFiukPO7xnyawv7pt3zK4bheQE= -cloud.google.com/go/automl v1.13.2/go.mod h1:gNY/fUmDEN40sP8amAX3MaXkxcqPIn7F1UIIPZpy4Mg= -cloud.google.com/go/automl v1.13.3/go.mod h1:Y8KwvyAZFOsMAPqUCfNu1AyclbC6ivCUF/MTwORymyY= -cloud.google.com/go/automl v1.13.4/go.mod h1:ULqwX/OLZ4hBVfKQaMtxMSTlPx0GqGbWN8uA/1EqCP8= -cloud.google.com/go/automl v1.13.5/go.mod h1:MDw3vLem3yh+SvmSgeYUmUKqyls6NzSumDm9OJ3xJ1Y= cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc= cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= cloud.google.com/go/baremetalsolution v0.5.0/go.mod h1:dXGxEkmR9BMwxhzBhV0AioD0ULBmuLZI8CdwalUxuss= -cloud.google.com/go/baremetalsolution v1.1.1/go.mod h1:D1AV6xwOksJMV4OSlWHtWuFNZZYujJknMAP4Qa27QIA= -cloud.google.com/go/baremetalsolution v1.2.0/go.mod h1:68wi9AwPYkEWIUT4SvSGS9UJwKzNpshjHsH4lzk8iOw= -cloud.google.com/go/baremetalsolution v1.2.1/go.mod h1:3qKpKIw12RPXStwQXcbhfxVj1dqQGEvcmA+SX/mUR88= -cloud.google.com/go/baremetalsolution v1.2.2/go.mod h1:O5V6Uu1vzVelYahKfwEWRMaS3AbCkeYHy3145s1FkhM= -cloud.google.com/go/baremetalsolution v1.2.3/go.mod h1:/UAQ5xG3faDdy180rCUv47e0jvpp3BFxT+Cl0PFjw5g= -cloud.google.com/go/baremetalsolution v1.2.4/go.mod h1:BHCmxgpevw9IEryE99HbYEfxXkAEA3hkMJbYYsHtIuY= cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE= cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= cloud.google.com/go/batch v0.7.0/go.mod h1:vLZN95s6teRUqRQ4s3RLDsH8PvboqBK+rn1oevL159g= -cloud.google.com/go/batch v1.3.1/go.mod h1:VguXeQKXIYaeeIYbuozUmBR13AfL4SJP7IltNPS+A4A= -cloud.google.com/go/batch v1.4.1/go.mod h1:KdBmDD61K0ovcxoRHGrN6GmOBWeAOyCgKD0Mugx4Fkk= -cloud.google.com/go/batch v1.5.0/go.mod h1:KdBmDD61K0ovcxoRHGrN6GmOBWeAOyCgKD0Mugx4Fkk= -cloud.google.com/go/batch v1.5.1/go.mod h1:RpBuIYLkQu8+CWDk3dFD/t/jOCGuUpkpX+Y0n1Xccs8= -cloud.google.com/go/batch v1.6.1/go.mod h1:urdpD13zPe6YOK+6iZs/8/x2VBRofvblLpx0t57vM98= -cloud.google.com/go/batch v1.6.3/go.mod h1:J64gD4vsNSA2O5TtDB5AAux3nJ9iV8U3ilg3JDBYejU= -cloud.google.com/go/batch v1.7.0/go.mod h1:J64gD4vsNSA2O5TtDB5AAux3nJ9iV8U3ilg3JDBYejU= -cloud.google.com/go/batch v1.8.0/go.mod h1:k8V7f6VE2Suc0zUM4WtoibNrA6D3dqBpB+++e3vSGYc= cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4= cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= cloud.google.com/go/beyondcorp v0.4.0/go.mod h1:3ApA0mbhHx6YImmuubf5pyW8srKnCEPON32/5hj+RmM= -cloud.google.com/go/beyondcorp v0.5.0/go.mod h1:uFqj9X+dSfrheVp7ssLTaRHd2EHqSL4QZmH4e8WXGGU= -cloud.google.com/go/beyondcorp v0.6.1/go.mod h1:YhxDWw946SCbmcWo3fAhw3V4XZMSpQ/VYfcKGAEU8/4= -cloud.google.com/go/beyondcorp v1.0.0/go.mod h1:YhxDWw946SCbmcWo3fAhw3V4XZMSpQ/VYfcKGAEU8/4= -cloud.google.com/go/beyondcorp v1.0.1/go.mod h1:zl/rWWAFVeV+kx+X2Javly7o1EIQThU4WlkynffL/lk= -cloud.google.com/go/beyondcorp v1.0.2/go.mod h1:m8cpG7caD+5su+1eZr+TSvF6r21NdLJk4f9u4SP2Ntc= -cloud.google.com/go/beyondcorp v1.0.3/go.mod h1:HcBvnEd7eYr+HGDd5ZbuVmBYX019C6CEXBonXbCVwJo= -cloud.google.com/go/beyondcorp v1.0.4/go.mod h1:Gx8/Rk2MxrvWfn4WIhHIG1NV7IBfg14pTKv1+EArVcc= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -237,96 +113,34 @@ cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM7 cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= -cloud.google.com/go/bigquery v1.47.0/go.mod h1:sA9XOgy0A8vQK9+MWhEQTY6Tix87M/ZurWFIxmF9I/E= cloud.google.com/go/bigquery v1.48.0/go.mod h1:QAwSz+ipNgfL5jxiaK7weyOhzdoAy1zFm0Nf1fysJac= -cloud.google.com/go/bigquery v1.49.0/go.mod h1:Sv8hMmTFFYBlt/ftw2uN6dFdQPzBlREY9yBh7Oy7/4Q= -cloud.google.com/go/bigquery v1.50.0/go.mod h1:YrleYEh2pSEbgTBZYMJ5SuSr0ML3ypjRB1zgf7pvQLU= -cloud.google.com/go/bigquery v1.52.0/go.mod h1:3b/iXjRQGU4nKa87cXeg6/gogLjO8C6PmuM8i5Bi/u4= -cloud.google.com/go/bigquery v1.53.0/go.mod h1:3b/iXjRQGU4nKa87cXeg6/gogLjO8C6PmuM8i5Bi/u4= -cloud.google.com/go/bigquery v1.55.0/go.mod h1:9Y5I3PN9kQWuid6183JFhOGOW3GcirA5LpsKCUn+2ec= -cloud.google.com/go/bigquery v1.56.0/go.mod h1:KDcsploXTEY7XT3fDQzMUZlpQLHzE4itubHrnmhUrZA= -cloud.google.com/go/bigquery v1.57.1/go.mod h1:iYzC0tGVWt1jqSzBHqCr3lrRn0u13E8e+AqowBsDgug= -cloud.google.com/go/bigquery v1.58.0/go.mod h1:0eh4mWNY0KrBTjUzLjoYImapGORq9gEPT7MWjCy9lik= -cloud.google.com/go/bigquery v1.59.1/go.mod h1:VP1UJYgevyTwsV7desjzNzDND5p6hZB+Z8gZJN1GQUc= cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= cloud.google.com/go/billing v1.12.0/go.mod h1:yKrZio/eu+okO/2McZEbch17O5CB5NpZhhXG6Z766ss= -cloud.google.com/go/billing v1.13.0/go.mod h1:7kB2W9Xf98hP9Sr12KfECgfGclsH3CQR0R08tnRlRbc= -cloud.google.com/go/billing v1.16.0/go.mod h1:y8vx09JSSJG02k5QxbycNRrN7FGZB6F3CAcgum7jvGA= -cloud.google.com/go/billing v1.17.0/go.mod h1:Z9+vZXEq+HwH7bhJkyI4OQcR6TSbeMrjlpEjO2vzY64= -cloud.google.com/go/billing v1.17.1/go.mod h1:Z9+vZXEq+HwH7bhJkyI4OQcR6TSbeMrjlpEjO2vzY64= -cloud.google.com/go/billing v1.17.2/go.mod h1:u/AdV/3wr3xoRBk5xvUzYMS1IawOAPwQMuHgHMdljDg= -cloud.google.com/go/billing v1.17.3/go.mod h1:z83AkoZ7mZwBGT3yTnt6rSGI1OOsHSIi6a5M3mJ8NaU= -cloud.google.com/go/billing v1.17.4/go.mod h1:5DOYQStCxquGprqfuid/7haD7th74kyMBHkjO/OvDtk= -cloud.google.com/go/billing v1.18.0/go.mod h1:5DOYQStCxquGprqfuid/7haD7th74kyMBHkjO/OvDtk= -cloud.google.com/go/billing v1.18.2/go.mod h1:PPIwVsOOQ7xzbADCwNe8nvK776QpfrOAUkvKjCUcpSE= cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0= cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= cloud.google.com/go/binaryauthorization v1.5.0/go.mod h1:OSe4OU1nN/VswXKRBmciKpo9LulY41gch5c68htf3/Q= -cloud.google.com/go/binaryauthorization v1.6.1/go.mod h1:TKt4pa8xhowwffiBmbrbcxijJRZED4zrqnwZ1lKH51U= -cloud.google.com/go/binaryauthorization v1.7.0/go.mod h1:Zn+S6QqTMn6odcMU1zDZCJxPjU2tZPV1oDl45lWY154= -cloud.google.com/go/binaryauthorization v1.7.1/go.mod h1:GTAyfRWYgcbsP3NJogpV3yeunbUIjx2T9xVeYovtURE= -cloud.google.com/go/binaryauthorization v1.7.2/go.mod h1:kFK5fQtxEp97m92ziy+hbu+uKocka1qRRL8MVJIgjv0= -cloud.google.com/go/binaryauthorization v1.7.3/go.mod h1:VQ/nUGRKhrStlGr+8GMS8f6/vznYLkdK5vaKfdCIpvU= -cloud.google.com/go/binaryauthorization v1.8.0/go.mod h1:VQ/nUGRKhrStlGr+8GMS8f6/vznYLkdK5vaKfdCIpvU= -cloud.google.com/go/binaryauthorization v1.8.1/go.mod h1:1HVRyBerREA/nhI7yLang4Zn7vfNVA3okoAR9qYQJAQ= cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg= cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= cloud.google.com/go/certificatemanager v1.6.0/go.mod h1:3Hh64rCKjRAX8dXgRAyOcY5vQ/fE1sh8o+Mdd6KPgY8= -cloud.google.com/go/certificatemanager v1.7.1/go.mod h1:iW8J3nG6SaRYImIa+wXQ0g8IgoofDFRp5UMzaNk1UqI= -cloud.google.com/go/certificatemanager v1.7.2/go.mod h1:15SYTDQMd00kdoW0+XY5d9e+JbOPjp24AvF48D8BbcQ= -cloud.google.com/go/certificatemanager v1.7.3/go.mod h1:T/sZYuC30PTag0TLo28VedIRIj1KPGcOQzjWAptHa00= -cloud.google.com/go/certificatemanager v1.7.4/go.mod h1:FHAylPe/6IIKuaRmHbjbdLhGhVQ+CWHSD5Jq0k4+cCE= -cloud.google.com/go/certificatemanager v1.7.5/go.mod h1:uX+v7kWqy0Y3NG/ZhNvffh0kuqkKZIXdvlZRO7z0VtM= cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk= cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= cloud.google.com/go/channel v1.11.0/go.mod h1:IdtI0uWGqhEeatSB62VOoJ8FSUhJ9/+iGkJVqp74CGE= -cloud.google.com/go/channel v1.12.0/go.mod h1:VkxCGKASi4Cq7TbXxlaBezonAYpp1GCnKMY6tnMQnLU= -cloud.google.com/go/channel v1.16.0/go.mod h1:eN/q1PFSl5gyu0dYdmxNXscY/4Fi7ABmeHCJNf/oHmc= -cloud.google.com/go/channel v1.17.0/go.mod h1:RpbhJsGi/lXWAUM1eF4IbQGbsfVlg2o8Iiy2/YLfVT0= -cloud.google.com/go/channel v1.17.1/go.mod h1:xqfzcOZAcP4b/hUDH0GkGg1Sd5to6di1HOJn/pi5uBQ= -cloud.google.com/go/channel v1.17.2/go.mod h1:aT2LhnftnyfQceFql5I/mP8mIbiiJS4lWqgXA815zMk= -cloud.google.com/go/channel v1.17.3/go.mod h1:QcEBuZLGGrUMm7kNj9IbU1ZfmJq2apotsV83hbxX7eE= -cloud.google.com/go/channel v1.17.4/go.mod h1:QcEBuZLGGrUMm7kNj9IbU1ZfmJq2apotsV83hbxX7eE= -cloud.google.com/go/channel v1.17.5/go.mod h1:FlpaOSINDAXgEext0KMaBq/vwpLMkkPAw9b2mApQeHc= cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U= cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= -cloud.google.com/go/cloudbuild v1.6.0/go.mod h1:UIbc/w9QCbH12xX+ezUsgblrWv+Cv4Tw83GiSMHOn9M= cloud.google.com/go/cloudbuild v1.7.0/go.mod h1:zb5tWh2XI6lR9zQmsm1VRA+7OCuve5d8S+zJUul8KTg= -cloud.google.com/go/cloudbuild v1.9.0/go.mod h1:qK1d7s4QlO0VwfYn5YuClDGg2hfmLZEb4wQGAbIgL1s= -cloud.google.com/go/cloudbuild v1.10.1/go.mod h1:lyJg7v97SUIPq4RC2sGsz/9tNczhyv2AjML/ci4ulzU= -cloud.google.com/go/cloudbuild v1.13.0/go.mod h1:lyJg7v97SUIPq4RC2sGsz/9tNczhyv2AjML/ci4ulzU= -cloud.google.com/go/cloudbuild v1.14.0/go.mod h1:lyJg7v97SUIPq4RC2sGsz/9tNczhyv2AjML/ci4ulzU= -cloud.google.com/go/cloudbuild v1.14.1/go.mod h1:K7wGc/3zfvmYWOWwYTgF/d/UVJhS4pu+HAy7PL7mCsU= -cloud.google.com/go/cloudbuild v1.14.2/go.mod h1:Bn6RO0mBYk8Vlrt+8NLrru7WXlQ9/RDWz2uo5KG1/sg= -cloud.google.com/go/cloudbuild v1.14.3/go.mod h1:eIXYWmRt3UtggLnFGx4JvXcMj4kShhVzGndL1LwleEM= -cloud.google.com/go/cloudbuild v1.15.0/go.mod h1:eIXYWmRt3UtggLnFGx4JvXcMj4kShhVzGndL1LwleEM= -cloud.google.com/go/cloudbuild v1.15.1/go.mod h1:gIofXZSu+XD2Uy+qkOrGKEx45zd7s28u/k8f99qKals= cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM= cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= cloud.google.com/go/clouddms v1.5.0/go.mod h1:QSxQnhikCLUw13iAbffF2CZxAER3xDGNHjsTAkQJcQA= -cloud.google.com/go/clouddms v1.6.1/go.mod h1:Ygo1vL52Ov4TBZQquhz5fiw2CQ58gvu+PlS6PVXCpZI= -cloud.google.com/go/clouddms v1.7.0/go.mod h1:MW1dC6SOtI/tPNCciTsXtsGNEM0i0OccykPvv3hiYeM= -cloud.google.com/go/clouddms v1.7.1/go.mod h1:o4SR8U95+P7gZ/TX+YbJxehOCsM+fe6/brlrFquiszk= -cloud.google.com/go/clouddms v1.7.2/go.mod h1:Rk32TmWmHo64XqDvW7jgkFQet1tUKNVzs7oajtJT3jU= -cloud.google.com/go/clouddms v1.7.3/go.mod h1:fkN2HQQNUYInAU3NQ3vRLkV2iWs8lIdmBKOx4nrL6Hc= -cloud.google.com/go/clouddms v1.7.4/go.mod h1:RdrVqoFG9RWI5AvZ81SxJ/xvxPdtcRhFotwdE79DieY= cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4= cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= cloud.google.com/go/cloudtasks v1.9.0/go.mod h1:w+EyLsVkLWHcOaqNEyvcKAsWp9p29dL6uL9Nst1cI7Y= -cloud.google.com/go/cloudtasks v1.10.0/go.mod h1:NDSoTLkZ3+vExFEWu2UJV1arUyzVDAiZtdWcsUyNwBs= -cloud.google.com/go/cloudtasks v1.11.1/go.mod h1:a9udmnou9KO2iulGscKR0qBYjreuX8oHwpmFsKspEvM= -cloud.google.com/go/cloudtasks v1.12.1/go.mod h1:a9udmnou9KO2iulGscKR0qBYjreuX8oHwpmFsKspEvM= -cloud.google.com/go/cloudtasks v1.12.2/go.mod h1:A7nYkjNlW2gUoROg1kvJrQGhJP/38UaWwsnuBDOBVUk= -cloud.google.com/go/cloudtasks v1.12.3/go.mod h1:GPVXhIOSGEaR+3xT4Fp72ScI+HjHffSS4B8+BaBB5Ys= -cloud.google.com/go/cloudtasks v1.12.4/go.mod h1:BEPu0Gtt2dU6FxZHNqqNdGqIG86qyWKBPGnsb7udGY0= -cloud.google.com/go/cloudtasks v1.12.6/go.mod h1:b7c7fe4+TJsFZfDyzO51F7cjq7HLUlRi/KZQLQjDsaY= cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= @@ -338,16 +152,8 @@ cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= +cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= -cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= -cloud.google.com/go/compute v1.19.3/go.mod h1:qxvISKp/gYnXkSAD1ppcSOveRAmzxicEv/JlizULFrI= -cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute v1.23.1/go.mod h1:CqB3xpmPKKt3OJpW2ndFIXnA9A4xAy/F3Xp1ixncW78= -cloud.google.com/go/compute v1.23.2/go.mod h1:JJ0atRC0J/oWYiiVBmsSsrRnh92DhZPG4hFDcR04Rns= -cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= -cloud.google.com/go/compute v1.23.4/go.mod h1:/EJMj55asU6kAFnuZET8zqgwgJ9FvXWXOkkfQZa4ioI= -cloud.google.com/go/compute v1.24.0/go.mod h1:kw1/T+h/+tK2LJK0wiPPx1intgdAM3j/g3hFDlscY40= cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= @@ -357,40 +163,12 @@ cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykW cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= cloud.google.com/go/contactcenterinsights v1.6.0/go.mod h1:IIDlT6CLcDoyv79kDv8iWxMSTZhLxSCofVV5W6YFM/w= -cloud.google.com/go/contactcenterinsights v1.9.1/go.mod h1:bsg/R7zGLYMVxFFzfh9ooLTruLRCG9fnzhH9KznHhbM= -cloud.google.com/go/contactcenterinsights v1.10.0/go.mod h1:bsg/R7zGLYMVxFFzfh9ooLTruLRCG9fnzhH9KznHhbM= -cloud.google.com/go/contactcenterinsights v1.11.0/go.mod h1:hutBdImE4XNZ1NV4vbPJKSFOnQruhC5Lj9bZqWMTKiU= -cloud.google.com/go/contactcenterinsights v1.11.1/go.mod h1:FeNP3Kg8iteKM80lMwSk3zZZKVxr+PGnAId6soKuXwE= -cloud.google.com/go/contactcenterinsights v1.11.2/go.mod h1:A9PIR5ov5cRcd28KlDbmmXE8Aay+Gccer2h4wzkYFso= -cloud.google.com/go/contactcenterinsights v1.11.3/go.mod h1:HHX5wrz5LHVAwfI2smIotQG9x8Qd6gYilaHcLLLmNis= -cloud.google.com/go/contactcenterinsights v1.12.0/go.mod h1:HHX5wrz5LHVAwfI2smIotQG9x8Qd6gYilaHcLLLmNis= -cloud.google.com/go/contactcenterinsights v1.12.1/go.mod h1:HHX5wrz5LHVAwfI2smIotQG9x8Qd6gYilaHcLLLmNis= -cloud.google.com/go/contactcenterinsights v1.13.0/go.mod h1:ieq5d5EtHsu8vhe2y3amtZ+BE+AQwX5qAy7cpo0POsI= cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= cloud.google.com/go/container v1.13.1/go.mod h1:6wgbMPeQRw9rSnKBCAJXnds3Pzj03C4JHamr8asWKy4= -cloud.google.com/go/container v1.14.0/go.mod h1:3AoJMPhHfLDxLvrlVWaK57IXzaPnLaZq63WX59aQBfM= -cloud.google.com/go/container v1.15.0/go.mod h1:ft+9S0WGjAyjDggg5S06DXj+fHJICWg8L7isCQe9pQA= -cloud.google.com/go/container v1.22.1/go.mod h1:lTNExE2R7f+DLbAN+rJiKTisauFCaoDq6NURZ83eVH4= -cloud.google.com/go/container v1.24.0/go.mod h1:lTNExE2R7f+DLbAN+rJiKTisauFCaoDq6NURZ83eVH4= -cloud.google.com/go/container v1.26.0/go.mod h1:YJCmRet6+6jnYYRS000T6k0D0xUXQgBSaJ7VwI8FBj4= -cloud.google.com/go/container v1.26.1/go.mod h1:5smONjPRUxeEpDG7bMKWfDL4sauswqEtnBK1/KKpR04= -cloud.google.com/go/container v1.26.2/go.mod h1:YlO84xCt5xupVbLaMY4s3XNE79MUJ+49VmkInr6HvF4= -cloud.google.com/go/container v1.27.1/go.mod h1:b1A1gJeTBXVLQ6GGw9/9M4FG94BEGsqJ5+t4d/3N7O4= -cloud.google.com/go/container v1.28.0/go.mod h1:b1A1gJeTBXVLQ6GGw9/9M4FG94BEGsqJ5+t4d/3N7O4= -cloud.google.com/go/container v1.29.0/go.mod h1:b1A1gJeTBXVLQ6GGw9/9M4FG94BEGsqJ5+t4d/3N7O4= -cloud.google.com/go/container v1.30.1/go.mod h1:vkbfX0EnAKL/vgVECs5BZn24e1cJROzgszJirRKQ4Bg= -cloud.google.com/go/container v1.31.0/go.mod h1:7yABn5s3Iv3lmw7oMmyGbeV6tQj86njcTijkkGuvdZA= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= cloud.google.com/go/containeranalysis v0.7.0/go.mod h1:9aUL+/vZ55P2CXfuZjS4UjQ9AgXoSw8Ts6lemfmxBxI= -cloud.google.com/go/containeranalysis v0.9.0/go.mod h1:orbOANbwk5Ejoom+s+DUCTTJ7IBdBQJDcSylAx/on9s= -cloud.google.com/go/containeranalysis v0.10.1/go.mod h1:Ya2jiILITMY68ZLPaogjmOMNkwsDrWBSTyBubGXO7j0= -cloud.google.com/go/containeranalysis v0.11.0/go.mod h1:4n2e99ZwpGxpNcz+YsFT1dfOHPQFGcAC8FN2M2/ne/U= -cloud.google.com/go/containeranalysis v0.11.1/go.mod h1:rYlUOM7nem1OJMKwE1SadufX0JP3wnXj844EtZAwWLY= -cloud.google.com/go/containeranalysis v0.11.2/go.mod h1:xibioGBC1MD2j4reTyV1xY1/MvKaz+fyM9ENWhmIeP8= -cloud.google.com/go/containeranalysis v0.11.3/go.mod h1:kMeST7yWFQMGjiG9K7Eov+fPNQcGhb8mXj/UcTiWw9U= -cloud.google.com/go/containeranalysis v0.11.4/go.mod h1:cVZT7rXYBS9NG1rhQbWL9pWbXCKHWJPYraE8/FTSYPE= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= @@ -398,119 +176,39 @@ cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= cloud.google.com/go/datacatalog v1.8.1/go.mod h1:RJ58z4rMp3gvETA465Vg+ag8BGgBdnRPEMMSTr5Uv+M= cloud.google.com/go/datacatalog v1.12.0/go.mod h1:CWae8rFkfp6LzLumKOnmVh4+Zle4A3NXLzVJ1d1mRm0= -cloud.google.com/go/datacatalog v1.13.0/go.mod h1:E4Rj9a5ZtAxcQJlEBTLgMTphfP11/lNaAshpoBgemX8= -cloud.google.com/go/datacatalog v1.14.0/go.mod h1:h0PrGtlihoutNMp/uvwhawLQ9+c63Kz65UFqh49Yo+E= -cloud.google.com/go/datacatalog v1.14.1/go.mod h1:d2CevwTG4yedZilwe+v3E3ZBDRMobQfSG/a6cCCN5R4= -cloud.google.com/go/datacatalog v1.16.0/go.mod h1:d2CevwTG4yedZilwe+v3E3ZBDRMobQfSG/a6cCCN5R4= -cloud.google.com/go/datacatalog v1.17.1/go.mod h1:nCSYFHgtxh2MiEktWIz71s/X+7ds/UT9kp0PC7waCzE= -cloud.google.com/go/datacatalog v1.18.0/go.mod h1:nCSYFHgtxh2MiEktWIz71s/X+7ds/UT9kp0PC7waCzE= -cloud.google.com/go/datacatalog v1.18.1/go.mod h1:TzAWaz+ON1tkNr4MOcak8EBHX7wIRX/gZKM+yTVsv+A= -cloud.google.com/go/datacatalog v1.18.2/go.mod h1:SPVgWW2WEMuWHA+fHodYjmxPiMqcOiWfhc9OD5msigk= -cloud.google.com/go/datacatalog v1.18.3/go.mod h1:5FR6ZIF8RZrtml0VUao22FxhdjkoG+a0866rEnObryM= -cloud.google.com/go/datacatalog v1.19.0/go.mod h1:5FR6ZIF8RZrtml0VUao22FxhdjkoG+a0866rEnObryM= -cloud.google.com/go/datacatalog v1.19.2/go.mod h1:2YbODwmhpLM4lOFe3PuEhHK9EyTzQJ5AXgIy7EDKTEE= -cloud.google.com/go/datacatalog v1.19.3/go.mod h1:ra8V3UAsciBpJKQ+z9Whkxzxv7jmQg1hfODr3N3YPJ4= cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= cloud.google.com/go/dataflow v0.8.0/go.mod h1:Rcf5YgTKPtQyYz8bLYhFoIV/vP39eL7fWNcSOyFfLJE= -cloud.google.com/go/dataflow v0.9.1/go.mod h1:Wp7s32QjYuQDWqJPFFlnBKhkAtiFpMTdg00qGbnIHVw= -cloud.google.com/go/dataflow v0.9.2/go.mod h1:vBfdBZ/ejlTaYIGB3zB4T08UshH70vbtZeMD+urnUSo= -cloud.google.com/go/dataflow v0.9.3/go.mod h1:HI4kMVjcHGTs3jTHW/kv3501YW+eloiJSLxkJa/vqFE= -cloud.google.com/go/dataflow v0.9.4/go.mod h1:4G8vAkHYCSzU8b/kmsoR2lWyHJD85oMJPHMtan40K8w= -cloud.google.com/go/dataflow v0.9.5/go.mod h1:udl6oi8pfUHnL0z6UN9Lf9chGqzDMVqcYTcZ1aPnCZQ= cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= cloud.google.com/go/dataform v0.6.0/go.mod h1:QPflImQy33e29VuapFdf19oPbE4aYTJxr31OAPV+ulA= -cloud.google.com/go/dataform v0.7.0/go.mod h1:7NulqnVozfHvWUBpMDfKMUESr+85aJsC/2O0o3jWPDE= -cloud.google.com/go/dataform v0.8.1/go.mod h1:3BhPSiw8xmppbgzeBbmDvmSWlwouuJkXsXsb8UBih9M= -cloud.google.com/go/dataform v0.8.2/go.mod h1:X9RIqDs6NbGPLR80tnYoPNiO1w0wenKTb8PxxlhTMKM= -cloud.google.com/go/dataform v0.8.3/go.mod h1:8nI/tvv5Fso0drO3pEjtowz58lodx8MVkdV2q0aPlqg= -cloud.google.com/go/dataform v0.9.1/go.mod h1:pWTg+zGQ7i16pyn0bS1ruqIE91SdL2FDMvEYu/8oQxs= -cloud.google.com/go/dataform v0.9.2/go.mod h1:S8cQUwPNWXo7m/g3DhWHsLBoufRNn9EgFrMgne2j7cI= cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38= cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= cloud.google.com/go/datafusion v1.6.0/go.mod h1:WBsMF8F1RhSXvVM8rCV3AeyWVxcC2xY6vith3iw3S+8= -cloud.google.com/go/datafusion v1.7.1/go.mod h1:KpoTBbFmoToDExJUso/fcCiguGDk7MEzOWXUsJo0wsI= -cloud.google.com/go/datafusion v1.7.2/go.mod h1:62K2NEC6DRlpNmI43WHMWf9Vg/YvN6QVi8EVwifElI0= -cloud.google.com/go/datafusion v1.7.3/go.mod h1:eoLt1uFXKGBq48jy9LZ+Is8EAVLnmn50lNncLzwYokE= -cloud.google.com/go/datafusion v1.7.4/go.mod h1:BBs78WTOLYkT4GVZIXQCZT3GFpkpDN4aBY4NDX/jVlM= -cloud.google.com/go/datafusion v1.7.5/go.mod h1:bYH53Oa5UiqahfbNK9YuYKteeD4RbQSNMx7JF7peGHc= cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= cloud.google.com/go/datalabeling v0.7.0/go.mod h1:WPQb1y08RJbmpM3ww0CSUAGweL0SxByuW2E+FU+wXcM= -cloud.google.com/go/datalabeling v0.8.1/go.mod h1:XS62LBSVPbYR54GfYQsPXZjTW8UxCK2fkDciSrpRFdY= -cloud.google.com/go/datalabeling v0.8.2/go.mod h1:cyDvGHuJWu9U/cLDA7d8sb9a0tWLEletStu2sTmg3BE= -cloud.google.com/go/datalabeling v0.8.3/go.mod h1:tvPhpGyS/V7lqjmb3V0TaDdGvhzgR1JoW7G2bpi2UTI= -cloud.google.com/go/datalabeling v0.8.4/go.mod h1:Z1z3E6LHtffBGrNUkKwbwbDxTiXEApLzIgmymj8A3S8= -cloud.google.com/go/datalabeling v0.8.5/go.mod h1:IABB2lxQnkdUbMnQaOl2prCOfms20mcPxDBm36lps+s= cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA= cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= cloud.google.com/go/dataplex v1.5.2/go.mod h1:cVMgQHsmfRoI5KFYq4JtIBEUbYwc3c7tXmIDhRmNNVQ= -cloud.google.com/go/dataplex v1.6.0/go.mod h1:bMsomC/aEJOSpHXdFKFGQ1b0TDPIeL28nJObeO1ppRs= -cloud.google.com/go/dataplex v1.8.1/go.mod h1:7TyrDT6BCdI8/38Uvp0/ZxBslOslP2X2MPDucliyvSE= -cloud.google.com/go/dataplex v1.9.0/go.mod h1:7TyrDT6BCdI8/38Uvp0/ZxBslOslP2X2MPDucliyvSE= -cloud.google.com/go/dataplex v1.9.1/go.mod h1:7TyrDT6BCdI8/38Uvp0/ZxBslOslP2X2MPDucliyvSE= -cloud.google.com/go/dataplex v1.10.1/go.mod h1:1MzmBv8FvjYfc7vDdxhnLFNskikkB+3vl475/XdCDhs= -cloud.google.com/go/dataplex v1.10.2/go.mod h1:xdC8URdTrCrZMW6keY779ZT1cTOfV8KEPNsw+LTRT1Y= -cloud.google.com/go/dataplex v1.11.1/go.mod h1:mHJYQQ2VEJHsyoC0OdNyy988DvEbPhqFs5OOLffLX0c= -cloud.google.com/go/dataplex v1.11.2/go.mod h1:mHJYQQ2VEJHsyoC0OdNyy988DvEbPhqFs5OOLffLX0c= -cloud.google.com/go/dataplex v1.13.0/go.mod h1:mHJYQQ2VEJHsyoC0OdNyy988DvEbPhqFs5OOLffLX0c= -cloud.google.com/go/dataplex v1.14.0/go.mod h1:mHJYQQ2VEJHsyoC0OdNyy988DvEbPhqFs5OOLffLX0c= -cloud.google.com/go/dataplex v1.14.1/go.mod h1:bWxQAbg6Smg+sca2+Ex7s8D9a5qU6xfXtwmq4BVReps= -cloud.google.com/go/dataplex v1.14.2/go.mod h1:0oGOSFlEKef1cQeAHXy4GZPB/Ife0fz/PxBf+ZymA2U= cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s= cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= cloud.google.com/go/dataproc v1.12.0/go.mod h1:zrF3aX0uV3ikkMz6z4uBbIKyhRITnxvr4i3IjKsKrw4= -cloud.google.com/go/dataproc/v2 v2.0.1/go.mod h1:7Ez3KRHdFGcfY7GcevBbvozX+zyWGcwLJvvAMwCaoZ4= -cloud.google.com/go/dataproc/v2 v2.2.0/go.mod h1:lZR7AQtwZPvmINx5J87DSOOpTfof9LVZju6/Qo4lmcY= -cloud.google.com/go/dataproc/v2 v2.2.1/go.mod h1:QdAJLaBjh+l4PVlVZcmrmhGccosY/omC1qwfQ61Zv/o= -cloud.google.com/go/dataproc/v2 v2.2.2/go.mod h1:aocQywVmQVF4i8CL740rNI/ZRpsaaC1Wh2++BJ7HEJ4= -cloud.google.com/go/dataproc/v2 v2.2.3/go.mod h1:G5R6GBc9r36SXv/RtZIVfB8SipI+xVn0bX5SxUzVYbY= -cloud.google.com/go/dataproc/v2 v2.3.0/go.mod h1:G5R6GBc9r36SXv/RtZIVfB8SipI+xVn0bX5SxUzVYbY= -cloud.google.com/go/dataproc/v2 v2.4.0/go.mod h1:3B1Ht2aRB8VZIteGxQS/iNSJGzt9+CA0WGnDVMEm7Z4= cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= cloud.google.com/go/dataqna v0.7.0/go.mod h1:Lx9OcIIeqCrw1a6KdO3/5KMP1wAmTc0slZWwP12Qq3c= -cloud.google.com/go/dataqna v0.8.1/go.mod h1:zxZM0Bl6liMePWsHA8RMGAfmTG34vJMapbHAxQ5+WA8= -cloud.google.com/go/dataqna v0.8.2/go.mod h1:KNEqgx8TTmUipnQsScOoDpq/VlXVptUqVMZnt30WAPs= -cloud.google.com/go/dataqna v0.8.3/go.mod h1:wXNBW2uvc9e7Gl5k8adyAMnLush1KVV6lZUhB+rqNu4= -cloud.google.com/go/dataqna v0.8.4/go.mod h1:mySRKjKg5Lz784P6sCov3p1QD+RZQONRMRjzGNcFd0c= -cloud.google.com/go/dataqna v0.8.5/go.mod h1:vgihg1mz6n7pb5q2YJF7KlXve6tCglInd6XO0JGOlWM= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM= -cloud.google.com/go/datastore v1.11.0/go.mod h1:TvGxBIHCS50u8jzG+AW/ppf87v1of8nwzFNgEZU1D3c= -cloud.google.com/go/datastore v1.12.0/go.mod h1:KjdB88W897MRITkvWWJrg2OUtrR5XVj1EoLgSp6/N70= -cloud.google.com/go/datastore v1.12.1/go.mod h1:KjdB88W897MRITkvWWJrg2OUtrR5XVj1EoLgSp6/N70= -cloud.google.com/go/datastore v1.13.0/go.mod h1:KjdB88W897MRITkvWWJrg2OUtrR5XVj1EoLgSp6/N70= -cloud.google.com/go/datastore v1.14.0/go.mod h1:GAeStMBIt9bPS7jMJA85kgkpsMkvseWWXiaHya9Jes8= -cloud.google.com/go/datastore v1.15.0/go.mod h1:GAeStMBIt9bPS7jMJA85kgkpsMkvseWWXiaHya9Jes8= cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g= cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= cloud.google.com/go/datastream v1.6.0/go.mod h1:6LQSuswqLa7S4rPAOZFVjHIG3wJIjZcZrw8JDEDJuIs= -cloud.google.com/go/datastream v1.7.0/go.mod h1:uxVRMm2elUSPuh65IbZpzJNMbuzkcvu5CjMqVIUHrww= -cloud.google.com/go/datastream v1.9.1/go.mod h1:hqnmr8kdUBmrnk65k5wNRoHSCYksvpdZIcZIEl8h43Q= -cloud.google.com/go/datastream v1.10.0/go.mod h1:hqnmr8kdUBmrnk65k5wNRoHSCYksvpdZIcZIEl8h43Q= -cloud.google.com/go/datastream v1.10.1/go.mod h1:7ngSYwnw95YFyTd5tOGBxHlOZiL+OtpjheqU7t2/s/c= -cloud.google.com/go/datastream v1.10.2/go.mod h1:W42TFgKAs/om6x/CdXX5E4oiAsKlH+e8MTGy81zdYt0= -cloud.google.com/go/datastream v1.10.3/go.mod h1:YR0USzgjhqA/Id0Ycu1VvZe8hEWwrkjuXrGbzeDOSEA= -cloud.google.com/go/datastream v1.10.4/go.mod h1:7kRxPdxZxhPg3MFeCSulmAJnil8NJGGvSNdn4p1sRZo= cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c= cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= cloud.google.com/go/deploy v1.6.0/go.mod h1:f9PTHehG/DjCom3QH0cntOVRm93uGBDt2vKzAPwpXQI= -cloud.google.com/go/deploy v1.8.0/go.mod h1:z3myEJnA/2wnB4sgjqdMfgxCA0EqC3RBTNcVPs93mtQ= -cloud.google.com/go/deploy v1.11.0/go.mod h1:tKuSUV5pXbn67KiubiUNUejqLs4f5cxxiCNCeyl0F2g= -cloud.google.com/go/deploy v1.13.0/go.mod h1:tKuSUV5pXbn67KiubiUNUejqLs4f5cxxiCNCeyl0F2g= -cloud.google.com/go/deploy v1.13.1/go.mod h1:8jeadyLkH9qu9xgO3hVWw8jVr29N1mnW42gRJT8GY6g= -cloud.google.com/go/deploy v1.14.1/go.mod h1:N8S0b+aIHSEeSr5ORVoC0+/mOPUysVt8ae4QkZYolAw= -cloud.google.com/go/deploy v1.14.2/go.mod h1:e5XOUI5D+YGldyLNZ21wbp9S8otJbBE4i88PtO9x/2g= -cloud.google.com/go/deploy v1.15.0/go.mod h1:e5XOUI5D+YGldyLNZ21wbp9S8otJbBE4i88PtO9x/2g= -cloud.google.com/go/deploy v1.16.0/go.mod h1:e5XOUI5D+YGldyLNZ21wbp9S8otJbBE4i88PtO9x/2g= -cloud.google.com/go/deploy v1.17.0/go.mod h1:XBr42U5jIr64t92gcpOXxNrqL2PStQCXHuKK5GRUuYo= -cloud.google.com/go/deploy v1.17.1/go.mod h1:SXQyfsXrk0fBmgBHRzBjQbZhMfKZ3hMQBw5ym7MN/50= cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= @@ -518,160 +216,57 @@ cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= cloud.google.com/go/dialogflow v1.29.0/go.mod h1:b+2bzMe+k1s9V+F2jbJwpHPzrnIyHihAdRFMtn2WXuM= cloud.google.com/go/dialogflow v1.31.0/go.mod h1:cuoUccuL1Z+HADhyIA7dci3N5zUssgpBJmCzI6fNRB4= -cloud.google.com/go/dialogflow v1.32.0/go.mod h1:jG9TRJl8CKrDhMEcvfcfFkkpp8ZhgPz3sBGmAUYJ2qE= -cloud.google.com/go/dialogflow v1.38.0/go.mod h1:L7jnH+JL2mtmdChzAIcXQHXMvQkE3U4hTaNltEuxXn4= -cloud.google.com/go/dialogflow v1.40.0/go.mod h1:L7jnH+JL2mtmdChzAIcXQHXMvQkE3U4hTaNltEuxXn4= -cloud.google.com/go/dialogflow v1.43.0/go.mod h1:pDUJdi4elL0MFmt1REMvFkdsUTYSHq+rTCS8wg0S3+M= -cloud.google.com/go/dialogflow v1.44.0/go.mod h1:pDUJdi4elL0MFmt1REMvFkdsUTYSHq+rTCS8wg0S3+M= -cloud.google.com/go/dialogflow v1.44.1/go.mod h1:n/h+/N2ouKOO+rbe/ZnI186xImpqvCVj2DdsWS/0EAk= -cloud.google.com/go/dialogflow v1.44.2/go.mod h1:QzFYndeJhpVPElnFkUXxdlptx0wPnBWLCBT9BvtC3/c= -cloud.google.com/go/dialogflow v1.44.3/go.mod h1:mHly4vU7cPXVweuB5R0zsYKPMzy240aQdAu06SqBbAQ= -cloud.google.com/go/dialogflow v1.47.0/go.mod h1:mHly4vU7cPXVweuB5R0zsYKPMzy240aQdAu06SqBbAQ= -cloud.google.com/go/dialogflow v1.48.0/go.mod h1:mHly4vU7cPXVweuB5R0zsYKPMzy240aQdAu06SqBbAQ= -cloud.google.com/go/dialogflow v1.48.1/go.mod h1:C1sjs2/g9cEwjCltkKeYp3FFpz8BOzNondEaAlCpt+A= -cloud.google.com/go/dialogflow v1.48.2/go.mod h1:7A2oDf6JJ1/+hdpnFRfb/RjJUOh2X3rhIa5P8wQSEX4= -cloud.google.com/go/dialogflow v1.49.0/go.mod h1:dhVrXKETtdPlpPhE7+2/k4Z8FRNUp6kMV3EW3oz/fe0= cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM= cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= cloud.google.com/go/dlp v1.9.0/go.mod h1:qdgmqgTyReTz5/YNSSuueR8pl7hO0o9bQ39ZhtgkWp4= -cloud.google.com/go/dlp v1.10.1/go.mod h1:IM8BWz1iJd8njcNcG0+Kyd9OPnqnRNkDV8j42VT5KOI= -cloud.google.com/go/dlp v1.10.2/go.mod h1:ZbdKIhcnyhILgccwVDzkwqybthh7+MplGC3kZVZsIOQ= -cloud.google.com/go/dlp v1.10.3/go.mod h1:iUaTc/ln8I+QT6Ai5vmuwfw8fqTk2kaz0FvCwhLCom0= -cloud.google.com/go/dlp v1.11.1/go.mod h1:/PA2EnioBeXTL/0hInwgj0rfsQb3lpE3R8XUJxqUNKI= -cloud.google.com/go/dlp v1.11.2/go.mod h1:9Czi+8Y/FegpWzgSfkRlyz+jwW6Te9Rv26P3UfU/h/w= cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k= cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= cloud.google.com/go/documentai v1.16.0/go.mod h1:o0o0DLTEZ+YnJZ+J4wNfTxmDVyrkzFvttBXXtYRMHkM= -cloud.google.com/go/documentai v1.18.0/go.mod h1:F6CK6iUH8J81FehpskRmhLq/3VlwQvb7TvwOceQ2tbs= -cloud.google.com/go/documentai v1.20.0/go.mod h1:yJkInoMcK0qNAEdRnqY/D5asy73tnPe88I1YTZT+a8E= -cloud.google.com/go/documentai v1.22.0/go.mod h1:yJkInoMcK0qNAEdRnqY/D5asy73tnPe88I1YTZT+a8E= -cloud.google.com/go/documentai v1.22.1/go.mod h1:LKs22aDHbJv7ufXuPypzRO7rG3ALLJxzdCXDPutw4Qc= -cloud.google.com/go/documentai v1.23.0/go.mod h1:LKs22aDHbJv7ufXuPypzRO7rG3ALLJxzdCXDPutw4Qc= -cloud.google.com/go/documentai v1.23.2/go.mod h1:Q/wcRT+qnuXOpjAkvOV4A+IeQl04q2/ReT7SSbytLSo= -cloud.google.com/go/documentai v1.23.4/go.mod h1:4MYAaEMnADPN1LPN5xboDR5QVB6AgsaxgFdJhitlE2Y= -cloud.google.com/go/documentai v1.23.5/go.mod h1:ghzBsyVTiVdkfKaUCum/9bGBEyBjDO4GfooEcYKhN+g= -cloud.google.com/go/documentai v1.23.6/go.mod h1:ghzBsyVTiVdkfKaUCum/9bGBEyBjDO4GfooEcYKhN+g= -cloud.google.com/go/documentai v1.23.7/go.mod h1:ghzBsyVTiVdkfKaUCum/9bGBEyBjDO4GfooEcYKhN+g= -cloud.google.com/go/documentai v1.23.8/go.mod h1:Vd/y5PosxCpUHmwC+v9arZyeMfTqBR9VIwOwIqQYYfA= -cloud.google.com/go/documentai v1.25.0/go.mod h1:ftLnzw5VcXkLItp6pw1mFic91tMRyfv6hHEY5br4KzY= cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= cloud.google.com/go/domains v0.8.0/go.mod h1:M9i3MMDzGFXsydri9/vW+EWz9sWb4I6WyHqdlAk0idE= -cloud.google.com/go/domains v0.9.1/go.mod h1:aOp1c0MbejQQ2Pjf1iJvnVyT+z6R6s8pX66KaCSDYfE= -cloud.google.com/go/domains v0.9.2/go.mod h1:3YvXGYzZG1Temjbk7EyGCuGGiXHJwVNmwIf+E/cUp5I= -cloud.google.com/go/domains v0.9.3/go.mod h1:29k66YNDLDY9LCFKpGFeh6Nj9r62ZKm5EsUJxAl84KU= -cloud.google.com/go/domains v0.9.4/go.mod h1:27jmJGShuXYdUNjyDG0SodTfT5RwLi7xmH334Gvi3fY= -cloud.google.com/go/domains v0.9.5/go.mod h1:dBzlxgepazdFhvG7u23XMhmMKBjrkoUNaw0A8AQB55Y= cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= cloud.google.com/go/edgecontainer v0.3.0/go.mod h1:FLDpP4nykgwwIfcLt6zInhprzw0lEi2P1fjO6Ie0qbc= -cloud.google.com/go/edgecontainer v1.0.0/go.mod h1:cttArqZpBB2q58W/upSG++ooo6EsblxDIolxa3jSjbY= -cloud.google.com/go/edgecontainer v1.1.1/go.mod h1:O5bYcS//7MELQZs3+7mabRqoWQhXCzenBu0R8bz2rwk= -cloud.google.com/go/edgecontainer v1.1.2/go.mod h1:wQRjIzqxEs9e9wrtle4hQPSR1Y51kqN75dgF7UllZZ4= -cloud.google.com/go/edgecontainer v1.1.3/go.mod h1:Ll2DtIABzEfaxaVSbwj3QHFaOOovlDFiWVDu349jSsA= -cloud.google.com/go/edgecontainer v1.1.4/go.mod h1:AvFdVuZuVGdgaE5YvlL1faAoa1ndRR/5XhXZvPBHbsE= -cloud.google.com/go/edgecontainer v1.1.5/go.mod h1:rgcjrba3DEDEQAidT4yuzaKWTbkTI5zAMu3yy6ZWS0M= cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI= cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= cloud.google.com/go/essentialcontacts v1.5.0/go.mod h1:ay29Z4zODTuwliK7SnX8E86aUF2CTzdNtvv42niCX0M= -cloud.google.com/go/essentialcontacts v1.6.2/go.mod h1:T2tB6tX+TRak7i88Fb2N9Ok3PvY3UNbUsMag9/BARh4= -cloud.google.com/go/essentialcontacts v1.6.3/go.mod h1:yiPCD7f2TkP82oJEFXFTou8Jl8L6LBRPeBEkTaO0Ggo= -cloud.google.com/go/essentialcontacts v1.6.4/go.mod h1:iju5Vy3d9tJUg0PYMd1nHhjV7xoCXaOAVabrwLaPBEM= -cloud.google.com/go/essentialcontacts v1.6.5/go.mod h1:jjYbPzw0x+yglXC890l6ECJWdYeZ5dlYACTFL0U/VuM= -cloud.google.com/go/essentialcontacts v1.6.6/go.mod h1:XbqHJGaiH0v2UvtuucfOzFXN+rpL/aU5BCZLn4DYl1Q= cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc= cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= cloud.google.com/go/eventarc v1.10.0/go.mod h1:u3R35tmZ9HvswGRBnF48IlYgYeBcPUCjkr4BTdem2Kw= -cloud.google.com/go/eventarc v1.11.0/go.mod h1:PyUjsUKPWoRBCHeOxZd/lbOOjahV41icXyUY5kSTvVY= -cloud.google.com/go/eventarc v1.12.1/go.mod h1:mAFCW6lukH5+IZjkvrEss+jmt2kOdYlN8aMx3sRJiAI= -cloud.google.com/go/eventarc v1.13.0/go.mod h1:mAFCW6lukH5+IZjkvrEss+jmt2kOdYlN8aMx3sRJiAI= -cloud.google.com/go/eventarc v1.13.1/go.mod h1:EqBxmGHFrruIara4FUQ3RHlgfCn7yo1HYsu2Hpt/C3Y= -cloud.google.com/go/eventarc v1.13.2/go.mod h1:X9A80ShVu19fb4e5sc/OLV7mpFUKZMwfJFeeWhcIObM= -cloud.google.com/go/eventarc v1.13.3/go.mod h1:RWH10IAZIRcj1s/vClXkBgMHwh59ts7hSWcqD3kaclg= -cloud.google.com/go/eventarc v1.13.4/go.mod h1:zV5sFVoAa9orc/52Q+OuYUG9xL2IIZTbbuTHC6JSY8s= cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w= cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= cloud.google.com/go/filestore v1.5.0/go.mod h1:FqBXDWBp4YLHqRnVGveOkHDf8svj9r5+mUDLupOWEDs= -cloud.google.com/go/filestore v1.6.0/go.mod h1:di5unNuss/qfZTw2U9nhFqo8/ZDSc466dre85Kydllg= -cloud.google.com/go/filestore v1.7.1/go.mod h1:y10jsorq40JJnjR/lQ8AfFbbcGlw3g+Dp8oN7i7FjV4= -cloud.google.com/go/filestore v1.7.2/go.mod h1:TYOlyJs25f/omgj+vY7/tIG/E7BX369triSPzE4LdgE= -cloud.google.com/go/filestore v1.7.3/go.mod h1:Qp8WaEERR3cSkxToxFPHh/b8AACkSut+4qlCjAmKTV0= -cloud.google.com/go/filestore v1.7.4/go.mod h1:S5JCxIbFjeBhWMTfIYH2Jx24J6BqjwpkkPl+nBA5DlI= -cloud.google.com/go/filestore v1.8.0/go.mod h1:S5JCxIbFjeBhWMTfIYH2Jx24J6BqjwpkkPl+nBA5DlI= -cloud.google.com/go/filestore v1.8.1/go.mod h1:MbN9KcaM47DRTIuLfQhJEsjaocVebNtNQhSLhKCF5GM= cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= -cloud.google.com/go/firestore v1.11.0/go.mod h1:b38dKhgzlmNNGTNZZwe7ZRFEuRab1Hay3/DBsIGKKy4= -cloud.google.com/go/firestore v1.12.0/go.mod h1:b38dKhgzlmNNGTNZZwe7ZRFEuRab1Hay3/DBsIGKKy4= -cloud.google.com/go/firestore v1.13.0/go.mod h1:QojqqOh8IntInDUSTAh0c8ZsPYAr68Ma8c5DWOy8xb8= -cloud.google.com/go/firestore v1.14.0/go.mod h1:96MVaHLsEhbvkBEdZgfN+AS/GIkco1LRpH9Xp9YZfzQ= cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY= cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= cloud.google.com/go/functions v1.10.0/go.mod h1:0D3hEOe3DbEvCXtYOZHQZmD+SzYsi1YbI7dGvHfldXw= -cloud.google.com/go/functions v1.12.0/go.mod h1:AXWGrF3e2C/5ehvwYo/GH6O5s09tOPksiKhz+hH8WkA= -cloud.google.com/go/functions v1.13.0/go.mod h1:EU4O007sQm6Ef/PwRsI8N2umygGqPBS/IZQKBQBcJ3c= -cloud.google.com/go/functions v1.15.1/go.mod h1:P5yNWUTkyU+LvW/S9O6V+V423VZooALQlqoXdoPz5AE= -cloud.google.com/go/functions v1.15.2/go.mod h1:CHAjtcR6OU4XF2HuiVeriEdELNcnvRZSk1Q8RMqy4lE= -cloud.google.com/go/functions v1.15.3/go.mod h1:r/AMHwBheapkkySEhiZYLDBwVJCdlRwsm4ieJu35/Ug= -cloud.google.com/go/functions v1.15.4/go.mod h1:CAsTc3VlRMVvx+XqXxKqVevguqJpnVip4DdonFsX28I= -cloud.google.com/go/functions v1.16.0/go.mod h1:nbNpfAG7SG7Duw/o1iZ6ohvL7mc6MapWQVpqtM29n8k= cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w= cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= cloud.google.com/go/gaming v1.9.0/go.mod h1:Fc7kEmCObylSWLO334NcO+O9QMDyz+TKC4v1D7X+Bc0= -cloud.google.com/go/gaming v1.10.1/go.mod h1:XQQvtfP8Rb9Rxnxm5wFVpAp9zCQkJi2bLIb7iHGwB3s= cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60= cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= cloud.google.com/go/gkebackup v0.4.0/go.mod h1:byAyBGUwYGEEww7xsbnUTBHIYcOPy/PgUWUtOeRm9Vg= -cloud.google.com/go/gkebackup v1.3.0/go.mod h1:vUDOu++N0U5qs4IhG1pcOnD1Mac79xWy6GoBFlWCWBU= -cloud.google.com/go/gkebackup v1.3.1/go.mod h1:vUDOu++N0U5qs4IhG1pcOnD1Mac79xWy6GoBFlWCWBU= -cloud.google.com/go/gkebackup v1.3.2/go.mod h1:OMZbXzEJloyXMC7gqdSB+EOEQ1AKcpGYvO3s1ec5ixk= -cloud.google.com/go/gkebackup v1.3.3/go.mod h1:eMk7/wVV5P22KBakhQnJxWSVftL1p4VBFLpv0kIft7I= -cloud.google.com/go/gkebackup v1.3.4/go.mod h1:gLVlbM8h/nHIs09ns1qx3q3eaXcGSELgNu1DWXYz1HI= -cloud.google.com/go/gkebackup v1.3.5/go.mod h1:KJ77KkNN7Wm1LdMopOelV6OodM01pMuK2/5Zt1t4Tvc= cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= cloud.google.com/go/gkeconnect v0.7.0/go.mod h1:SNfmVqPkaEi3bF/B3CNZOAYPYdg7sU+obZ+QTky2Myw= -cloud.google.com/go/gkeconnect v0.8.1/go.mod h1:KWiK1g9sDLZqhxB2xEuPV8V9NYzrqTUmQR9shJHpOZw= -cloud.google.com/go/gkeconnect v0.8.2/go.mod h1:6nAVhwchBJYgQCXD2pHBFQNiJNyAd/wyxljpaa6ZPrY= -cloud.google.com/go/gkeconnect v0.8.3/go.mod h1:i9GDTrfzBSUZGCe98qSu1B8YB8qfapT57PenIb820Jo= -cloud.google.com/go/gkeconnect v0.8.4/go.mod h1:84hZz4UMlDCKl8ifVW8layK4WHlMAFeq8vbzjU0yJkw= -cloud.google.com/go/gkeconnect v0.8.5/go.mod h1:LC/rS7+CuJ5fgIbXv8tCD/mdfnlAadTaUufgOkmijuk= cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= cloud.google.com/go/gkehub v0.11.0/go.mod h1:JOWHlmN+GHyIbuWQPl47/C2RFhnFKH38jH9Ascu3n0E= -cloud.google.com/go/gkehub v0.12.0/go.mod h1:djiIwwzTTBrF5NaXCGv3mf7klpEMcST17VBTVVDcuaw= -cloud.google.com/go/gkehub v0.14.1/go.mod h1:VEXKIJZ2avzrbd7u+zeMtW00Y8ddk/4V9511C9CQGTY= -cloud.google.com/go/gkehub v0.14.2/go.mod h1:iyjYH23XzAxSdhrbmfoQdePnlMj2EWcvnR+tHdBQsCY= -cloud.google.com/go/gkehub v0.14.3/go.mod h1:jAl6WafkHHW18qgq7kqcrXYzN08hXeK/Va3utN8VKg8= -cloud.google.com/go/gkehub v0.14.4/go.mod h1:Xispfu2MqnnFt8rV/2/3o73SK1snL8s9dYJ9G2oQMfc= -cloud.google.com/go/gkehub v0.14.5/go.mod h1:6bzqxM+a+vEH/h8W8ec4OJl4r36laxTs3A/fMNHJ0wA= cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA= cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= cloud.google.com/go/gkemulticloud v0.5.0/go.mod h1:W0JDkiyi3Tqh0TJr//y19wyb1yf8llHVto2Htf2Ja3Y= -cloud.google.com/go/gkemulticloud v0.6.1/go.mod h1:kbZ3HKyTsiwqKX7Yw56+wUGwwNZViRnxWK2DVknXWfw= -cloud.google.com/go/gkemulticloud v1.0.0/go.mod h1:kbZ3HKyTsiwqKX7Yw56+wUGwwNZViRnxWK2DVknXWfw= -cloud.google.com/go/gkemulticloud v1.0.1/go.mod h1:AcrGoin6VLKT/fwZEYuqvVominLriQBCKmbjtnbMjG8= -cloud.google.com/go/gkemulticloud v1.0.2/go.mod h1:+ee5VXxKb3H1l4LZAcgWB/rvI16VTNTrInWxDjAGsGo= -cloud.google.com/go/gkemulticloud v1.0.3/go.mod h1:7NpJBN94U6DY1xHIbsDqB2+TFZUfjLUKLjUX8NGLor0= -cloud.google.com/go/gkemulticloud v1.1.0/go.mod h1:7NpJBN94U6DY1xHIbsDqB2+TFZUfjLUKLjUX8NGLor0= -cloud.google.com/go/gkemulticloud v1.1.1/go.mod h1:C+a4vcHlWeEIf45IB5FFR5XGjTeYhF83+AYIpTy4i2Q= cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= -cloud.google.com/go/grafeas v0.3.0/go.mod h1:P7hgN24EyONOTMyeJH6DxG4zD7fwiYa5Q6GUgyFSOU8= -cloud.google.com/go/grafeas v0.3.4/go.mod h1:A5m316hcG+AulafjAbPKXBO/+I5itU4LOdKO2R/uDIc= cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM= cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= cloud.google.com/go/gsuiteaddons v1.5.0/go.mod h1:TFCClYLd64Eaa12sFVmUyG62tk4mdIsI7pAnSXRkcFo= -cloud.google.com/go/gsuiteaddons v1.6.1/go.mod h1:CodrdOqRZcLp5WOwejHWYBjZvfY0kOphkAKpF/3qdZY= -cloud.google.com/go/gsuiteaddons v1.6.2/go.mod h1:K65m9XSgs8hTF3X9nNTPi8IQueljSdYo9F+Mi+s4MyU= -cloud.google.com/go/gsuiteaddons v1.6.3/go.mod h1:sCFJkZoMrLZT3JTb8uJqgKPNshH2tfXeCwTFRebTq48= -cloud.google.com/go/gsuiteaddons v1.6.4/go.mod h1:rxtstw7Fx22uLOXBpsvb9DUbC+fiXs7rF4U29KHM/pE= -cloud.google.com/go/gsuiteaddons v1.6.5/go.mod h1:Lo4P2IvO8uZ9W+RaC6s1JVxo42vgy+TX5a6hfBZ0ubs= cloud.google.com/go/iam v0.1.0/go.mod h1:vcUNEa0pEm0qRVpmWepWaFMIAI8/hjB9mO8rNCJtF6c= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= @@ -680,157 +275,57 @@ cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQE cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= cloud.google.com/go/iam v0.11.0/go.mod h1:9PiLDanza5D+oWFZiH1uG+RnRCfEGKoyl6yo4cgWZGY= cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= -cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= -cloud.google.com/go/iam v1.0.1/go.mod h1:yR3tmSL8BcZB4bxByRv2jkSIahVmCtfKZwLYGBalRE8= -cloud.google.com/go/iam v1.1.0/go.mod h1:nxdHjaKfCr7fNYx/HJMM8LgiMugmveWlkatear5gVyk= -cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= -cloud.google.com/go/iam v1.1.2/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= -cloud.google.com/go/iam v1.1.3/go.mod h1:3khUlaBXfPKKe7huYgEpDn6FtgRyMEqbkvBxrQyY5SE= -cloud.google.com/go/iam v1.1.4/go.mod h1:l/rg8l1AaA+VFMho/HYx2Vv6xinPSLMF8qfhRPIZ0L8= -cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= -cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= cloud.google.com/go/iam v1.1.13 h1:7zWBXG9ERbMLrzQBRhFliAV+kjcRToDTgQT3CTwYyv4= cloud.google.com/go/iam v1.1.13/go.mod h1:K8mY0uSXwEXS30KrnVb+j54LB/ntfZu1dr+4zFMNbus= cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= cloud.google.com/go/iap v1.6.0/go.mod h1:NSuvI9C/j7UdjGjIde7t7HBz+QTwBcapPE07+sSRcLk= -cloud.google.com/go/iap v1.7.0/go.mod h1:beqQx56T9O1G1yNPph+spKpNibDlYIiIixiqsQXxLIo= -cloud.google.com/go/iap v1.7.1/go.mod h1:WapEwPc7ZxGt2jFGB/C/bm+hP0Y6NXzOYGjpPnmMS74= -cloud.google.com/go/iap v1.8.1/go.mod h1:sJCbeqg3mvWLqjZNsI6dfAtbbV1DL2Rl7e1mTyXYREQ= -cloud.google.com/go/iap v1.9.0/go.mod h1:01OFxd1R+NFrg78S+hoPV5PxEzv22HXaNqUUlmNHFuY= -cloud.google.com/go/iap v1.9.1/go.mod h1:SIAkY7cGMLohLSdBR25BuIxO+I4fXJiL06IBL7cy/5Q= -cloud.google.com/go/iap v1.9.2/go.mod h1:GwDTOs047PPSnwRD0Us5FKf4WDRcVvHg1q9WVkKBhdI= -cloud.google.com/go/iap v1.9.3/go.mod h1:DTdutSZBqkkOm2HEOTBzhZxh2mwwxshfD/h3yofAiCw= -cloud.google.com/go/iap v1.9.4/go.mod h1:vO4mSq0xNf/Pu6E5paORLASBwEmphXEjgCFg7aeNu1w= cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= cloud.google.com/go/ids v1.3.0/go.mod h1:JBdTYwANikFKaDP6LtW5JAi4gubs57SVNQjemdt6xV4= -cloud.google.com/go/ids v1.4.1/go.mod h1:np41ed8YMU8zOgv53MMMoCntLTn2lF+SUzlM+O3u/jw= -cloud.google.com/go/ids v1.4.2/go.mod h1:3vw8DX6YddRu9BncxuzMyWn0g8+ooUjI2gslJ7FH3vk= -cloud.google.com/go/ids v1.4.3/go.mod h1:9CXPqI3GedjmkjbMWCUhMZ2P2N7TUMzAkVXYEH2orYU= -cloud.google.com/go/ids v1.4.4/go.mod h1:z+WUc2eEl6S/1aZWzwtVNWoSZslgzPxAboS0lZX0HjI= -cloud.google.com/go/ids v1.4.5/go.mod h1:p0ZnyzjMWxww6d2DvMGnFwCsSxDJM666Iir1bK1UuBo= cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs= cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= cloud.google.com/go/iot v1.5.0/go.mod h1:mpz5259PDl3XJthEmh9+ap0affn/MqNSP4My77Qql9o= -cloud.google.com/go/iot v1.6.0/go.mod h1:IqdAsmE2cTYYNO1Fvjfzo9po179rAtJeVGUvkLN3rLE= -cloud.google.com/go/iot v1.7.1/go.mod h1:46Mgw7ev1k9KqK1ao0ayW9h0lI+3hxeanz+L1zmbbbk= -cloud.google.com/go/iot v1.7.2/go.mod h1:q+0P5zr1wRFpw7/MOgDXrG/HVA+l+cSwdObffkrpnSg= -cloud.google.com/go/iot v1.7.3/go.mod h1:t8itFchkol4VgNbHnIq9lXoOOtHNR3uAACQMYbN9N4I= -cloud.google.com/go/iot v1.7.4/go.mod h1:3TWqDVvsddYBG++nHSZmluoCAVGr1hAcabbWZNKEZLk= -cloud.google.com/go/iot v1.7.5/go.mod h1:nq3/sqTz3HGaWJi1xNiX7F41ThOzpud67vwk0YsSsqs= cloud.google.com/go/kms v1.4.0/go.mod h1:fajBHndQ+6ubNw6Ss2sSd+SWvjL26RNo/dr7uxsnnOA= cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg= cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= -cloud.google.com/go/kms v1.8.0/go.mod h1:4xFEhYFqvW+4VMELtZyxomGSYtSQKzM178ylFW4jMAg= cloud.google.com/go/kms v1.9.0/go.mod h1:qb1tPTgfF9RQP8e1wq4cLFErVuTJv7UsSC915J8dh3w= -cloud.google.com/go/kms v1.10.0/go.mod h1:ng3KTUtQQU9bPX3+QGLsflZIHlkbn8amFAMY63m8d24= -cloud.google.com/go/kms v1.10.1/go.mod h1:rIWk/TryCkR59GMC3YtHtXeLzd634lBbKenvyySAyYI= -cloud.google.com/go/kms v1.11.0/go.mod h1:hwdiYC0xjnWsKQQCQQmIQnS9asjYVSK6jtXm+zFqXLM= -cloud.google.com/go/kms v1.12.1/go.mod h1:c9J991h5DTl+kg7gi3MYomh12YEENGrf48ee/N/2CDM= -cloud.google.com/go/kms v1.15.0/go.mod h1:c9J991h5DTl+kg7gi3MYomh12YEENGrf48ee/N/2CDM= -cloud.google.com/go/kms v1.15.2/go.mod h1:3hopT4+7ooWRCjc2DxgnpESFxhIraaI2IpAVUEhbT/w= -cloud.google.com/go/kms v1.15.3/go.mod h1:AJdXqHxS2GlPyduM99s9iGqi2nwbviBbhV/hdmt4iOQ= -cloud.google.com/go/kms v1.15.4/go.mod h1:L3Sdj6QTHK8dfwK5D1JLsAyELsNMnd3tAIwGS4ltKpc= -cloud.google.com/go/kms v1.15.5/go.mod h1:cU2H5jnp6G2TDpUGZyqTCoy1n16fbubHZjmVXSMtwDI= -cloud.google.com/go/kms v1.15.6/go.mod h1:yF75jttnIdHfGBoE51AKsD/Yqf+/jICzB9v1s1acsms= -cloud.google.com/go/kms v1.15.7/go.mod h1:ub54lbsa6tDkUwnu4W7Yt1aAIFLnspgh0kPGToDukeI= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE= cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= cloud.google.com/go/language v1.9.0/go.mod h1:Ns15WooPM5Ad/5no/0n81yUetis74g3zrbeJBE+ptUY= -cloud.google.com/go/language v1.10.1/go.mod h1:CPp94nsdVNiQEt1CNjF5WkTcisLiHPyIbMhvR8H2AW0= -cloud.google.com/go/language v1.11.0/go.mod h1:uDx+pFDdAKTY8ehpWbiXyQdz8tDSYLJbQcXsCkjYyvQ= -cloud.google.com/go/language v1.11.1/go.mod h1:Xyid9MG9WOX3utvDbpX7j3tXDmmDooMyMDqgUVpH17U= -cloud.google.com/go/language v1.12.1/go.mod h1:zQhalE2QlQIxbKIZt54IASBzmZpN/aDASea5zl1l+J4= -cloud.google.com/go/language v1.12.2/go.mod h1:9idWapzr/JKXBBQ4lWqVX/hcadxB194ry20m/bTrhWc= -cloud.google.com/go/language v1.12.3/go.mod h1:evFX9wECX6mksEva8RbRnr/4wi/vKGYnAJrTRXU8+f8= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= cloud.google.com/go/lifesciences v0.8.0/go.mod h1:lFxiEOMqII6XggGbOnKiyZ7IBwoIqA84ClvoezaA/bo= -cloud.google.com/go/lifesciences v0.9.1/go.mod h1:hACAOd1fFbCGLr/+weUKRAJas82Y4vrL3O5326N//Wc= -cloud.google.com/go/lifesciences v0.9.2/go.mod h1:QHEOO4tDzcSAzeJg7s2qwnLM2ji8IRpQl4p6m5Z9yTA= -cloud.google.com/go/lifesciences v0.9.3/go.mod h1:gNGBOJV80IWZdkd+xz4GQj4mbqaz737SCLHn2aRhQKM= -cloud.google.com/go/lifesciences v0.9.4/go.mod h1:bhm64duKhMi7s9jR9WYJYvjAFJwRqNj+Nia7hF0Z7JA= -cloud.google.com/go/lifesciences v0.9.5/go.mod h1:OdBm0n7C0Osh5yZB7j9BXyrMnTRGBJIZonUMxo5CzPw= cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= cloud.google.com/go/logging v1.7.0/go.mod h1:3xjP2CjkM3ZkO73aj4ASA5wRPGGCRrPIAeNqVNkzY8M= -cloud.google.com/go/logging v1.8.1/go.mod h1:TJjR+SimHwuC8MZ9cjByQulAMgni+RkXeI3wwctHJEI= -cloud.google.com/go/logging v1.9.0/go.mod h1:1Io0vnZv4onoUnsVUQY3HZ3Igb1nBchky0A0y7BBBhE= cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo= -cloud.google.com/go/longrunning v0.4.2/go.mod h1:OHrnaYyLUV6oqwh0xiS7e5sLQhP1m0QU9R+WhGDMgIQ= -cloud.google.com/go/longrunning v0.5.0/go.mod h1:0JNuqRShmscVAhIACGtskSAWtqtOoPkwP0YF1oVEchc= -cloud.google.com/go/longrunning v0.5.1/go.mod h1:spvimkwdz6SPWKEt/XBij79E9fiTkHSQl/fRUUQJYJc= -cloud.google.com/go/longrunning v0.5.2/go.mod h1:nqo6DQbNV2pXhGDbDMoN2bWz68MjZUzqv2YttZiveCs= -cloud.google.com/go/longrunning v0.5.3/go.mod h1:y/0ga59EYu58J6SHmmQOvekvND2qODbu8ywBBW7EK7Y= -cloud.google.com/go/longrunning v0.5.4/go.mod h1:zqNVncI0BOP8ST6XQD1+VcvuShMmq7+xFSzOL++V0dI= -cloud.google.com/go/longrunning v0.5.5/go.mod h1:WV2LAxD8/rg5Z1cNW6FJ/ZpX4E4VnDnoTk0yawPBB7s= cloud.google.com/go/longrunning v0.5.12 h1:5LqSIdERr71CqfUsFlJdBpOkBH8FBCFD7P1nTWy3TYE= cloud.google.com/go/longrunning v0.5.12/go.mod h1:S5hMV8CDJ6r50t2ubVJSKQVv5u0rmik5//KgLO3k4lU= cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= cloud.google.com/go/managedidentities v1.5.0/go.mod h1:+dWcZ0JlUmpuxpIDfyP5pP5y0bLdRwOS4Lp7gMni/LA= -cloud.google.com/go/managedidentities v1.6.1/go.mod h1:h/irGhTN2SkZ64F43tfGPMbHnypMbu4RB3yl8YcuEak= -cloud.google.com/go/managedidentities v1.6.2/go.mod h1:5c2VG66eCa0WIq6IylRk3TBW83l161zkFvCj28X7jn8= -cloud.google.com/go/managedidentities v1.6.3/go.mod h1:tewiat9WLyFN0Fi7q1fDD5+0N4VUoL0SCX0OTCthZq4= -cloud.google.com/go/managedidentities v1.6.4/go.mod h1:WgyaECfHmF00t/1Uk8Oun3CQ2PGUtjc3e9Alh79wyiM= -cloud.google.com/go/managedidentities v1.6.5/go.mod h1:fkFI2PwwyRQbjLxlm5bQ8SjtObFMW3ChBGNqaMcgZjI= cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= cloud.google.com/go/maps v0.6.0/go.mod h1:o6DAMMfb+aINHz/p/jbcY+mYeXBoZoxTfdSQ8VAJaCw= -cloud.google.com/go/maps v0.7.0/go.mod h1:3GnvVl3cqeSvgMcpRlQidXsPYuDGQ8naBis7MVzpXsY= -cloud.google.com/go/maps v1.3.0/go.mod h1:6mWTUv+WhnOwAgjVsSW2QPPECmW+s3PcRyOa9vgG/5s= -cloud.google.com/go/maps v1.4.0/go.mod h1:6mWTUv+WhnOwAgjVsSW2QPPECmW+s3PcRyOa9vgG/5s= -cloud.google.com/go/maps v1.4.1/go.mod h1:BxSa0BnW1g2U2gNdbq5zikLlHUuHW0GFWh7sgML2kIY= -cloud.google.com/go/maps v1.5.1/go.mod h1:NPMZw1LJwQZYCfz4y+EIw+SI+24A4bpdFJqdKVr0lt4= -cloud.google.com/go/maps v1.6.1/go.mod h1:4+buOHhYXFBp58Zj/K+Lc1rCmJssxxF4pJ5CJnhdz18= -cloud.google.com/go/maps v1.6.2/go.mod h1:4+buOHhYXFBp58Zj/K+Lc1rCmJssxxF4pJ5CJnhdz18= -cloud.google.com/go/maps v1.6.3/go.mod h1:VGAn809ADswi1ASofL5lveOHPnE6Rk/SFTTBx1yuOLw= -cloud.google.com/go/maps v1.6.4/go.mod h1:rhjqRy8NWmDJ53saCfsXQ0LKwBHfi6OSh5wkq6BaMhI= cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= cloud.google.com/go/mediatranslation v0.7.0/go.mod h1:LCnB/gZr90ONOIQLgSXagp8XUW1ODs2UmUMvcgMfI2I= -cloud.google.com/go/mediatranslation v0.8.1/go.mod h1:L/7hBdEYbYHQJhX2sldtTO5SZZ1C1vkapubj0T2aGig= -cloud.google.com/go/mediatranslation v0.8.2/go.mod h1:c9pUaDRLkgHRx3irYE5ZC8tfXGrMYwNZdmDqKMSfFp8= -cloud.google.com/go/mediatranslation v0.8.3/go.mod h1:F9OnXTy336rteOEywtY7FOqCk+J43o2RF638hkOQl4Y= -cloud.google.com/go/mediatranslation v0.8.4/go.mod h1:9WstgtNVAdN53m6TQa5GjIjLqKQPXe74hwSCxUP6nj4= -cloud.google.com/go/mediatranslation v0.8.5/go.mod h1:y7kTHYIPCIfgyLbKncgqouXJtLsU+26hZhHEEy80fSs= cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA= cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= cloud.google.com/go/memcache v1.9.0/go.mod h1:8oEyzXCu+zo9RzlEaEjHl4KkgjlNDaXbCQeQWlzNFJM= -cloud.google.com/go/memcache v1.10.1/go.mod h1:47YRQIarv4I3QS5+hoETgKO40InqzLP6kpNLvyXuyaA= -cloud.google.com/go/memcache v1.10.2/go.mod h1:f9ZzJHLBrmd4BkguIAa/l/Vle6uTHzHokdnzSWOdQ6A= -cloud.google.com/go/memcache v1.10.3/go.mod h1:6z89A41MT2DVAW0P4iIRdu5cmRTsbsFn4cyiIx8gbwo= -cloud.google.com/go/memcache v1.10.4/go.mod h1:v/d8PuC8d1gD6Yn5+I3INzLR01IDn0N4Ym56RgikSI0= -cloud.google.com/go/memcache v1.10.5/go.mod h1:/FcblbNd0FdMsx4natdj+2GWzTq+cjZvMa1I+9QsuMA= cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8= cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= cloud.google.com/go/metastore v1.10.0/go.mod h1:fPEnH3g4JJAk+gMRnrAnoqyv2lpUCqJPWOodSaf45Eo= -cloud.google.com/go/metastore v1.11.1/go.mod h1:uZuSo80U3Wd4zi6C22ZZliOUJ3XeM/MlYi/z5OAOWRA= -cloud.google.com/go/metastore v1.12.0/go.mod h1:uZuSo80U3Wd4zi6C22ZZliOUJ3XeM/MlYi/z5OAOWRA= -cloud.google.com/go/metastore v1.13.0/go.mod h1:URDhpG6XLeh5K+Glq0NOt74OfrPKTwS62gEPZzb5SOk= -cloud.google.com/go/metastore v1.13.1/go.mod h1:IbF62JLxuZmhItCppcIfzBBfUFq0DIB9HPDoLgWrVOU= -cloud.google.com/go/metastore v1.13.2/go.mod h1:KS59dD+unBji/kFebVp8XU/quNSyo8b6N6tPGspKszA= -cloud.google.com/go/metastore v1.13.3/go.mod h1:K+wdjXdtkdk7AQg4+sXS8bRrQa9gcOr+foOMF2tqINE= -cloud.google.com/go/metastore v1.13.4/go.mod h1:FMv9bvPInEfX9Ac1cVcRXp8EBBQnBcqH6gz3KvJ9BAE= cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk= cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= cloud.google.com/go/monitoring v1.12.0/go.mod h1:yx8Jj2fZNEkL/GYZyTLS4ZtZEZN8WtDEiEqG4kLK50w= -cloud.google.com/go/monitoring v1.13.0/go.mod h1:k2yMBAB1H9JT/QETjNkgdCGD9bPF712XiLTVr+cBrpw= -cloud.google.com/go/monitoring v1.15.1/go.mod h1:lADlSAlFdbqQuwwpaImhsJXu1QSdd3ojypXrFSMr2rM= -cloud.google.com/go/monitoring v1.16.0/go.mod h1:Ptp15HgAyM1fNICAojDMoNc/wUmn67mLHQfyqbw+poY= -cloud.google.com/go/monitoring v1.16.1/go.mod h1:6HsxddR+3y9j+o/cMJH6q/KJ/CBTvM/38L/1m7bTRJ4= -cloud.google.com/go/monitoring v1.16.2/go.mod h1:B44KGwi4ZCF8Rk/5n+FWeispDXoKSk9oss2QNlXJBgc= -cloud.google.com/go/monitoring v1.16.3/go.mod h1:KwSsX5+8PnXv5NJnICZzW2R8pWTis8ypC4zmdRD63Tw= -cloud.google.com/go/monitoring v1.17.0/go.mod h1:KwSsX5+8PnXv5NJnICZzW2R8pWTis8ypC4zmdRD63Tw= -cloud.google.com/go/monitoring v1.17.1/go.mod h1:SJzPMakCF0GHOuKEH/r4hxVKF04zl+cRPQyc3d/fqII= -cloud.google.com/go/monitoring v1.18.0/go.mod h1:c92vVBCeq/OB4Ioyo+NbN2U7tlg5ZH41PZcdvfc+Lcg= cloud.google.com/go/monitoring v1.20.4 h1:zwcViK7mT9SV0kzKqLOI3spRadvsmvw/R9z1MHNeC0E= cloud.google.com/go/monitoring v1.20.4/go.mod h1:v7F/UcLRw15EX7xq565N7Ae5tnYEE28+Cl717aTXG4c= cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= @@ -838,122 +333,45 @@ cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyF cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM= cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= cloud.google.com/go/networkconnectivity v1.10.0/go.mod h1:UP4O4sWXJG13AqrTdQCD9TnLGEbtNRqjuaaA7bNjF5E= -cloud.google.com/go/networkconnectivity v1.11.0/go.mod h1:iWmDD4QF16VCDLXUqvyspJjIEtBR/4zq5hwnY2X3scM= -cloud.google.com/go/networkconnectivity v1.12.1/go.mod h1:PelxSWYM7Sh9/guf8CFhi6vIqf19Ir/sbfZRUwXh92E= -cloud.google.com/go/networkconnectivity v1.13.0/go.mod h1:SAnGPes88pl7QRLUen2HmcBSE9AowVAcdug8c0RSBFk= -cloud.google.com/go/networkconnectivity v1.14.0/go.mod h1:SAnGPes88pl7QRLUen2HmcBSE9AowVAcdug8c0RSBFk= -cloud.google.com/go/networkconnectivity v1.14.1/go.mod h1:LyGPXR742uQcDxZ/wv4EI0Vu5N6NKJ77ZYVnDe69Zug= -cloud.google.com/go/networkconnectivity v1.14.2/go.mod h1:5UFlwIisZylSkGG1AdwK/WZUaoz12PKu6wODwIbFzJo= -cloud.google.com/go/networkconnectivity v1.14.3/go.mod h1:4aoeFdrJpYEXNvrnfyD5kIzs8YtHg945Og4koAjHQek= -cloud.google.com/go/networkconnectivity v1.14.4/go.mod h1:PU12q++/IMnDJAB+3r+tJtuCXCfwfN+C6Niyj6ji1Po= cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8= cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= cloud.google.com/go/networkmanagement v1.6.0/go.mod h1:5pKPqyXjB/sgtvB5xqOemumoQNB7y95Q7S+4rjSOPYY= -cloud.google.com/go/networkmanagement v1.8.0/go.mod h1:Ho/BUGmtyEqrttTgWEe7m+8vDdK74ibQc+Be0q7Fof0= -cloud.google.com/go/networkmanagement v1.9.0/go.mod h1:UTUaEU9YwbCAhhz3jEOHr+2/K/MrBk2XxOLS89LQzFw= -cloud.google.com/go/networkmanagement v1.9.1/go.mod h1:CCSYgrQQvW73EJawO2QamemYcOb57LvrDdDU51F0mcI= -cloud.google.com/go/networkmanagement v1.9.2/go.mod h1:iDGvGzAoYRghhp4j2Cji7sF899GnfGQcQRQwgVOWnDw= -cloud.google.com/go/networkmanagement v1.9.3/go.mod h1:y7WMO1bRLaP5h3Obm4tey+NquUvB93Co1oh4wpL+XcU= -cloud.google.com/go/networkmanagement v1.9.4/go.mod h1:daWJAl0KTFytFL7ar33I6R/oNBH8eEOX/rBNHrC/8TA= cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= cloud.google.com/go/networksecurity v0.7.0/go.mod h1:mAnzoxx/8TBSyXEeESMy9OOYwo1v+gZ5eMRnsT5bC8k= -cloud.google.com/go/networksecurity v0.8.0/go.mod h1:B78DkqsxFG5zRSVuwYFRZ9Xz8IcQ5iECsNrPn74hKHU= -cloud.google.com/go/networksecurity v0.9.1/go.mod h1:MCMdxOKQ30wsBI1eI659f9kEp4wuuAueoC9AJKSPWZQ= -cloud.google.com/go/networksecurity v0.9.2/go.mod h1:jG0SeAttWzPMUILEHDUvFYdQTl8L/E/KC8iZDj85lEI= -cloud.google.com/go/networksecurity v0.9.3/go.mod h1:l+C0ynM6P+KV9YjOnx+kk5IZqMSLccdBqW6GUoF4p/0= -cloud.google.com/go/networksecurity v0.9.4/go.mod h1:E9CeMZ2zDsNBkr8axKSYm8XyTqNhiCHf1JO/Vb8mD1w= -cloud.google.com/go/networksecurity v0.9.5/go.mod h1:KNkjH/RsylSGyyZ8wXpue8xpCEK+bTtvof8SBfIhMG8= cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA= cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= cloud.google.com/go/notebooks v1.7.0/go.mod h1:PVlaDGfJgj1fl1S3dUwhFMXFgfYGhYQt2164xOMONmE= -cloud.google.com/go/notebooks v1.8.0/go.mod h1:Lq6dYKOYOWUCTvw5t2q1gp1lAp0zxAxRycayS0iJcqQ= -cloud.google.com/go/notebooks v1.9.1/go.mod h1:zqG9/gk05JrzgBt4ghLzEepPHNwE5jgPcHZRKhlC1A8= -cloud.google.com/go/notebooks v1.10.0/go.mod h1:SOPYMZnttHxqot0SGSFSkRrwE29eqnKPBJFqgWmiK2k= -cloud.google.com/go/notebooks v1.10.1/go.mod h1:5PdJc2SgAybE76kFQCWrTfJolCOUQXF97e+gteUUA6A= -cloud.google.com/go/notebooks v1.11.1/go.mod h1:V2Zkv8wX9kDCGRJqYoI+bQAaoVeE5kSiz4yYHd2yJwQ= -cloud.google.com/go/notebooks v1.11.2/go.mod h1:z0tlHI/lREXC8BS2mIsUeR3agM1AkgLiS+Isov3SS70= -cloud.google.com/go/notebooks v1.11.3/go.mod h1:0wQyI2dQC3AZyQqWnRsp+yA+kY4gC7ZIVP4Qg3AQcgo= cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4= cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= cloud.google.com/go/optimization v1.3.1/go.mod h1:IvUSefKiwd1a5p0RgHDbWCIbDFgKuEdB+fPPuP0IDLI= -cloud.google.com/go/optimization v1.4.1/go.mod h1:j64vZQP7h9bO49m2rVaTVoNM0vEBEN5eKPUPbZyXOrk= -cloud.google.com/go/optimization v1.5.0/go.mod h1:evo1OvTxeBRBu6ydPlrIRizKY/LJKo/drDMMRKqGEUU= -cloud.google.com/go/optimization v1.5.1/go.mod h1:NC0gnUD5MWVAF7XLdoYVPmYYVth93Q6BUzqAq3ZwtV8= -cloud.google.com/go/optimization v1.6.1/go.mod h1:hH2RYPTTM9e9zOiTaYPTiGPcGdNZVnBSBxjIAJzUkqo= -cloud.google.com/go/optimization v1.6.2/go.mod h1:mWNZ7B9/EyMCcwNl1frUGEuY6CPijSkz88Fz2vwKPOY= -cloud.google.com/go/optimization v1.6.3/go.mod h1:8ve3svp3W6NFcAEFr4SfJxrldzhUl4VMUJmhrqVKtYA= cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA= cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= cloud.google.com/go/orchestration v1.6.0/go.mod h1:M62Bevp7pkxStDfFfTuCOaXgaaqRAga1yKyoMtEoWPQ= -cloud.google.com/go/orchestration v1.8.1/go.mod h1:4sluRF3wgbYVRqz7zJ1/EUNc90TTprliq9477fGobD8= -cloud.google.com/go/orchestration v1.8.2/go.mod h1:T1cP+6WyTmh6LSZzeUhvGf0uZVmJyTx7t8z7Vg87+A0= -cloud.google.com/go/orchestration v1.8.3/go.mod h1:xhgWAYqlbYjlz2ftbFghdyqENYW+JXuhBx9KsjMoGHs= -cloud.google.com/go/orchestration v1.8.4/go.mod h1:d0lywZSVYtIoSZXb0iFjv9SaL13PGyVOKDxqGxEf/qI= -cloud.google.com/go/orchestration v1.8.5/go.mod h1:C1J7HesE96Ba8/hZ71ISTV2UAat0bwN+pi85ky38Yq8= cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE= cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= cloud.google.com/go/orgpolicy v1.10.0/go.mod h1:w1fo8b7rRqlXlIJbVhOMPrwVljyuW5mqssvBtU18ONc= -cloud.google.com/go/orgpolicy v1.11.0/go.mod h1:2RK748+FtVvnfuynxBzdnyu7sygtoZa1za/0ZfpOs1M= -cloud.google.com/go/orgpolicy v1.11.1/go.mod h1:8+E3jQcpZJQliP+zaFfayC2Pg5bmhuLK755wKhIIUCE= -cloud.google.com/go/orgpolicy v1.11.2/go.mod h1:biRDpNwfyytYnmCRWZWxrKF22Nkz9eNVj9zyaBdpm1o= -cloud.google.com/go/orgpolicy v1.11.3/go.mod h1:oKAtJ/gkMjum5icv2aujkP4CxROxPXsBbYGCDbPO8MM= -cloud.google.com/go/orgpolicy v1.11.4/go.mod h1:0+aNV/nrfoTQ4Mytv+Aw+stBDBjNf4d8fYRA9herfJI= -cloud.google.com/go/orgpolicy v1.12.0/go.mod h1:0+aNV/nrfoTQ4Mytv+Aw+stBDBjNf4d8fYRA9herfJI= -cloud.google.com/go/orgpolicy v1.12.1/go.mod h1:aibX78RDl5pcK3jA8ysDQCFkVxLj3aOQqrbBaUL2V5I= cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo= cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= cloud.google.com/go/osconfig v1.11.0/go.mod h1:aDICxrur2ogRd9zY5ytBLV89KEgT2MKB2L/n6x1ooPw= -cloud.google.com/go/osconfig v1.12.0/go.mod h1:8f/PaYzoS3JMVfdfTubkowZYGmAhUCjjwnjqWI7NVBc= -cloud.google.com/go/osconfig v1.12.1/go.mod h1:4CjBxND0gswz2gfYRCUoUzCm9zCABp91EeTtWXyz0tE= -cloud.google.com/go/osconfig v1.12.2/go.mod h1:eh9GPaMZpI6mEJEuhEjUJmaxvQ3gav+fFEJon1Y8Iw0= -cloud.google.com/go/osconfig v1.12.3/go.mod h1:L/fPS8LL6bEYUi1au832WtMnPeQNT94Zo3FwwV1/xGM= -cloud.google.com/go/osconfig v1.12.4/go.mod h1:B1qEwJ/jzqSRslvdOCI8Kdnp0gSng0xW4LOnIebQomA= -cloud.google.com/go/osconfig v1.12.5/go.mod h1:D9QFdxzfjgw3h/+ZaAb5NypM8bhOMqBzgmbhzWViiW8= cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70= cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= cloud.google.com/go/oslogin v1.9.0/go.mod h1:HNavntnH8nzrn8JCTT5fj18FuJLFJc4NaZJtBnQtKFs= -cloud.google.com/go/oslogin v1.10.1/go.mod h1:x692z7yAue5nE7CsSnoG0aaMbNoRJRXO4sn73R+ZqAs= -cloud.google.com/go/oslogin v1.11.0/go.mod h1:8GMTJs4X2nOAUVJiPGqIWVcDaF0eniEto3xlOxaboXE= -cloud.google.com/go/oslogin v1.11.1/go.mod h1:OhD2icArCVNUxKqtK0mcSmKL7lgr0LVlQz+v9s1ujTg= -cloud.google.com/go/oslogin v1.12.1/go.mod h1:VfwTeFJGbnakxAY236eN8fsnglLiVXndlbcNomY4iZU= -cloud.google.com/go/oslogin v1.12.2/go.mod h1:CQ3V8Jvw4Qo4WRhNPF0o+HAM4DiLuE27Ul9CX9g2QdY= -cloud.google.com/go/oslogin v1.13.0/go.mod h1:xPJqLwpTZ90LSE5IL1/svko+6c5avZLluiyylMb/sRA= -cloud.google.com/go/oslogin v1.13.1/go.mod h1:vS8Sr/jR7QvPWpCjNqy6LYZr5Zs1e8ZGW/KPn9gmhws= cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= cloud.google.com/go/phishingprotection v0.7.0/go.mod h1:8qJI4QKHoda/sb/7/YmMQ2omRLSLYSu9bU0EKCNI+Lk= -cloud.google.com/go/phishingprotection v0.8.1/go.mod h1:AxonW7GovcA8qdEk13NfHq9hNx5KPtfxXNeUxTDxB6I= -cloud.google.com/go/phishingprotection v0.8.2/go.mod h1:LhJ91uyVHEYKSKcMGhOa14zMMWfbEdxG032oT6ECbC8= -cloud.google.com/go/phishingprotection v0.8.3/go.mod h1:3B01yO7T2Ra/TMojifn8EoGd4G9jts/6cIO0DgDY9J8= -cloud.google.com/go/phishingprotection v0.8.4/go.mod h1:6b3kNPAc2AQ6jZfFHioZKg9MQNybDg4ixFd4RPZZ2nE= -cloud.google.com/go/phishingprotection v0.8.5/go.mod h1:g1smd68F7mF1hgQPuYn3z8HDbNre8L6Z0b7XMYFmX7I= cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg= cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= cloud.google.com/go/policytroubleshooter v1.5.0/go.mod h1:Rz1WfV+1oIpPdN2VvvuboLVRsB1Hclg3CKQ53j9l8vw= -cloud.google.com/go/policytroubleshooter v1.6.0/go.mod h1:zYqaPTsmfvpjm5ULxAyD/lINQxJ0DDsnWOP/GZ7xzBc= -cloud.google.com/go/policytroubleshooter v1.7.1/go.mod h1:0NaT5v3Ag1M7U5r0GfDCpUFkWd9YqpubBWsQlhanRv0= -cloud.google.com/go/policytroubleshooter v1.8.0/go.mod h1:tmn5Ir5EToWe384EuboTcVQT7nTag2+DuH3uHmKd1HU= -cloud.google.com/go/policytroubleshooter v1.9.0/go.mod h1:+E2Lga7TycpeSTj2FsH4oXxTnrbHJGRlKhVZBLGgU64= -cloud.google.com/go/policytroubleshooter v1.9.1/go.mod h1:MYI8i0bCrL8cW+VHN1PoiBTyNZTstCg2WUw2eVC4c4U= -cloud.google.com/go/policytroubleshooter v1.10.1/go.mod h1:5C0rhT3TDZVxAu8813bwmTvd57Phbl8mr9F4ipOsxEs= -cloud.google.com/go/policytroubleshooter v1.10.2/go.mod h1:m4uF3f6LseVEnMV6nknlN2vYGRb+75ylQwJdnOXfnv0= -cloud.google.com/go/policytroubleshooter v1.10.3/go.mod h1:+ZqG3agHT7WPb4EBIRqUv4OyIwRTZvsVDHZ8GlZaoxk= cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= cloud.google.com/go/privatecatalog v0.7.0/go.mod h1:2s5ssIFO69F5csTXcwBP7NPFTZvps26xGzvQ2PQaBYg= -cloud.google.com/go/privatecatalog v0.8.0/go.mod h1:nQ6pfaegeDAq/Q5lrfCQzQLhubPiZhSaNhIgfJlnIXs= -cloud.google.com/go/privatecatalog v0.9.1/go.mod h1:0XlDXW2unJXdf9zFz968Hp35gl/bhF4twwpXZAW50JA= -cloud.google.com/go/privatecatalog v0.9.2/go.mod h1:RMA4ATa8IXfzvjrhhK8J6H4wwcztab+oZph3c6WmtFc= -cloud.google.com/go/privatecatalog v0.9.3/go.mod h1:K5pn2GrVmOPjXz3T26mzwXLcKivfIJ9R5N79AFCF9UE= -cloud.google.com/go/privatecatalog v0.9.4/go.mod h1:SOjm93f+5hp/U3PqMZAHTtBtluqLygrDrVO8X8tYtG0= -cloud.google.com/go/privatecatalog v0.9.5/go.mod h1:fVWeBOVe7uj2n3kWRGlUQqR/pOd450J9yZoOECcQqJk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -961,15 +379,8 @@ cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjp cloud.google.com/go/pubsub v1.26.0/go.mod h1:QgBH3U/jdJy/ftjPhTkyXNj543Tin1pRYcdcPRnFIRI= cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0= cloud.google.com/go/pubsub v1.28.0/go.mod h1:vuXFpwaVoIPQMGXqRyUQigu/AX1S3IWugR9xznmcXX8= -cloud.google.com/go/pubsub v1.30.0/go.mod h1:qWi1OPS0B+b5L+Sg6Gmc9zD1Y+HaM0MdUr7LsupY1P4= -cloud.google.com/go/pubsub v1.32.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc= -cloud.google.com/go/pubsub v1.33.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc= -cloud.google.com/go/pubsub v1.34.0/go.mod h1:alj4l4rBg+N3YTFDDC+/YyFTs6JAjam2QfYsddcAW4c= -cloud.google.com/go/pubsub v1.36.1/go.mod h1:iYjCa9EzWOoBiTdd4ps7QoMtMln5NwaZQpK1hbRfBDE= cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg= cloud.google.com/go/pubsublite v1.6.0/go.mod h1:1eFCS0U11xlOuMFV/0iBqw3zP12kddMeCbj/F3FSj9k= -cloud.google.com/go/pubsublite v1.7.0/go.mod h1:8hVMwRXfDfvGm3fahVbtDbiLePT3gpoiJYJY+vxWxVM= -cloud.google.com/go/pubsublite v1.8.1/go.mod h1:fOLdU4f5xldK4RGJrBMm+J7zMWNj/k4PxwEZXy39QS0= cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= @@ -977,188 +388,77 @@ cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7d cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE= cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= cloud.google.com/go/recaptchaenterprise/v2 v2.6.0/go.mod h1:RPauz9jeLtB3JVzg6nCbe12qNoaa8pXc4d/YukAmcnA= -cloud.google.com/go/recaptchaenterprise/v2 v2.7.0/go.mod h1:19wVj/fs5RtYtynAPJdDTb69oW0vNHYDBTbB4NvMD9c= -cloud.google.com/go/recaptchaenterprise/v2 v2.7.2/go.mod h1:kR0KjsJS7Jt1YSyWFkseQ756D45kaYNTlDPPaRAvDBU= -cloud.google.com/go/recaptchaenterprise/v2 v2.8.0/go.mod h1:QuE8EdU9dEnesG8/kG3XuJyNsjEqMlMzg3v3scCJ46c= -cloud.google.com/go/recaptchaenterprise/v2 v2.8.1/go.mod h1:JZYZJOeZjgSSTGP4uz7NlQ4/d1w5hGmksVgM0lbEij0= -cloud.google.com/go/recaptchaenterprise/v2 v2.8.2/go.mod h1:kpaDBOpkwD4G0GVMzG1W6Doy1tFFC97XAV3xy+Rd/pw= -cloud.google.com/go/recaptchaenterprise/v2 v2.8.3/go.mod h1:Dak54rw6lC2gBY8FBznpOCAR58wKf+R+ZSJRoeJok4w= -cloud.google.com/go/recaptchaenterprise/v2 v2.8.4/go.mod h1:Dak54rw6lC2gBY8FBznpOCAR58wKf+R+ZSJRoeJok4w= -cloud.google.com/go/recaptchaenterprise/v2 v2.9.0/go.mod h1:Dak54rw6lC2gBY8FBznpOCAR58wKf+R+ZSJRoeJok4w= -cloud.google.com/go/recaptchaenterprise/v2 v2.9.2/go.mod h1:trwwGkfhCmp05Ll5MSJPXY7yvnO0p4v3orGANAFHAuU= cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= cloud.google.com/go/recommendationengine v0.7.0/go.mod h1:1reUcE3GIu6MeBz/h5xZJqNLuuVjNg1lmWMPyjatzac= -cloud.google.com/go/recommendationengine v0.8.1/go.mod h1:MrZihWwtFYWDzE6Hz5nKcNz3gLizXVIDI/o3G1DLcrE= -cloud.google.com/go/recommendationengine v0.8.2/go.mod h1:QIybYHPK58qir9CV2ix/re/M//Ty10OxjnnhWdaKS1Y= -cloud.google.com/go/recommendationengine v0.8.3/go.mod h1:m3b0RZV02BnODE9FeSvGv1qibFo8g0OnmB/RMwYy4V8= -cloud.google.com/go/recommendationengine v0.8.4/go.mod h1:GEteCf1PATl5v5ZsQ60sTClUE0phbWmo3rQ1Js8louU= -cloud.google.com/go/recommendationengine v0.8.5/go.mod h1:A38rIXHGFvoPvmy6pZLozr0g59NRNREz4cx7F58HAsQ= cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs= cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= cloud.google.com/go/recommender v1.9.0/go.mod h1:PnSsnZY7q+VL1uax2JWkt/UegHssxjUVVCrX52CuEmQ= -cloud.google.com/go/recommender v1.10.1/go.mod h1:XFvrE4Suqn5Cq0Lf+mCP6oBHD/yRMA8XxP5sb7Q7gpA= -cloud.google.com/go/recommender v1.11.0/go.mod h1:kPiRQhPyTJ9kyXPCG6u/dlPLbYfFlkwHNRwdzPVAoII= -cloud.google.com/go/recommender v1.11.1/go.mod h1:sGwFFAyI57v2Hc5LbIj+lTwXipGu9NW015rkaEM5B18= -cloud.google.com/go/recommender v1.11.2/go.mod h1:AeoJuzOvFR/emIcXdVFkspVXVTYpliRCmKNYDnyBv6Y= -cloud.google.com/go/recommender v1.11.3/go.mod h1:+FJosKKJSId1MBFeJ/TTyoGQZiEelQQIZMKYYD8ruK4= -cloud.google.com/go/recommender v1.12.0/go.mod h1:+FJosKKJSId1MBFeJ/TTyoGQZiEelQQIZMKYYD8ruK4= -cloud.google.com/go/recommender v1.12.1/go.mod h1:gf95SInWNND5aPas3yjwl0I572dtudMhMIG4ni8nr+0= cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA= cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= cloud.google.com/go/redis v1.11.0/go.mod h1:/X6eicana+BWcUda5PpwZC48o37SiFVTFSs0fWAJ7uQ= -cloud.google.com/go/redis v1.13.1/go.mod h1:VP7DGLpE91M6bcsDdMuyCm2hIpB6Vp2hI090Mfd1tcg= -cloud.google.com/go/redis v1.13.2/go.mod h1:0Hg7pCMXS9uz02q+LoEVl5dNHUkIQv+C/3L76fandSA= -cloud.google.com/go/redis v1.13.3/go.mod h1:vbUpCKUAZSYzFcWKmICnYgRAhTFg9r+djWqFxDYXi4U= -cloud.google.com/go/redis v1.14.1/go.mod h1:MbmBxN8bEnQI4doZPC1BzADU4HGocHBk2de3SbgOkqs= -cloud.google.com/go/redis v1.14.2/go.mod h1:g0Lu7RRRz46ENdFKQ2EcQZBAJ2PtJHJLuiiRuEXwyQw= cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA= cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= cloud.google.com/go/resourcemanager v1.5.0/go.mod h1:eQoXNAiAvCf5PXxWxXjhKQoTMaUSNrEfg+6qdf/wots= -cloud.google.com/go/resourcemanager v1.6.0/go.mod h1:YcpXGRs8fDzcUl1Xw8uOVmI8JEadvhRIkoXXUNVYcVo= -cloud.google.com/go/resourcemanager v1.7.0/go.mod h1:HlD3m6+bwhzj9XCouqmeiGuni95NTrExfhoSrkC/3EI= -cloud.google.com/go/resourcemanager v1.9.1/go.mod h1:dVCuosgrh1tINZ/RwBufr8lULmWGOkPS8gL5gqyjdT8= -cloud.google.com/go/resourcemanager v1.9.2/go.mod h1:OujkBg1UZg5lX2yIyMo5Vz9O5hf7XQOSV7WxqxxMtQE= -cloud.google.com/go/resourcemanager v1.9.3/go.mod h1:IqrY+g0ZgLsihcfcmqSe+RKp1hzjXwG904B92AwBz6U= -cloud.google.com/go/resourcemanager v1.9.4/go.mod h1:N1dhP9RFvo3lUfwtfLWVxfUWq8+KUQ+XLlHLH3BoFJ0= -cloud.google.com/go/resourcemanager v1.9.5/go.mod h1:hep6KjelHA+ToEjOfO3garMKi/CLYwTqeAw7YiEI9x8= cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU= cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= cloud.google.com/go/resourcesettings v1.5.0/go.mod h1:+xJF7QSG6undsQDfsCJyqWXyBwUoJLhetkRMDRnIoXA= -cloud.google.com/go/resourcesettings v1.6.1/go.mod h1:M7mk9PIZrC5Fgsu1kZJci6mpgN8o0IUzVx3eJU3y4Jw= -cloud.google.com/go/resourcesettings v1.6.2/go.mod h1:mJIEDd9MobzunWMeniaMp6tzg4I2GvD3TTmPkc8vBXk= -cloud.google.com/go/resourcesettings v1.6.3/go.mod h1:pno5D+7oDYkMWZ5BpPsb4SO0ewg3IXcmmrUZaMJrFic= -cloud.google.com/go/resourcesettings v1.6.4/go.mod h1:pYTTkWdv2lmQcjsthbZLNBP4QW140cs7wqA3DuqErVI= -cloud.google.com/go/resourcesettings v1.6.5/go.mod h1:WBOIWZraXZOGAgoR4ukNj0o0HiSMO62H9RpFi9WjP9I= cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc= cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= cloud.google.com/go/retail v1.12.0/go.mod h1:UMkelN/0Z8XvKymXFbD4EhFJlYKRx1FGhQkVPU5kF14= -cloud.google.com/go/retail v1.14.1/go.mod h1:y3Wv3Vr2k54dLNIrCzenyKG8g8dhvhncT2NcNjb/6gE= -cloud.google.com/go/retail v1.14.2/go.mod h1:W7rrNRChAEChX336QF7bnMxbsjugcOCPU44i5kbLiL8= -cloud.google.com/go/retail v1.14.3/go.mod h1:Omz2akDHeSlfCq8ArPKiBxlnRpKEBjUH386JYFLUvXo= -cloud.google.com/go/retail v1.14.4/go.mod h1:l/N7cMtY78yRnJqp5JW8emy7MB1nz8E4t2yfOmklYfg= -cloud.google.com/go/retail v1.15.1/go.mod h1:In9nSBOYhLbDGa87QvWlnE1XA14xBN2FpQRiRsUs9wU= -cloud.google.com/go/retail v1.16.0/go.mod h1:LW7tllVveZo4ReWt68VnldZFWJRzsh9np+01J9dYWzE= cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do= cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= cloud.google.com/go/run v0.8.0/go.mod h1:VniEnuBwqjigv0A7ONfQUaEItaiCRVujlMqerPPiktM= -cloud.google.com/go/run v0.9.0/go.mod h1:Wwu+/vvg8Y+JUApMwEDfVfhetv30hCG4ZwDR/IXl2Qg= -cloud.google.com/go/run v1.2.0/go.mod h1:36V1IlDzQ0XxbQjUx6IYbw8H3TJnWvhii963WW3B/bo= -cloud.google.com/go/run v1.3.0/go.mod h1:S/osX/4jIPZGg+ssuqh6GNgg7syixKe3YnprwehzHKU= -cloud.google.com/go/run v1.3.1/go.mod h1:cymddtZOzdwLIAsmS6s+Asl4JoXIDm/K1cpZTxV4Q5s= -cloud.google.com/go/run v1.3.2/go.mod h1:SIhmqArbjdU/D9M6JoHaAqnAMKLFtXaVdNeq04NjnVE= -cloud.google.com/go/run v1.3.3/go.mod h1:WSM5pGyJ7cfYyYbONVQBN4buz42zFqwG67Q3ch07iK4= -cloud.google.com/go/run v1.3.4/go.mod h1:FGieuZvQ3tj1e9GnzXqrMABSuir38AJg5xhiYq+SF3o= cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk= cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= cloud.google.com/go/scheduler v1.8.0/go.mod h1:TCET+Y5Gp1YgHT8py4nlg2Sew8nUHMqcpousDgXJVQc= -cloud.google.com/go/scheduler v1.9.0/go.mod h1:yexg5t+KSmqu+njTIh3b7oYPheFtBWGcbVUYF1GGMIc= -cloud.google.com/go/scheduler v1.10.1/go.mod h1:R63Ldltd47Bs4gnhQkmNDse5w8gBRrhObZ54PxgR2Oo= -cloud.google.com/go/scheduler v1.10.2/go.mod h1:O3jX6HRH5eKCA3FutMw375XHZJudNIKVonSCHv7ropY= -cloud.google.com/go/scheduler v1.10.3/go.mod h1:8ANskEM33+sIbpJ+R4xRfw/jzOG+ZFE8WVLy7/yGvbc= -cloud.google.com/go/scheduler v1.10.4/go.mod h1:MTuXcrJC9tqOHhixdbHDFSIuh7xZF2IysiINDuiq6NI= -cloud.google.com/go/scheduler v1.10.5/go.mod h1:MTuXcrJC9tqOHhixdbHDFSIuh7xZF2IysiINDuiq6NI= -cloud.google.com/go/scheduler v1.10.6/go.mod h1:pe2pNCtJ+R01E06XCDOJs1XvAMbv28ZsQEbqknxGOuE= cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4= cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= cloud.google.com/go/secretmanager v1.10.0/go.mod h1:MfnrdvKMPNra9aZtQFvBcvRU54hbPD8/HayQdlUgJpU= -cloud.google.com/go/secretmanager v1.11.1/go.mod h1:znq9JlXgTNdBeQk9TBW/FnR/W4uChEKGeqQWAJ8SXFw= -cloud.google.com/go/secretmanager v1.11.2/go.mod h1:MQm4t3deoSub7+WNwiC4/tRYgDBHJgJPvswqQVB1Vss= -cloud.google.com/go/secretmanager v1.11.3/go.mod h1:0bA2o6FabmShrEy328i67aV+65XoUFFSmVeLBn/51jI= -cloud.google.com/go/secretmanager v1.11.4/go.mod h1:wreJlbS9Zdq21lMzWmJ0XhWW2ZxgPeahsqeV/vZoJ3w= -cloud.google.com/go/secretmanager v1.11.5/go.mod h1:eAGv+DaCHkeVyQi0BeXgAHOU0RdrMeZIASKc+S7VqH4= cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q= cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= cloud.google.com/go/security v1.12.0/go.mod h1:rV6EhrpbNHrrxqlvW0BWAIawFWq3X90SduMJdFwtLB8= -cloud.google.com/go/security v1.13.0/go.mod h1:Q1Nvxl1PAgmeW0y3HTt54JYIvUdtcpYKVfIB8AOMZ+0= -cloud.google.com/go/security v1.15.1/go.mod h1:MvTnnbsWnehoizHi09zoiZob0iCHVcL4AUBj76h9fXA= -cloud.google.com/go/security v1.15.2/go.mod h1:2GVE/v1oixIRHDaClVbHuPcZwAqFM28mXuAKCfMgYIg= -cloud.google.com/go/security v1.15.3/go.mod h1:gQ/7Q2JYUZZgOzqKtw9McShH+MjNvtDpL40J1cT+vBs= -cloud.google.com/go/security v1.15.4/go.mod h1:oN7C2uIZKhxCLiAAijKUCuHLZbIt/ghYEo8MqwD/Ty4= -cloud.google.com/go/security v1.15.5/go.mod h1:KS6X2eG3ynWjqcIX976fuToN5juVkF6Ra6c7MPnldtc= cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk= cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= cloud.google.com/go/securitycenter v1.18.1/go.mod h1:0/25gAzCM/9OL9vVx4ChPeM/+DlfGQJDwBy/UC8AKK0= -cloud.google.com/go/securitycenter v1.19.0/go.mod h1:LVLmSg8ZkkyaNy4u7HCIshAngSQ8EcIRREP3xBnyfag= -cloud.google.com/go/securitycenter v1.23.0/go.mod h1:8pwQ4n+Y9WCWM278R8W3nF65QtY172h4S8aXyI9/hsQ= -cloud.google.com/go/securitycenter v1.23.1/go.mod h1:w2HV3Mv/yKhbXKwOCu2i8bCuLtNP1IMHuiYQn4HJq5s= -cloud.google.com/go/securitycenter v1.24.1/go.mod h1:3h9IdjjHhVMXdQnmqzVnM7b0wMn/1O/U20eWVpMpZjI= -cloud.google.com/go/securitycenter v1.24.2/go.mod h1:l1XejOngggzqwr4Fa2Cn+iWZGf+aBLTXtB/vXjy5vXM= -cloud.google.com/go/securitycenter v1.24.3/go.mod h1:l1XejOngggzqwr4Fa2Cn+iWZGf+aBLTXtB/vXjy5vXM= -cloud.google.com/go/securitycenter v1.24.4/go.mod h1:PSccin+o1EMYKcFQzz9HMMnZ2r9+7jbc+LvPjXhpwcU= cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU= cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= -cloud.google.com/go/servicecontrol v1.10.0/go.mod h1:pQvyvSRh7YzUF2efw7H87V92mxU8FnFDawMClGCNuAA= cloud.google.com/go/servicecontrol v1.11.0/go.mod h1:kFmTzYzTUIuZs0ycVqRHNaNhgR+UMUpw9n02l/pY+mc= -cloud.google.com/go/servicecontrol v1.11.1/go.mod h1:aSnNNlwEFBY+PWGQ2DoM0JJ/QUXqV5/ZD9DOLB7SnUk= cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4= cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= cloud.google.com/go/servicedirectory v1.8.0/go.mod h1:srXodfhY1GFIPvltunswqXpVxFPpZjf8nkKQT7XcXaY= -cloud.google.com/go/servicedirectory v1.9.0/go.mod h1:29je5JjiygNYlmsGz8k6o+OZ8vd4f//bQLtvzkPPT/s= -cloud.google.com/go/servicedirectory v1.10.1/go.mod h1:Xv0YVH8s4pVOwfM/1eMTl0XJ6bzIOSLDt8f8eLaGOxQ= -cloud.google.com/go/servicedirectory v1.11.0/go.mod h1:Xv0YVH8s4pVOwfM/1eMTl0XJ6bzIOSLDt8f8eLaGOxQ= -cloud.google.com/go/servicedirectory v1.11.1/go.mod h1:tJywXimEWzNzw9FvtNjsQxxJ3/41jseeILgwU/QLrGI= -cloud.google.com/go/servicedirectory v1.11.2/go.mod h1:KD9hCLhncWRV5jJphwIpugKwM5bn1x0GyVVD4NO8mGg= -cloud.google.com/go/servicedirectory v1.11.3/go.mod h1:LV+cHkomRLr67YoQy3Xq2tUXBGOs5z5bPofdq7qtiAw= -cloud.google.com/go/servicedirectory v1.11.4/go.mod h1:Bz2T9t+/Ehg6x+Y7Ycq5xiShYLD96NfEsWNHyitj1qM= cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco= cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= cloud.google.com/go/servicemanagement v1.6.0/go.mod h1:aWns7EeeCOtGEX4OvZUWCCJONRZeFKiptqKf1D0l/Jc= -cloud.google.com/go/servicemanagement v1.8.0/go.mod h1:MSS2TDlIEQD/fzsSGfCdJItQveu9NXnUniTrq/L8LK4= cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E= cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= cloud.google.com/go/serviceusage v1.5.0/go.mod h1:w8U1JvqUqwJNPEOTQjrMHkw3IaIFLoLsPLvsE3xueec= -cloud.google.com/go/serviceusage v1.6.0/go.mod h1:R5wwQcbOWsyuOfbP9tGdAnCAc6B9DRwPG1xtWMDeuPA= cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4= cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= cloud.google.com/go/shell v1.6.0/go.mod h1:oHO8QACS90luWgxP3N9iZVuEiSF84zNyLytb+qE2f9A= -cloud.google.com/go/shell v1.7.1/go.mod h1:u1RaM+huXFaTojTbW4g9P5emOrrmLE69KrxqQahKn4g= -cloud.google.com/go/shell v1.7.2/go.mod h1:KqRPKwBV0UyLickMn0+BY1qIyE98kKyI216sH/TuHmc= -cloud.google.com/go/shell v1.7.3/go.mod h1:cTTEz/JdaBsQAeTQ3B6HHldZudFoYBOqjteev07FbIc= -cloud.google.com/go/shell v1.7.4/go.mod h1:yLeXB8eKLxw0dpEmXQ/FjriYrBijNsONpwnWsdPqlKM= -cloud.google.com/go/shell v1.7.5/go.mod h1:hL2++7F47/IfpfTO53KYf1EC+F56k3ThfNEXd4zcuiE= cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos= cloud.google.com/go/spanner v1.44.0/go.mod h1:G8XIgYdOK+Fbcpbs7p2fiprDw4CaZX63whnSMLVBxjk= -cloud.google.com/go/spanner v1.45.0/go.mod h1:FIws5LowYz8YAE1J8fOS7DJup8ff7xJeetWEo5REA2M= -cloud.google.com/go/spanner v1.47.0/go.mod h1:IXsJwVW2j4UKs0eYDqodab6HgGuA1bViSqW4uH9lfUI= -cloud.google.com/go/spanner v1.49.0/go.mod h1:eGj9mQGK8+hkgSVbHNQ06pQ4oS+cyc4tXXd6Dif1KoM= -cloud.google.com/go/spanner v1.50.0/go.mod h1:eGj9mQGK8+hkgSVbHNQ06pQ4oS+cyc4tXXd6Dif1KoM= -cloud.google.com/go/spanner v1.51.0/go.mod h1:c5KNo5LQ1X5tJwma9rSQZsXNBDNvj4/n8BVc3LNahq0= -cloud.google.com/go/spanner v1.53.0/go.mod h1:liG4iCeLqm5L3fFLU5whFITqP0e0orsAW1uUSrd4rws= -cloud.google.com/go/spanner v1.53.1/go.mod h1:liG4iCeLqm5L3fFLU5whFITqP0e0orsAW1uUSrd4rws= -cloud.google.com/go/spanner v1.54.0/go.mod h1:wZvSQVBgngF0Gq86fKup6KIYmN2be7uOKjtK97X+bQU= -cloud.google.com/go/spanner v1.55.0/go.mod h1:HXEznMUVhC+PC+HDyo9YFG2Ajj5BQDkcbqB9Z2Ffxi0= -cloud.google.com/go/spanner v1.56.0/go.mod h1:DndqtUKQAt3VLuV2Le+9Y3WTnq5cNKrnLb/Piqcj+h0= -cloud.google.com/go/spanner v1.57.0/go.mod h1:aXQ5QDdhPRIqVhYmnkAdwPYvj/DRN0FguclhEWw+jOo= cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0= cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= cloud.google.com/go/speech v1.14.1/go.mod h1:gEosVRPJ9waG7zqqnsHpYTOoAS4KouMRLDFMekpJ0J0= -cloud.google.com/go/speech v1.15.0/go.mod h1:y6oH7GhqCaZANH7+Oe0BhgIogsNInLlz542tg3VqeYI= -cloud.google.com/go/speech v1.17.1/go.mod h1:8rVNzU43tQvxDaGvqOhpDqgkJTFowBpDvCJ14kGlJYo= -cloud.google.com/go/speech v1.19.0/go.mod h1:8rVNzU43tQvxDaGvqOhpDqgkJTFowBpDvCJ14kGlJYo= -cloud.google.com/go/speech v1.19.1/go.mod h1:WcuaWz/3hOlzPFOVo9DUsblMIHwxP589y6ZMtaG+iAA= -cloud.google.com/go/speech v1.19.2/go.mod h1:2OYFfj+Ch5LWjsaSINuCZsre/789zlcCI3SY4oAi2oI= -cloud.google.com/go/speech v1.20.1/go.mod h1:wwolycgONvfz2EDU8rKuHRW3+wc9ILPsAWoikBEWavY= -cloud.google.com/go/speech v1.21.0/go.mod h1:wwolycgONvfz2EDU8rKuHRW3+wc9ILPsAWoikBEWavY= -cloud.google.com/go/speech v1.21.1/go.mod h1:E5GHZXYQlkqWQwY5xRSLHw2ci5NMQNG52FfMU1aZrIA= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= @@ -1169,162 +469,65 @@ cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y= -cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= -cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= -cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= -cloud.google.com/go/storage v1.37.0/go.mod h1:i34TiT2IhiNDmcj65PqwCjcoUX7Z5pLzS8DEmoiFq1k= cloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs= cloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0= cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= cloud.google.com/go/storagetransfer v1.7.0/go.mod h1:8Giuj1QNb1kfLAiWM1bN6dHzfdlDAVC9rv9abHot2W4= -cloud.google.com/go/storagetransfer v1.8.0/go.mod h1:JpegsHHU1eXg7lMHkvf+KE5XDJ7EQu0GwNJbbVGanEw= -cloud.google.com/go/storagetransfer v1.10.0/go.mod h1:DM4sTlSmGiNczmV6iZyceIh2dbs+7z2Ayg6YAiQlYfA= -cloud.google.com/go/storagetransfer v1.10.1/go.mod h1:rS7Sy0BtPviWYTTJVWCSV4QrbBitgPeuK4/FKa4IdLs= -cloud.google.com/go/storagetransfer v1.10.2/go.mod h1:meIhYQup5rg9juQJdyppnA/WLQCOguxtk1pr3/vBWzA= -cloud.google.com/go/storagetransfer v1.10.3/go.mod h1:Up8LY2p6X68SZ+WToswpQbQHnJpOty/ACcMafuey8gc= -cloud.google.com/go/storagetransfer v1.10.4/go.mod h1:vef30rZKu5HSEf/x1tK3WfWrL0XVoUQN/EPDRGPzjZs= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM= cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= cloud.google.com/go/talent v1.5.0/go.mod h1:G+ODMj9bsasAEJkQSzO2uHQWXHHXUomArjWQQYkqK6c= -cloud.google.com/go/talent v1.6.2/go.mod h1:CbGvmKCG61mkdjcqTcLOkb2ZN1SrQI8MDyma2l7VD24= -cloud.google.com/go/talent v1.6.3/go.mod h1:xoDO97Qd4AK43rGjJvyBHMskiEf3KulgYzcH6YWOVoo= -cloud.google.com/go/talent v1.6.4/go.mod h1:QsWvi5eKeh6gG2DlBkpMaFYZYrYUnIpo34f6/V5QykY= -cloud.google.com/go/talent v1.6.5/go.mod h1:Mf5cma696HmE+P2BWJ/ZwYqeJXEeU0UqjHFXVLadEDI= -cloud.google.com/go/talent v1.6.6/go.mod h1:y/WQDKrhVz12WagoarpAIyKKMeKGKHWPoReZ0g8tseQ= cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8= cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= cloud.google.com/go/texttospeech v1.6.0/go.mod h1:YmwmFT8pj1aBblQOI3TfKmwibnsfvhIBzPXcW4EBovc= -cloud.google.com/go/texttospeech v1.7.1/go.mod h1:m7QfG5IXxeneGqTapXNxv2ItxP/FS0hCZBwXYqucgSk= -cloud.google.com/go/texttospeech v1.7.2/go.mod h1:VYPT6aTOEl3herQjFHYErTlSZJ4vB00Q2ZTmuVgluD4= -cloud.google.com/go/texttospeech v1.7.3/go.mod h1:Av/zpkcgWfXlDLRYob17lqMstGZ3GqlvJXqKMp2u8so= -cloud.google.com/go/texttospeech v1.7.4/go.mod h1:vgv0002WvR4liGuSd5BJbWy4nDn5Ozco0uJymY5+U74= -cloud.google.com/go/texttospeech v1.7.5/go.mod h1:tzpCuNWPwrNJnEa4Pu5taALuZL4QRRLcb+K9pbhXT6M= cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ= cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= cloud.google.com/go/tpu v1.5.0/go.mod h1:8zVo1rYDFuW2l4yZVY0R0fb/v44xLh3llq7RuV61fPM= -cloud.google.com/go/tpu v1.6.1/go.mod h1:sOdcHVIgDEEOKuqUoi6Fq53MKHJAtOwtz0GuKsWSH3E= -cloud.google.com/go/tpu v1.6.2/go.mod h1:NXh3NDwt71TsPZdtGWgAG5ThDfGd32X1mJ2cMaRlVgU= -cloud.google.com/go/tpu v1.6.3/go.mod h1:lxiueqfVMlSToZY1151IaZqp89ELPSrk+3HIQ5HRkbY= -cloud.google.com/go/tpu v1.6.4/go.mod h1:NAm9q3Rq2wIlGnOhpYICNI7+bpBebMJbh0yyp3aNw1Y= -cloud.google.com/go/tpu v1.6.5/go.mod h1:P9DFOEBIBhuEcZhXi+wPoVy/cji+0ICFi4TtTkMHSSs= cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28= cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= cloud.google.com/go/trace v1.8.0/go.mod h1:zH7vcsbAhklH8hWFig58HvxcxyQbaIqMarMg9hn5ECA= -cloud.google.com/go/trace v1.9.0/go.mod h1:lOQqpE5IaWY0Ixg7/r2SjixMuc6lfTFeO4QGM4dQWOk= -cloud.google.com/go/trace v1.10.1/go.mod h1:gbtL94KE5AJLH3y+WVpfWILmqgc6dXcqgNXdOPAQTYk= -cloud.google.com/go/trace v1.10.2/go.mod h1:NPXemMi6MToRFcSxRl2uDnu/qAlAQ3oULUphcHGh1vA= -cloud.google.com/go/trace v1.10.3/go.mod h1:Ke1bgfc73RV3wUFml+uQp7EsDw4dGaETLxB7Iq/r4CY= -cloud.google.com/go/trace v1.10.4/go.mod h1:Nso99EDIK8Mj5/zmB+iGr9dosS/bzWCJ8wGmE6TXNWY= -cloud.google.com/go/trace v1.10.5/go.mod h1:9hjCV1nGBCtXbAE4YK7OqJ8pmPYSxPA0I67JwRd5s3M= cloud.google.com/go/trace v1.10.12 h1:GoGZv1iAXEa73HgSGNjRl2vKqp5/f2AeKqErRFXA2kg= cloud.google.com/go/trace v1.10.12/go.mod h1:tYkAIta/gxgbBZ/PIzFxSH5blajgX4D00RpQqCG/GZs= cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs= cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= -cloud.google.com/go/translate v1.5.0/go.mod h1:29YDSYveqqpA1CQFD7NQuP49xymq17RXNaUDdc0mNu0= cloud.google.com/go/translate v1.6.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= -cloud.google.com/go/translate v1.7.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= -cloud.google.com/go/translate v1.8.1/go.mod h1:d1ZH5aaOA0CNhWeXeC8ujd4tdCFw8XoNWRljklu5RHs= -cloud.google.com/go/translate v1.8.2/go.mod h1:d1ZH5aaOA0CNhWeXeC8ujd4tdCFw8XoNWRljklu5RHs= -cloud.google.com/go/translate v1.9.0/go.mod h1:d1ZH5aaOA0CNhWeXeC8ujd4tdCFw8XoNWRljklu5RHs= -cloud.google.com/go/translate v1.9.1/go.mod h1:TWIgDZknq2+JD4iRcojgeDtqGEp154HN/uL6hMvylS8= -cloud.google.com/go/translate v1.9.2/go.mod h1:E3Tc6rUTsQkVrXW6avbUhKJSr7ZE3j7zNmqzXKHqRrY= -cloud.google.com/go/translate v1.9.3/go.mod h1:Kbq9RggWsbqZ9W5YpM94Q1Xv4dshw/gr/SHfsl5yCZ0= -cloud.google.com/go/translate v1.10.0/go.mod h1:Kbq9RggWsbqZ9W5YpM94Q1Xv4dshw/gr/SHfsl5yCZ0= -cloud.google.com/go/translate v1.10.1/go.mod h1:adGZcQNom/3ogU65N9UXHOnnSvjPwA/jKQUMnsYXOyk= cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk= cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= -cloud.google.com/go/video v1.12.0/go.mod h1:MLQew95eTuaNDEGriQdcYn0dTwf9oWiA4uYebxM5kdg= cloud.google.com/go/video v1.13.0/go.mod h1:ulzkYlYgCp15N2AokzKjy7MQ9ejuynOJdf1tR5lGthk= -cloud.google.com/go/video v1.14.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= -cloud.google.com/go/video v1.15.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= -cloud.google.com/go/video v1.17.1/go.mod h1:9qmqPqw/Ib2tLqaeHgtakU+l5TcJxCJbhFXM7UJjVzU= -cloud.google.com/go/video v1.19.0/go.mod h1:9qmqPqw/Ib2tLqaeHgtakU+l5TcJxCJbhFXM7UJjVzU= -cloud.google.com/go/video v1.20.0/go.mod h1:U3G3FTnsvAGqglq9LxgqzOiBc/Nt8zis8S+850N2DUM= -cloud.google.com/go/video v1.20.1/go.mod h1:3gJS+iDprnj8SY6pe0SwLeC5BUW80NjhwX7INWEuWGU= -cloud.google.com/go/video v1.20.2/go.mod h1:lrixr5JeKNThsgfM9gqtwb6Okuqzfo4VrY2xynaViTA= -cloud.google.com/go/video v1.20.3/go.mod h1:TnH/mNZKVHeNtpamsSPygSR0iHtvrR/cW1/GDjN5+GU= -cloud.google.com/go/video v1.20.4/go.mod h1:LyUVjyW+Bwj7dh3UJnUGZfyqjEto9DnrvTe1f/+QrW0= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M= cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= cloud.google.com/go/videointelligence v1.10.0/go.mod h1:LHZngX1liVtUhZvi2uNS0VQuOzNi2TkY1OakiuoUOjU= -cloud.google.com/go/videointelligence v1.11.1/go.mod h1:76xn/8InyQHarjTWsBR058SmlPCwQjgcvoW0aZykOvo= -cloud.google.com/go/videointelligence v1.11.2/go.mod h1:ocfIGYtIVmIcWk1DsSGOoDiXca4vaZQII1C85qtoplc= -cloud.google.com/go/videointelligence v1.11.3/go.mod h1:tf0NUaGTjU1iS2KEkGWvO5hRHeCkFK3nPo0/cOZhZAo= -cloud.google.com/go/videointelligence v1.11.4/go.mod h1:kPBMAYsTPFiQxMLmmjpcZUMklJp3nC9+ipJJtprccD8= -cloud.google.com/go/videointelligence v1.11.5/go.mod h1:/PkeQjpRponmOerPeJxNPuxvi12HlW7Em0lJO14FC3I= cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY= cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= cloud.google.com/go/vision/v2 v2.6.0/go.mod h1:158Hes0MvOS9Z/bDMSFpjwsUrZ5fPrdwuyyvKSGAGMY= -cloud.google.com/go/vision/v2 v2.7.0/go.mod h1:H89VysHy21avemp6xcf9b9JvZHVehWbET0uT/bcuY/0= -cloud.google.com/go/vision/v2 v2.7.2/go.mod h1:jKa8oSYBWhYiXarHPvP4USxYANYUEdEsQrloLjrSwJU= -cloud.google.com/go/vision/v2 v2.7.3/go.mod h1:V0IcLCY7W+hpMKXK1JYE0LV5llEqVmj+UJChjvA1WsM= -cloud.google.com/go/vision/v2 v2.7.4/go.mod h1:ynDKnsDN/0RtqkKxQZ2iatv3Dm9O+HfRb5djl7l4Vvw= -cloud.google.com/go/vision/v2 v2.7.5/go.mod h1:GcviprJLFfK9OLf0z8Gm6lQb6ZFUulvpZws+mm6yPLM= -cloud.google.com/go/vision/v2 v2.7.6/go.mod h1:ZkvWTVNPBU3YZYzgF9Y1jwEbD1NBOCyJn0KFdQfE6Bw= -cloud.google.com/go/vision/v2 v2.8.0/go.mod h1:ocqDiA2j97pvgogdyhoxiQp2ZkDCyr0HWpicywGGRhU= cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE= cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= cloud.google.com/go/vmmigration v1.5.0/go.mod h1:E4YQ8q7/4W9gobHjQg4JJSgXXSgY21nA5r8swQV+Xxc= -cloud.google.com/go/vmmigration v1.6.0/go.mod h1:bopQ/g4z+8qXzichC7GW1w2MjbErL54rk3/C843CjfY= -cloud.google.com/go/vmmigration v1.7.1/go.mod h1:WD+5z7a/IpZ5bKK//YmT9E047AD+rjycCAvyMxGJbro= -cloud.google.com/go/vmmigration v1.7.2/go.mod h1:iA2hVj22sm2LLYXGPT1pB63mXHhrH1m/ruux9TwWLd8= -cloud.google.com/go/vmmigration v1.7.3/go.mod h1:ZCQC7cENwmSWlwyTrZcWivchn78YnFniEQYRWQ65tBo= -cloud.google.com/go/vmmigration v1.7.4/go.mod h1:yBXCmiLaB99hEl/G9ZooNx2GyzgsjKnw5fWcINRgD70= -cloud.google.com/go/vmmigration v1.7.5/go.mod h1:pkvO6huVnVWzkFioxSghZxIGcsstDvYiVCxQ9ZH3eYI= cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208= cloud.google.com/go/vmwareengine v0.2.2/go.mod h1:sKdctNJxb3KLZkE/6Oui94iw/xs9PRNC2wnNLXsHvH8= -cloud.google.com/go/vmwareengine v0.3.0/go.mod h1:wvoyMvNWdIzxMYSpH/R7y2h5h3WFkx6d+1TIsP39WGY= -cloud.google.com/go/vmwareengine v0.4.1/go.mod h1:Px64x+BvjPZwWuc4HdmVhoygcXqEkGHXoa7uyfTgSI0= -cloud.google.com/go/vmwareengine v1.0.0/go.mod h1:Px64x+BvjPZwWuc4HdmVhoygcXqEkGHXoa7uyfTgSI0= -cloud.google.com/go/vmwareengine v1.0.1/go.mod h1:aT3Xsm5sNx0QShk1Jc1B8OddrxAScYLwzVoaiXfdzzk= -cloud.google.com/go/vmwareengine v1.0.2/go.mod h1:xMSNjIk8/itYrz1JA8nV3Ajg4L4n3N+ugP8JKzk3OaA= -cloud.google.com/go/vmwareengine v1.0.3/go.mod h1:QSpdZ1stlbfKtyt6Iu19M6XRxjmXO+vb5a/R6Fvy2y4= -cloud.google.com/go/vmwareengine v1.1.1/go.mod h1:nMpdsIVkUrSaX8UvmnBhzVzG7PPvNYc5BszcvIVudYs= cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w= cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= cloud.google.com/go/vpcaccess v1.6.0/go.mod h1:wX2ILaNhe7TlVa4vC5xce1bCnqE3AeH27RV31lnmZes= -cloud.google.com/go/vpcaccess v1.7.1/go.mod h1:FogoD46/ZU+JUBX9D606X21EnxiszYi2tArQwLY4SXs= -cloud.google.com/go/vpcaccess v1.7.2/go.mod h1:mmg/MnRHv+3e8FJUjeSibVFvQF1cCy2MsFaFqxeY1HU= -cloud.google.com/go/vpcaccess v1.7.3/go.mod h1:YX4skyfW3NC8vI3Fk+EegJnlYFatA+dXK4o236EUCUc= -cloud.google.com/go/vpcaccess v1.7.4/go.mod h1:lA0KTvhtEOb/VOdnH/gwPuOzGgM+CWsmGu6bb4IoMKk= -cloud.google.com/go/vpcaccess v1.7.5/go.mod h1:slc5ZRvvjP78c2dnL7m4l4R9GwL3wDLcpIWz6P/ziig= cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc= cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= cloud.google.com/go/webrisk v1.8.0/go.mod h1:oJPDuamzHXgUc+b8SiHRcVInZQuybnvEW72PqTc7sSg= -cloud.google.com/go/webrisk v1.9.1/go.mod h1:4GCmXKcOa2BZcZPn6DCEvE7HypmEJcJkr4mtM+sqYPc= -cloud.google.com/go/webrisk v1.9.2/go.mod h1:pY9kfDgAqxUpDBOrG4w8deLfhvJmejKB0qd/5uQIPBc= -cloud.google.com/go/webrisk v1.9.3/go.mod h1:RUYXe9X/wBDXhVilss7EDLW9ZNa06aowPuinUOPCXH8= -cloud.google.com/go/webrisk v1.9.4/go.mod h1:w7m4Ib4C+OseSr2GL66m0zMBywdrVNTDKsdEsfMl7X0= -cloud.google.com/go/webrisk v1.9.5/go.mod h1:aako0Fzep1Q714cPEM5E+mtYX8/jsfegAuS8aivxy3U= cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo= cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= cloud.google.com/go/websecurityscanner v1.5.0/go.mod h1:Y6xdCPy81yi0SQnDY1xdNTNpfY1oAgXUlcfN3B3eSng= -cloud.google.com/go/websecurityscanner v1.6.1/go.mod h1:Njgaw3rttgRHXzwCB8kgCYqv5/rGpFCsBOvPbYgszpg= -cloud.google.com/go/websecurityscanner v1.6.2/go.mod h1:7YgjuU5tun7Eg2kpKgGnDuEOXWIrh8x8lWrJT4zfmas= -cloud.google.com/go/websecurityscanner v1.6.3/go.mod h1:x9XANObUFR+83Cya3g/B9M/yoHVqzxPnFtgF8yYGAXw= -cloud.google.com/go/websecurityscanner v1.6.4/go.mod h1:mUiyMQ+dGpPPRkHgknIZeCzSHJ45+fY4F52nZFDHm2o= -cloud.google.com/go/websecurityscanner v1.6.5/go.mod h1:QR+DWaxAz2pWooylsBF854/Ijvuoa3FCyS1zBa1rAVQ= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= -cloud.google.com/go/workflows v1.11.1/go.mod h1:Z+t10G1wF7h8LgdY/EmRcQY8ptBD/nvofaL6FqlET6g= -cloud.google.com/go/workflows v1.12.0/go.mod h1:PYhSk2b6DhZ508tj8HXKaBh+OFe+xdl0dHF/tJdzPQM= -cloud.google.com/go/workflows v1.12.1/go.mod h1:5A95OhD/edtOhQd/O741NSfIMezNTbCwLM1P1tBRGHM= -cloud.google.com/go/workflows v1.12.2/go.mod h1:+OmBIgNqYJPVggnMo9nqmizW0qEXHhmnAzK/CnBqsHc= -cloud.google.com/go/workflows v1.12.3/go.mod h1:fmOUeeqEwPzIU81foMjTRQIdwQHADi/vEr1cx9R1m5g= -cloud.google.com/go/workflows v1.12.4/go.mod h1:yQ7HUqOkdJK4duVtMeBCAOPiN1ZF1E9pAMX51vpwB/w= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= @@ -1375,14 +578,9 @@ github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= -github.com/alecthomas/assert/v2 v2.2.2/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= -github.com/alecthomas/assert/v2 v2.3.0/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= github.com/alecthomas/kingpin v1.3.8-0.20210301060133-17f40c25f497 h1:aDITxVUQ/3KBhpVWX57Vo9ntGTxoRw1F0T6/x/tRzNU= github.com/alecthomas/kingpin v1.3.8-0.20210301060133-17f40c25f497/go.mod h1:b6br6/pDFSfMkBgC96TbpOji05q5pa+v5rIlS0Y6XtI= github.com/alecthomas/kingpin/v2 v2.3.1/go.mod h1:oYL5vtsvEHZGHxU7DMp32Dvx+qL+ptGn6lWaot2vCNE= -github.com/alecthomas/participle/v2 v2.0.0/go.mod h1:rAKZdJldHu8084ojcWevWAL8KmEU+AT+Olodb+WoN2Y= -github.com/alecthomas/participle/v2 v2.1.0/go.mod h1:Y1+hAs8DHPmc3YUFzqllV+eSQ9ljPTk0ZkPMtEdAx2c= -github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -1400,15 +598,9 @@ github.com/alicebob/miniredis/v2 v2.22.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv github.com/aliyun/aliyun-oss-go-sdk v2.2.2+incompatible h1:9gWa46nstkJ9miBReJcN8Gq34cBFbzSpQZVVT9N09TM= github.com/aliyun/aliyun-oss-go-sdk v2.2.2+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= -github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= -github.com/apache/arrow/go/v12 v12.0.0/go.mod h1:d+tV/eHZZ7Dz7RPrFKtPK02tpr+c9/PEd/zm8mDS9Vg= -github.com/apache/arrow/go/v12 v12.0.1/go.mod h1:weuTY7JvTG/HDPtMQxEUp7pU73vkLWMLpY67QwZ/WWw= -github.com/apache/arrow/go/v14 v14.0.2/go.mod h1:u3fgh3EdgN/YQ8cVQRguVW3R+seMybFg8QBQ5LU+eBY= github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= -github.com/apache/thrift v0.17.0/go.mod h1:OLxhMRJxomX+1I/KUw03qoV3mMz16BwaKI+d4fPBx7Q= github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= @@ -1479,30 +671,29 @@ github.com/chromedp/chromedp v0.9.2/go.mod h1:LkSXJKONWTCHAfQasKFUZI+mxqS4tZqhmt github.com/chromedp/sysutil v1.0.0 h1:+ZxhTpfpZlmchB58ih/LBHX52ky7w2VhQVKQMucy3Ic= github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY= github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic= github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/cilium/ebpf v0.11.0 h1:V8gS/bTCCjX9uUnkUFUpPsksM8n1lXBAvHcpiFk1X2Y= github.com/cilium/ebpf v0.11.0/go.mod h1:WE7CZAnqOL2RouJ4f1uyNhqr2P4CCvXFIqdRDUgWsVs= github.com/clbanning/mxj v1.8.4 h1:HuhwZtbyvyOw+3Z1AowPkU87JkJUSv751ELWaiTpj8I= github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20230310173818-32f1caf87195/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20230428030218-4003588d1b74/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM= github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b h1:ga8SEFjZ60pxLcmhnThWgvH2wg8376yUJmPhEH4H3kw= github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= @@ -1558,29 +749,27 @@ github.com/elastic/go-windows v1.0.1 h1:AlYZOldA+UJ0/2nBuqWdo90GFCgG9xuyw9SYzGUt github.com/elastic/go-windows v1.0.1/go.mod h1:FoVvqWSun28vaDQPbj2Elfc0JahhPB7WQEGa3c814Ss= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= github.com/envoyproxy/go-control-plane v0.11.0/go.mod h1:VnHyVMpzcLvCFt9yUz1UnCwHLhwx1WguiVDV7pTG/tI= -github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f/go.mod h1:sfYdkwUW4BA3PbKjySwjJy+O4Pu0h62rlqCMHNk+K+Q= -github.com/envoyproxy/go-control-plane v0.11.1/go.mod h1:uhMcXKCQMEJHiAb0w+YGefQLaTEw+YhGluxZkrTmD0g= -github.com/envoyproxy/go-control-plane v0.12.0/go.mod h1:ZBTaoJ23lqITozF0M6G4/IragXCQKCnYbmlmtHvwRG0= github.com/envoyproxy/go-control-plane v0.13.0 h1:HzkeUz1Knt+3bK+8LG1bxOO/jzWZmdxpwC51i202les= github.com/envoyproxy/go-control-plane v0.13.0/go.mod h1:GRaKG3dwvFoTg4nj7aXdZnvMg4d7nvT/wl9WgVXn3Q8= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= github.com/envoyproxy/protoc-gen-validate v0.10.0/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= -github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= -github.com/envoyproxy/protoc-gen-validate v1.0.1/go.mod h1:0vj8bNkYbSTNS2PIyH87KZaeN4x9zpL9Qt8fQC7d+vs= -github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= -github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/envoyproxy/protoc-gen-validate v1.1.0 h1:tntQDh69XqOCOZsDz0lVJQez/2L6Uu2PdjCQwWCJ3bM= github.com/envoyproxy/protoc-gen-validate v1.1.0/go.mod h1:sXRDRVmzEbkM7CVcM06s9shE/m23dg3wzjl0UWqJ2q4= github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb h1:IT4JYU7k4ikYg1SCxNI1/Tieq/NFvh6dzLdgi7eu0tM= github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb/go.mod h1:bH6Xx7IW64qjjJq8M2u4dxNaBiDfKK+z/3eGDpXEQhc= -github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= @@ -1631,9 +820,6 @@ github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= @@ -1663,10 +849,6 @@ github.com/go-openapi/validate v0.23.0 h1:2l7PJLzCis4YUGEoW6eoQw3WhyM65WSIcjX6SQ github.com/go-openapi/validate v0.23.0/go.mod h1:EeiAZ5bmpSIOJV1WLfyYF9qp/B1ZgSaEpHTJHtN5cbE= github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-resty/resty/v2 v2.13.1 h1:x+LHXBI2nMB1vqndymf26quycC4aggYJ7DECYbiz03g= github.com/go-resty/resty/v2 v2.13.1/go.mod h1:GznXlLxkq6Nh4sU59rPmUw3VtgpO3aS96ORAI6Q7d+0= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -1683,11 +865,8 @@ github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6Wezm github.com/gobwas/ws v1.2.1 h1:F2aeBZrm2NDsc7vbovKrWSogd4wvfAxg0FQ89/iqOTk= github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= -github.com/goccy/go-yaml v1.9.8/go.mod h1:JubOolP3gh0HpiBc4BLRD4YmjEjHAmIIB2aaXKkTfoE= -github.com/goccy/go-yaml v1.11.0/go.mod h1:H+mJrWtjPTJAHvRbV09MCK9xYwODM+wRTVFFTWckfng= github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= @@ -1710,12 +889,12 @@ github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGw github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= -github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= @@ -1752,7 +931,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/flatbuffers v23.5.26+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -1772,8 +950,6 @@ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-pkcs11 v0.2.0/go.mod h1:6eQoGcuNJpa7jnd5pMGdkSaQpNDYvPlXWMcjXXThLlY= -github.com/google/go-pkcs11 v0.2.1-0.20230907215043-c6f79328ddf9/go.mod h1:6eQoGcuNJpa7jnd5pMGdkSaQpNDYvPlXWMcjXXThLlY= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= @@ -1803,23 +979,15 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/s2a-go v0.1.0/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM= -github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= -github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= -github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= @@ -1827,9 +995,6 @@ github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= github.com/googleapis/enterprise-certificate-proxy v0.2.1/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= -github.com/googleapis/enterprise-certificate-proxy v0.2.4/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= -github.com/googleapis/enterprise-certificate-proxy v0.2.5/go.mod h1:RxW0N9901Cko1VOCW3SXCpWP+mlIEkk2tP7jnHy9a3w= -github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw= github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= github.com/googleapis/gax-go v2.0.2+incompatible h1:silFMLAnr330+NRuag/VjIGF7TLp/LBrV2CJKFLWEww= @@ -1844,11 +1009,6 @@ github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= -github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= -github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= -github.com/googleapis/gax-go/v2 v2.10.0/go.mod h1:4UOEnMCrxsSqQ940WnTiD6qJ63le2ev3xfyagutxiPw= -github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= -github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s= github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= @@ -1871,7 +1031,6 @@ github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0/go.mod h1:XKMd7iuf/RGPSMJ github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= @@ -1905,15 +1064,12 @@ github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= github.com/hetznercloud/hcloud-go/v2 v2.13.1 h1:jq0GP4QaYE5d8xR/Zw17s9qoaESRJMXfGmtD1a/qckQ= github.com/hetznercloud/hcloud-go/v2 v2.13.1/go.mod h1:dhix40Br3fDiBhwaSG/zgaYOFFddpfBm/6R1Zz0IiF0= -github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.3+incompatible h1:tKTaPHNVwikS3I1rdyf1INNvgJXWSf/+TzqsiGbrgnQ= github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.3+incompatible/go.mod h1:l7VUhRbTKCzdOacdT4oWCwATKyvZqUOlOqr0Ous3k4s= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= @@ -1954,13 +1110,10 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= -github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.3/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= -github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM= github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b h1:udzkj9S/zlT5X367kqJis0QP7YMxobob6zhzq6Yre00= @@ -1986,7 +1139,6 @@ github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80 h1:6Yzfa6GP0rIo/kUL github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1yfhB7XSJJKlFZKl/J+dCPAknuiaGOshXAs= github.com/leesper/go_rng v0.0.0-20190531154944-a612b043e353 h1:X/79QL0b4YJVO5+OsPH9rF2u428CIrGL/jLmPsoOQQ4= github.com/leesper/go_rng v0.0.0-20190531154944-a612b043e353/go.mod h1:N0SVk0uhy+E1PZ3C9ctsPRlvOPAFPkCNlcPBDkt0N3U= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20210210170715-a8dfcb80d3a7 h1:YjW+hUb8Fh2S58z4av4t/0cBMK/Q0aP48RocCFsC8yI= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20210210170715-a8dfcb80d3a7/go.mod h1:Spd59icnvRxSKuyijbbwe5AemzvcyXAUBgApa7VybMw= github.com/lightstep/lightstep-tracer-go v0.25.0 h1:sGVnz8h3jTQuHKMbUe2949nXm3Sg09N1UcR3VoQNN5E= @@ -2004,24 +1156,17 @@ github.com/lyft/protoc-gen-star/v2 v2.0.3/go.mod h1:amey7yeodaJhXSbf/TlLvWiqQfLO github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= -github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mdlayher/socket v0.4.1 h1:eM9y2/jlbs1M615oshPQOHZzj6R6wMT7bX5NPiQvn2U= @@ -2120,7 +1265,6 @@ github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2 github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -2159,8 +1303,6 @@ github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1: github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -2189,12 +1331,13 @@ github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0ua github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/puzpuzpuz/xsync/v3 v3.5.1 h1:GJYJZwO6IdxN/IKbneznS6yPkVC+c3zyY/j19c++5Fg= +github.com/puzpuzpuz/xsync/v3 v3.5.1/go.mod h1:VjzYrABPabuM4KyBh1Ftq6u8nhwY5tBPKP9jpmh0nnA= github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E= github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw= github.com/redis/rueidis v1.0.45-alpha.1 h1:69Bu1l7gVC/qDYuGGwMwGg2rjOjSyxESol/Zila62gY= github.com/redis/rueidis v1.0.45-alpha.1/go.mod h1:q7BfhDaPt7xxwy2nv2RqQO12/mmHflDjebpcNwWFjms= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= @@ -2232,12 +1375,13 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.5.1/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= -github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= +github.com/srikrsna/protoc-gen-gotag v1.0.2 h1:4okv8GlbVbvmL678VX0AobxaMkERlBbHvgWhUnbcrPM= +github.com/srikrsna/protoc-gen-gotag v1.0.2/go.mod h1:HiXK5kcp/ZRnNPahuJm3tzfGDoD8xzvLNdg5/PYKq7Q= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -2253,13 +1397,10 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/substrait-io/substrait-go v0.4.2/go.mod h1:qhpnLmrcvAnlZsUyPXZRqldiHapPTXC3t7xFgDi3aQg= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.194/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.194/go.mod h1:yrBKWhChnDqNz1xuXdSbWXG56XawEq0G5j1lg4VwBD4= github.com/tencentyun/cos-go-sdk-v5 v0.7.40 h1:W6vDGKCHe4wBACI1d2UgE6+50sJFhRWU4O8IB2ozzxM= @@ -2312,7 +1453,6 @@ github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= github.com/zhangyunhao116/umap v0.0.0-20221211160557-cb7705fafa39 h1:D3ltj0b2c2FgUacKrB1pWGgwrUyCESY9W8XYYQ5sqY8= github.com/zhangyunhao116/umap v0.0.0-20221211160557-cb7705fafa39/go.mod h1:r86X1CnsDRrOeLtJlqRWdELPWpkcf933GTlojQlifQw= -go.einride.tech/aip v0.66.0/go.mod h1:qAhMsfT7plxBX+Oy7Huol6YUvZ0ZzdUz26yZsQwfl1M= go.elastic.co/apm v1.15.0 h1:uPk2g/whK7c7XiZyz/YCUnAUBNPiyNeE3ARX3G6Gx7Q= go.elastic.co/apm v1.15.0/go.mod h1:dylGv2HKR0tiCV+wliJz1KHtDyuD8SPe69oV7VyK6WY= go.elastic.co/apm/module/apmhttp v1.15.0 h1:Le/DhI0Cqpr9wG/NIGOkbz7+rOMqJrfE4MRG6q/+leU= @@ -2336,12 +1476,8 @@ go.opentelemetry.io/collector/pdata v1.14.1 h1:wXZjtQA7Vy5HFqco+yA95ENyMQU5heBB1 go.opentelemetry.io/collector/pdata v1.14.1/go.mod h1:z1dTjwwtcoXxZx2/nkHysjxMeaxe9pEmYTEr4SMNIx8= go.opentelemetry.io/collector/semconv v0.108.1 h1:Txk9tauUnamZaxS5vlf1O0uZ4VD6nioRBR0nX8L/fU4= go.opentelemetry.io/collector/semconv v0.108.1/go.mod h1:zCJ5njhWpejR+A40kiEoeFm1xq1uzyZwMnRNX6/D82A= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg= go.opentelemetry.io/contrib/propagators/autoprop v0.54.0 h1:h/O1OcNbqrFilsMKfG6MJWWpx8gzCDfn9D+1W7lU3lE= @@ -2356,9 +1492,6 @@ go.opentelemetry.io/contrib/propagators/ot v1.29.0 h1:CaJU78FvXrA6ajjp1dOdcABBEj go.opentelemetry.io/contrib/propagators/ot v1.29.0/go.mod h1:Sc0omwLb4eptUhwOAfYXfmPmErHPu2HV6vkeDge/3sY= go.opentelemetry.io/contrib/samplers/jaegerremote v0.23.0 h1:qKi9ntCcronqWqfuKxqrxZlZd82jXJEgGiAWH1+phxo= go.opentelemetry.io/contrib/samplers/jaegerremote v0.23.0/go.mod h1:1kbAgQa5lgYC3rC6cE3jSxQ/Q13l33wv/WI8U+htwag= -go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= -go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= -go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= go.opentelemetry.io/otel/bridge/opentracing v1.31.0 h1:S6SA1IQdNHgfZfgkaWBKQqNIlMNiPoyQDACii2uKQ9k= @@ -2371,24 +1504,15 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 h1:nSiV3 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0/go.mod h1:hKn/e/Nmd19/x1gvIHwtOwVWM+VhuITSWip3JUDghj0= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 h1:JAv0Jwtl01UFiyWZEMiJZBiTlv5A50zNs8lsthXqIio= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0/go.mod h1:QNKLmUEAq2QUbPQUfvw4fmv0bgbK7UlOSFCnXyfvSNc= -go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= -go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= -go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= -go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= -go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= -go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= -go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= -go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -2400,10 +1524,6 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go4.org/intern v0.0.0-20230525184215-6c62f75575cb h1:ae7kzL5Cfdmcecbh22ll7lYP3iuUdnfnhiPcSaDgH/8= -go4.org/intern v0.0.0-20230525184215-6c62f75575cb/go.mod h1:Ycrt6raEcnF5FTsLiLKkhBTO6DPX3RCUCUVnks3gFJU= -go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2 h1:WJhcL4p+YeDxmZWg141nRm7XC8IDmhz7lk5GpadO1Sg= -go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -2414,21 +1534,7 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20221012134737-56aed061732a/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -2446,8 +1552,6 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= -golang.org/x/exp v0.0.0-20230206171751-46f607a40771/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= @@ -2463,6 +1567,7 @@ golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeap golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -2489,17 +1594,13 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -2557,26 +1658,15 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= -golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -2601,15 +1691,9 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= -golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk= -golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= -golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= -golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -2628,13 +1712,9 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2715,7 +1795,6 @@ golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220406163625-3f8b81556e12/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2723,7 +1802,6 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2736,36 +1814,15 @@ golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= -golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg= golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2783,11 +1840,6 @@ golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2795,13 +1847,12 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -2862,15 +1913,9 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= -golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= -golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= -golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2881,12 +1926,10 @@ golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= -gonum.org/v1/gonum v0.12.0/go.mod h1:73TDxJfAAHeA8Mk9mf8NlIppyhQNo5GLTcYeqgo2lvY= gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ= gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= @@ -2948,31 +1991,17 @@ google.golang.org/api v0.106.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/ google.golang.org/api v0.107.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= -google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0= -google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= -google.golang.org/api v0.118.0/go.mod h1:76TtD3vkgmZ66zZzp72bUUklpmQmKlhh6sYtIjYK+5E= -google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms= -google.golang.org/api v0.124.0/go.mod h1:xu2HQurE5gi/3t1aFCvhPD781p0a3p11sdunTJ2BlP4= -google.golang.org/api v0.125.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= -google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= -google.golang.org/api v0.128.0/go.mod h1:Y611qgqaE92On/7g65MQgxYul3c0rEB894kniWLY750= -google.golang.org/api v0.139.0/go.mod h1:CVagp6Eekz9CjGZ718Z+sloknzkDJE7Vc1Ckj9+viBk= -google.golang.org/api v0.149.0/go.mod h1:Mwn1B7JTXrzXtnvmzQE2BD6bYZQ8DShKZDZbeN9I7qI= -google.golang.org/api v0.150.0/go.mod h1:ccy+MJ6nrYFgE3WgRx/AMXOxOmU8Q4hSa+jjibzhxcg= -google.golang.org/api v0.155.0/go.mod h1:GI5qK5f40kCpHfPn6+YzGAByIKWv8ujFnmoWm7Igduk= -google.golang.org/api v0.157.0/go.mod h1:+z4v4ufbZ1WEpld6yMGHyggs+PmAHiaLNj5ytP3N01g= -google.golang.org/api v0.160.0/go.mod h1:0mu0TpK33qnydLvWqbImq2b1eQ5FHRSDCBzAxX9ZHyw= -google.golang.org/api v0.162.0/go.mod h1:6SulDkfoBIg4NFmCuZ39XeeAgSHCPecfSUuDyYlAHs0= google.golang.org/api v0.195.0 h1:Ude4N8FvTKnnQJHU48RFI40jOBgIrL8Zqr3/QeST6yU= google.golang.org/api v0.195.0/go.mod h1:DOGRWuv3P8TU8Lnz7uQc4hyNqrBpMtD9ppW3wBJurgc= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -3098,109 +2127,58 @@ google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa/go.mod h1:RGgjbofJ google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44/go.mod h1:8B0gmkoRebU8ukX6HP+4wrVQUY1+6PkQ44BSyIlflHA= google.golang.org/genproto v0.0.0-20230222225845-10f96fb3dbec/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= -google.golang.org/genproto v0.0.0-20230223222841-637eb2293923/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= -google.golang.org/genproto v0.0.0-20230303212802-e74f57abe488/go.mod h1:TvhZT5f700eVlTNwND1xoEZQeWTB2RY/65kplwl/bFA= google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= -google.golang.org/genproto v0.0.0-20230320184635-7606e756e683/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= -google.golang.org/genproto v0.0.0-20230323212658-478b75c54725/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= -google.golang.org/genproto v0.0.0-20230330154414-c0448cd141ea/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= -google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= -google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:zqTuNwFlFRsw5zIts5VnzLQxSRqh+CGOTVMlYbY0Eyk= -google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= -google.golang.org/genproto v0.0.0-20230629202037-9506855d4529/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= -google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:O9kGHb51iE/nOGvQaDUuadVYqovW56s5emA88lQnj6Y= -google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98/go.mod h1:S7mY02OqCJTD0E1OiQy1F72PWFB4bZJ87cAtLPYgDR0= -google.golang.org/genproto v0.0.0-20230726155614-23370e0ffb3e/go.mod h1:0ggbjUrZYpy1q+ANUS30SEoGZ53cdfwtbuG7Ptgy108= -google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8= -google.golang.org/genproto v0.0.0-20230821184602-ccc8af3d0e93/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= -google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= -google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= -google.golang.org/genproto v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:CCviP9RmpZ1mxVr8MUjCnSiY09IbAXZxhLE6EhHIdPU= -google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97/go.mod h1:t1VqOqqvce95G3hIDCT5FeO3YUc6Q4Oe24L/+rNMxRk= -google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:EMfReVxb80Dq1hhioy0sOsY9jCE46YDgHlJ7fWVUWRE= -google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= -google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405/go.mod h1:3WDQMjmJk36UQhjQ89emUzb1mdaHcPeeAh4SCBKznB4= -google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY= -google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f/go.mod h1:nWSwAFPb+qfNJXsoeO3Io7zf4tMSfN8EA8RlDA04GhY= -google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3/go.mod h1:5RBcpGRxr25RbDzY5w+dmaqpSEvl8Gwl1x2CICf60ic= -google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0vFTBPy+tFSGvXEd3z+BcoG1k7EHbqm+YBsY= -google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917/go.mod h1:pZqR+glSb11aJ+JQcczCvgf47+duRuzNSKqE8YAQnV0= -google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k= -google.golang.org/genproto v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= -google.golang.org/genproto v0.0.0-20240205150955-31a09d347014/go.mod h1:xEgQu1e4stdSSsxPDK8Azkrk/ECl5HvdPf6nbZrTS5M= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= google.golang.org/genproto v0.0.0-20240823204242-4ba0660f739c h1:TYOEhrQMrNDTAd2rX9m+WgGr8Ku6YNuj1D7OX6rWSok= google.golang.org/genproto v0.0.0-20240823204242-4ba0660f739c/go.mod h1:2rC5OendXvZ8wGEo/cSLheztrZDZaSoHanUcd1xtZnw= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/api v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:mPBs5jNgx2GuQGvFwUvVKqtn6HsUw9nP64BedgvqEsQ= -google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= -google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= -google.golang.org/genproto/googleapis/api v0.0.0-20230803162519-f966b187b2e5/go.mod h1:5DZzOUPCLYL3mNkQ0ms0F3EuUNZ7py1Bqeq6sxzI7/Q= -google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= -google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= -google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:RdyHbowztCGQySiCvQPgWQWgWhGnouTdCflKoDBt32U= -google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0= -google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:SUBoKXbI1Efip18FClrQVGjWcyd0QZd8KkvdP34t7ww= -google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= -google.golang.org/genproto/googleapis/api v0.0.0-20231030173426-d783a09b4405/go.mod h1:oT32Z4o8Zv2xPQTg0pbVaPr0MPOH6f14RgXt7zfIpwg= -google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= -google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f/go.mod h1:Uy9bTZJqmfrw2rIBxgGLnamc78euZULUBrLZ9XTITKI= -google.golang.org/genproto/googleapis/api v0.0.0-20231211222908-989df2bf70f3/go.mod h1:k2dtGpRrbsSyKcNPKKI5sstZkrNCZwpU/ns96JoHbGg= -google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0/go.mod h1:CAny0tYF+0/9rmDB9fahA9YLzX3+AEVl1qXbv5hhj6c= -google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0= -google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:B5xPO//w8qmBDjGReYLpR6UJPnkldGkCSMoH/2vxJeg= -google.golang.org/genproto/googleapis/api v0.0.0-20240122161410-6c6643bf1457/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= -google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/api v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:PVreiBMirk8ypES6aw9d4p6iiBNSIfZEBqr3UGoAi2E= -google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed h1:3RgNmBoI9MZhsj3QxC+AP/qQhNwpCLOvYDYYsFrhFt0= google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo= -google.golang.org/genproto/googleapis/bytestream v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:ylj+BE99M198VPbBh6A8d9n3w8fChvyLK3wwBOjXBFA= -google.golang.org/genproto/googleapis/bytestream v0.0.0-20230807174057-1744710a1577/go.mod h1:NjCQG/D8JandXxM57PZbAJL1DCNL6EypA0vPPwfsc7c= -google.golang.org/genproto/googleapis/bytestream v0.0.0-20231030173426-d783a09b4405/go.mod h1:GRUCuLdzVqZte8+Dl/D4N25yLzcGqqWaYkeVOwulFqw= -google.golang.org/genproto/googleapis/bytestream v0.0.0-20231212172506-995d672761c0/go.mod h1:guYXGPwC6jwxgWKW5Y405fKWOFNwlvUlUnzyp9i0uqo= -google.golang.org/genproto/googleapis/bytestream v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:ZSvZ8l+AWJwXw91DoTjWjaVLpWU6o0eZ4YLYpH8aLeQ= -google.golang.org/genproto/googleapis/bytestream v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:SCz6T5xjNXM4QFPRwxHcfChp7V+9DcXR3ay2TkHR8Tg= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234015-3fc162c6f38a/go.mod h1:xURIpW9ES5+/GZhnV6beoEtxQrnkRGIfP5VQG2tCBLc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:8mL13HKkDa+IuJ8yruA3ci0q+0vsUz4m//+ottjwS5o= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5/go.mod h1:zBEcrKX2ZOcEkHWxBPAIvYUWOKKMIhYcmNiUIu2ji3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230920183334-c177e329c48b/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:KSqppvjFjtoCI+KGd4PELB0qLNxdJHRGqRI09mB6pQA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405/go.mod h1:67X1fPuzjcrkymZzZV1vvkFeTn2Rvc6lYF9MYFGCcwE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231211222908-989df2bf70f3/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240122161410-6c6643bf1457/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014/go.mod h1:SaPjaZGWb0lPqs6Ittu0spdfrOArqji4ZdeP5IC/9N4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:YUWgXUFRPfoYK1IHMuxH5K6nPEXSCzIMljnQ59lLRCk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= -google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= +google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= +google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= +google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/grpc/examples v0.0.0-20211119005141-f45e61797429 h1:vh/88xB6bVCYsvXtGnKcQGJLMt2fPUFwdSJrVfS2km8= google.golang.org/grpc/examples v0.0.0-20211119005141-f45e61797429/go.mod h1:gID3PKrg7pWKntu9Ss6zTLJ0ttC0X9IHgREOCZwbCVU= @@ -3219,11 +2197,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -3255,7 +2230,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -3280,23 +2254,15 @@ k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -lukechampine.com/uint128 v1.3.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= modernc.org/cc/v3 v3.36.2/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= modernc.org/cc/v3 v3.36.3/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= -modernc.org/cc/v3 v3.37.0/go.mod h1:vtL+3mdHx/wcj3iEGz84rQa8vEqR6XM84v5Lcvfph20= -modernc.org/cc/v3 v3.38.1/go.mod h1:vtL+3mdHx/wcj3iEGz84rQa8vEqR6XM84v5Lcvfph20= -modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc= modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw= -modernc.org/ccgo/v3 v3.0.0-20220904174949-82d86e1b6d56/go.mod h1:YSXjPL62P2AMSxBphRHPn7IkzhVHqkvOnRKAKh+W6ZI= -modernc.org/ccgo/v3 v3.0.0-20220910160915-348f15de615a/go.mod h1:8p47QxPkdugex9J4n9P2tLZ9bK01yngIVp00g4nomW0= modernc.org/ccgo/v3 v3.16.4/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= modernc.org/ccgo/v3 v3.16.8/go.mod h1:zNjwkizS+fIFDrDjIAgBSCLkWbJuHF+ar3QRn+Z9aws= modernc.org/ccgo/v3 v3.16.9/go.mod h1:zNMzC9A9xeNUepy6KuZBbugn3c0Mc9TeiJO4lgvkJDo= -modernc.org/ccgo/v3 v3.16.13-0.20221017192402-261537637ce8/go.mod h1:fUB3Vn0nVPReA+7IG7yZDfjv1TMWjhQP8gCxrFAtL5g= -modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= @@ -3306,38 +2272,20 @@ modernc.org/libc v1.16.17/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= modernc.org/libc v1.16.19/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= modernc.org/libc v1.17.0/go.mod h1:XsgLldpP4aWlPlsjqKRdHPqCxCjISdHfM/yeWC5GyW0= modernc.org/libc v1.17.1/go.mod h1:FZ23b+8LjxZs7XtFMbSzL/EhPxNbfZbErxEHc7cbD9s= -modernc.org/libc v1.17.4/go.mod h1:WNg2ZH56rDEwdropAJeZPQkXmDwh+JCA1s/htl6r2fA= -modernc.org/libc v1.18.0/go.mod h1:vj6zehR5bfc98ipowQOM2nIDUZnVew/wNC/2tOGS+q0= -modernc.org/libc v1.19.0/go.mod h1:ZRfIaEkgrYgZDl6pa4W39HgN5G/yDW+NRmNKZBDFrk0= -modernc.org/libc v1.20.3/go.mod h1:ZRfIaEkgrYgZDl6pa4W39HgN5G/yDW+NRmNKZBDFrk0= -modernc.org/libc v1.21.2/go.mod h1:przBsL5RDOZajTVslkugzLBj1evTue36jEomFQOoYuI= -modernc.org/libc v1.21.4/go.mod h1:przBsL5RDOZajTVslkugzLBj1evTue36jEomFQOoYuI= -modernc.org/libc v1.22.2/go.mod h1:uvQavJ1pZ0hIoC/jfqNoMLURIMhKzINIWypNM17puug= -modernc.org/libc v1.22.4/go.mod h1:jj+Z7dTNX8fBScMVNRAYZ/jF91K8fdT2hYMThc3YjBY= modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= modernc.org/memory v1.2.0/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= modernc.org/memory v1.2.1/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= -modernc.org/memory v1.3.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= -modernc.org/memory v1.4.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= -modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4= -modernc.org/sqlite v1.18.2/go.mod h1:kvrTLEWgxUcHa2GfHBQtanR1H9ht3hTJNtKpzH9k1u0= -modernc.org/sqlite v1.21.2/go.mod h1:cxbLkB5WS32DnQqeH4h4o1B0eMr8W/y8/RGuxQ3JsC0= modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw= -modernc.org/tcl v1.13.2/go.mod h1:7CLiGIPo1M8Rv1Mitpv5akc2+8fxUd2y2UzC/MfMzy0= -modernc.org/tcl v1.15.1/go.mod h1:aEjeGJX2gz1oWKOLDVZ2tnEWLUrIn8H+GFu+akoDhqs= modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8= -modernc.org/z v1.7.0/go.mod h1:hVdgNMh8ggTuRG1rGU8x+xGRFfiQUIAw0ZqlPy8+HyQ= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/internal/cortex/frontend/transport/handler.go b/internal/cortex/frontend/transport/handler.go index 6d3af86d287..e540c4c602f 100644 --- a/internal/cortex/frontend/transport/handler.go +++ b/internal/cortex/frontend/transport/handler.go @@ -37,8 +37,8 @@ const ( ) var ( - errCanceled = httpgrpc.Errorf(StatusClientClosedRequest, context.Canceled.Error()) - errDeadlineExceeded = httpgrpc.Errorf(http.StatusGatewayTimeout, context.DeadlineExceeded.Error()) + errCanceled = httpgrpc.Errorf(StatusClientClosedRequest, "%s", context.Canceled.Error()) + errDeadlineExceeded = httpgrpc.Errorf(http.StatusGatewayTimeout, "%s", context.DeadlineExceeded.Error()) errRequestEntityTooLarge = httpgrpc.Errorf(http.StatusRequestEntityTooLarge, "http: request body too large") ) diff --git a/internal/cortex/querier/queryrange/limits.go b/internal/cortex/querier/queryrange/limits.go index 8e1980a535f..b4a487390c0 100644 --- a/internal/cortex/querier/queryrange/limits.go +++ b/internal/cortex/querier/queryrange/limits.go @@ -57,7 +57,7 @@ func (l limitsMiddleware) Do(ctx context.Context, r Request) (Response, error) { tenantIDs, err := tenant.TenantIDs(ctx) if err != nil { - return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error()) + return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()) } // Clamp the time range based on the max query lookback. diff --git a/internal/cortex/querier/queryrange/query_bytes_fetched.go b/internal/cortex/querier/queryrange/query_bytes_fetched.go index 6263f222b17..0d602cd59ba 100644 --- a/internal/cortex/querier/queryrange/query_bytes_fetched.go +++ b/internal/cortex/querier/queryrange/query_bytes_fetched.go @@ -16,7 +16,7 @@ func sumQueryBytesFetched(responses ...Response) uint64 { var result uint64 result = 0 for _, resp := range responses { - for _, hdr := range resp.GetHeaders() { + for _, hdr := range resp.PrometheusHeaders() { if hdr.GetName() == QueryBytesFetchedHeaderName { for _, v := range hdr.GetValues() { n, err := strconv.ParseUint(v, 10, 64) @@ -45,7 +45,7 @@ func QueryBytesFetchedPrometheusResponseHeaders(responses ...Response) []*Promet func QueryBytesFetchedHttpHeaderValue(response Response) []string { var result []string - for _, hdr := range response.GetHeaders() { + for _, hdr := range response.PrometheusHeaders() { if hdr.GetName() == QueryBytesFetchedHeaderName { result = hdr.GetValues() break diff --git a/internal/cortex/querier/queryrange/query_range.go b/internal/cortex/querier/queryrange/query_range.go index f6067f1aeae..f29d8cd7078 100644 --- a/internal/cortex/querier/queryrange/query_range.go +++ b/internal/cortex/querier/queryrange/query_range.go @@ -104,9 +104,7 @@ type Request interface { // Response represents a query range response. type Response interface { proto.Message - // GetHeaders returns the HTTP headers in the response. - GetHeaders() []*PrometheusResponseHeader - // GetStats returns the Prometheus query stats in the response. + PrometheusHeaders() []*PrometheusResponseHeader GetStats() *PrometheusResponseStats } @@ -177,10 +175,18 @@ func minInt64(a, b int64) int64 { return b } +func (resp *PrometheusResponse) PrometheusHeaders() []*PrometheusResponseHeader { + return resp.GetHeaders() +} + func (resp *PrometheusResponse) GetStats() *PrometheusResponseStats { return resp.Data.Stats } +func (resp *PrometheusInstantQueryResponse) PrometheusHeaders() []*PrometheusResponseHeader { + return resp.GetHeaders() +} + func (resp *PrometheusInstantQueryResponse) GetStats() *PrometheusResponseStats { return resp.Data.Stats } @@ -409,7 +415,7 @@ func (prometheusCodec) EncodeRequest(ctx context.Context, r Request) (*http.Requ func (prometheusCodec) DecodeResponse(ctx context.Context, r *http.Response, _ Request) (Response, error) { if r.StatusCode/100 != 2 { body, _ := io.ReadAll(r.Body) - return nil, httpgrpc.Errorf(r.StatusCode, string(body)) + return nil, httpgrpc.Errorf(r.StatusCode, "%s", string(body)) } log, ctx := spanlogger.New(ctx, "ParseQueryRangeResponse") //nolint:ineffassign,staticcheck defer log.Finish() diff --git a/internal/cortex/querier/queryrange/results_cache.go b/internal/cortex/querier/queryrange/results_cache.go index 28cc388134b..dad2960e48c 100644 --- a/internal/cortex/querier/queryrange/results_cache.go +++ b/internal/cortex/querier/queryrange/results_cache.go @@ -7,12 +7,13 @@ import ( "context" "flag" "fmt" - "github.com/thanos-io/thanos/pkg/extpromql" "net/http" "sort" "strings" "time" + "github.com/thanos-io/thanos/pkg/extpromql" + "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/gogo/protobuf/proto" @@ -223,7 +224,7 @@ func (s resultsCache) Do(ctx context.Context, r Request) (Response, error) { tenantIDs, err := tenant.TenantIDs(ctx) respWithStats := r.GetStats() != "" && s.cacheQueryableSamplesStats if err != nil { - return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error()) + return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()) } // If cache_queryable_samples_stats is enabled we always need request the status upstream @@ -405,7 +406,7 @@ func (s resultsCache) isOffsetCachable(r Request) bool { } func getHeaderValuesWithName(r Response, headerName string) (headerValues []string) { - for _, hv := range r.GetHeaders() { + for _, hv := range r.PrometheusHeaders() { if hv.GetName() != headerName { continue } diff --git a/internal/cortex/querier/queryrange/roundtrip.go b/internal/cortex/querier/queryrange/roundtrip.go index 3f254105dc7..8f3f627d71d 100644 --- a/internal/cortex/querier/queryrange/roundtrip.go +++ b/internal/cortex/querier/queryrange/roundtrip.go @@ -259,7 +259,7 @@ func (q roundTripper) Do(ctx context.Context, r Request) (Response, error) { } if err := user.InjectOrgIDIntoHTTPRequest(ctx, request); err != nil { - return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error()) + return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()) } response, err := q.next.RoundTrip(request) diff --git a/internal/cortex/querier/queryrange/util.go b/internal/cortex/querier/queryrange/util.go index 9beee88b1e6..c4ab8b4bbac 100644 --- a/internal/cortex/querier/queryrange/util.go +++ b/internal/cortex/querier/queryrange/util.go @@ -23,7 +23,7 @@ type RequestResponse struct { func DoRequests(ctx context.Context, downstream Handler, reqs []Request, limits Limits) ([]RequestResponse, error) { tenantIDs, err := tenant.TenantIDs(ctx) if err != nil { - return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error()) + return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()) } // If one of the requests fail, we want to be able to cancel the rest of them. diff --git a/pkg/alert/alert.go b/pkg/alert/alert.go index ee5389b0b64..e0eaca8cb2c 100644 --- a/pkg/alert/alert.go +++ b/pkg/alert/alert.go @@ -29,6 +29,7 @@ import ( "go.uber.org/atomic" "github.com/thanos-io/thanos/pkg/runutil" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/tracing" ) @@ -43,7 +44,7 @@ type Queue struct { logger log.Logger maxBatchSize int capacity int - toAddLset labels.Labels + toAddLset labelpb.Labels toExcludeLabels []string alertRelabelConfigs []*relabel.Config @@ -58,16 +59,20 @@ type Queue struct { // NewQueue returns a new queue. The given label set is attached to all alerts pushed to the queue. // The given exclude label set tells what label names to drop including external labels. -func NewQueue(logger log.Logger, reg prometheus.Registerer, capacity, maxBatchSize int, externalLset labels.Labels, excludeLabels []string, alertRelabelConfigs []*relabel.Config) *Queue { +func NewQueue(logger log.Logger, reg prometheus.Registerer, capacity, maxBatchSize int, externalLset labelpb.Labels, excludeLabels []string, alertRelabelConfigs []*relabel.Config) *Queue { if logger == nil { logger = log.NewNopLogger() } + exclude := make(map[string]struct{}, len(excludeLabels)) + for _, n := range excludeLabels { + exclude[n] = struct{}{} + } q := &Queue{ logger: logger, capacity: capacity, morec: make(chan struct{}, 1), maxBatchSize: maxBatchSize, - toAddLset: labels.NewBuilder(externalLset.Copy()).Del(excludeLabels...).Labels(), + toAddLset: labelpb.RmLabels(externalLset, exclude), toExcludeLabels: excludeLabels, alertRelabelConfigs: alertRelabelConfigs, @@ -156,7 +161,7 @@ func (q *Queue) Push(alerts []*notifier.Alert) { for _, a := range alerts { b.Reset(a.Labels.Copy()) b.Del(q.toExcludeLabels...) - q.toAddLset.Range(func(l labels.Label) { + q.toAddLset.Range(func(l *labelpb.Label) { b.Set(l.Name, l.Value) }) if lset, keep := relabel.Process(b.Labels(), q.alertRelabelConfigs...); keep { diff --git a/pkg/alert/alert_test.go b/pkg/alert/alert_test.go index c932aeee6a7..a5b30f0912c 100644 --- a/pkg/alert/alert_test.go +++ b/pkg/alert/alert_test.go @@ -20,6 +20,7 @@ import ( "github.com/prometheus/prometheus/notifier" "github.com/efficientgo/core/testutil" + "github.com/thanos-io/thanos/pkg/store/labelpb" ) func TestQueue_Pop_all_Pushed(t *testing.T) { @@ -27,7 +28,7 @@ func TestQueue_Pop_all_Pushed(t *testing.T) { batchsize := 1 pushes := 3 - q := NewQueue(nil, nil, qcapacity, batchsize, labels.EmptyLabels(), nil, nil) + q := NewQueue(nil, nil, qcapacity, batchsize, labelpb.EmptyLabels(), nil, nil) for i := 0; i < pushes; i++ { q.Push([]*notifier.Alert{ {}, @@ -46,7 +47,7 @@ func TestQueue_Pop_all_Pushed(t *testing.T) { } func TestQueue_Push_Relabelled(t *testing.T) { - q := NewQueue(nil, nil, 10, 10, labels.FromStrings("a", "1", "replica", "A"), []string{"b", "replica"}, nil) + q := NewQueue(nil, nil, 10, 10, labelpb.FromStrings("a", "1", "replica", "A"), []string{"b", "replica"}, nil) q.Push([]*notifier.Alert{ {Labels: labels.FromStrings("b", "2", "c", "3")}, @@ -62,7 +63,7 @@ func TestQueue_Push_Relabelled(t *testing.T) { func TestQueue_Push_Relabelled_Alerts(t *testing.T) { q := NewQueue( - nil, nil, 10, 10, labels.New(), []string{}, + nil, nil, 10, 10, labelpb.EmptyLabels(), []string{}, []*relabel.Config{ { SourceLabels: model.LabelNames{"a"}, @@ -92,7 +93,7 @@ func TestQueue_Push_Relabelled_Alerts(t *testing.T) { } func TestQueue_Push_RelabelDropAlerts(t *testing.T) { - q := NewQueue(nil, nil, 10, 10, labels.EmptyLabels(), nil, + q := NewQueue(nil, nil, 10, 10, labelpb.EmptyLabels(), nil, []*relabel.Config{ { SourceLabels: model.LabelNames{"a"}, diff --git a/pkg/api/query/grpc.go b/pkg/api/query/grpc.go index 093457dd062..8bf2f49f0f2 100644 --- a/pkg/api/query/grpc.go +++ b/pkg/api/query/grpc.go @@ -23,6 +23,8 @@ import ( ) type GRPCAPI struct { + querypb.UnimplementedQueryServer + now func() time.Time replicaLabels []string queryableCreate query.QueryableCreator @@ -121,7 +123,7 @@ func (g *GRPCAPI) Query(request *querypb.QueryRequest, server querypb.Query_Quer switch vector := result.Value.(type) { case promql.Scalar: series := &prompb.TimeSeries{ - Samples: []prompb.Sample{{Value: vector.V, Timestamp: vector.T}}, + Samples: []*prompb.Sample{{Value: vector.V, Timestamp: vector.T}}, } if err := server.Send(querypb.NewQueryResponse(series)); err != nil { return err @@ -130,7 +132,7 @@ func (g *GRPCAPI) Query(request *querypb.QueryRequest, server querypb.Query_Quer for _, sample := range vector { floats, histograms := prompb.SamplesFromPromqlSamples(sample) series := &prompb.TimeSeries{ - Labels: labelpb.ZLabelsFromPromLabels(sample.Metric), + Labels: labelpb.FromPromLabels(sample.Metric), Samples: floats, Histograms: histograms, } @@ -243,7 +245,7 @@ func (g *GRPCAPI) QueryRange(request *querypb.QueryRangeRequest, srv querypb.Que for _, series := range value { floats, histograms := prompb.SamplesFromPromqlSeries(series) series := &prompb.TimeSeries{ - Labels: labelpb.ZLabelsFromPromLabels(series.Metric), + Labels: labelpb.FromPromLabels(series.Metric), Samples: floats, Histograms: histograms, } @@ -255,7 +257,7 @@ func (g *GRPCAPI) QueryRange(request *querypb.QueryRangeRequest, srv querypb.Que for _, sample := range value { floats, histograms := prompb.SamplesFromPromqlSamples(sample) series := &prompb.TimeSeries{ - Labels: labelpb.ZLabelsFromPromLabels(sample.Metric), + Labels: labelpb.FromPromLabels(sample.Metric), Samples: floats, Histograms: histograms, } @@ -265,7 +267,7 @@ func (g *GRPCAPI) QueryRange(request *querypb.QueryRangeRequest, srv querypb.Que } case promql.Scalar: series := &prompb.TimeSeries{ - Samples: []prompb.Sample{{Value: value.V, Timestamp: value.T}}, + Samples: []*prompb.Sample{{Value: value.V, Timestamp: value.T}}, } if err := srv.Send(querypb.NewQueryRangeResponse(series)); err != nil { return err diff --git a/pkg/api/query/grpc_test.go b/pkg/api/query/grpc_test.go index f1be2a54893..154c159bef3 100644 --- a/pkg/api/query/grpc_test.go +++ b/pkg/api/query/grpc_test.go @@ -23,12 +23,13 @@ import ( "github.com/thanos-io/thanos/pkg/extpromql" "github.com/thanos-io/thanos/pkg/query" "github.com/thanos-io/thanos/pkg/store" + "github.com/thanos-io/thanos/pkg/store/labelpb" ) func TestGRPCQueryAPIWithQueryPlan(t *testing.T) { logger := log.NewNopLogger() reg := prometheus.NewRegistry() - proxy := store.NewProxyStore(logger, reg, func() []store.Client { return nil }, component.Store, nil, 1*time.Minute, store.LazyRetrieval) + proxy := store.NewProxyStore(logger, reg, func() []store.Client { return nil }, component.Store, labelpb.EmptyLabels(), 1*time.Minute, store.LazyRetrieval) queryableCreator := query.NewQueryableCreator(logger, reg, proxy, 1, 1*time.Minute) lookbackDeltaFunc := func(i int64) time.Duration { return 5 * time.Minute } engineFactory := &QueryEngineFactory{ @@ -74,7 +75,7 @@ func TestGRPCQueryAPIWithQueryPlan(t *testing.T) { func TestGRPCQueryAPIErrorHandling(t *testing.T) { logger := log.NewNopLogger() reg := prometheus.NewRegistry() - proxy := store.NewProxyStore(logger, reg, func() []store.Client { return nil }, component.Store, nil, 1*time.Minute, store.LazyRetrieval) + proxy := store.NewProxyStore(logger, reg, func() []store.Client { return nil }, component.Store, labelpb.EmptyLabels(), 1*time.Minute, store.LazyRetrieval) queryableCreator := query.NewQueryableCreator(logger, reg, proxy, 1, 1*time.Minute) lookbackDeltaFunc := func(i int64) time.Duration { return 5 * time.Minute } tests := []struct { @@ -185,7 +186,7 @@ type queryServer struct { querypb.Query_QueryServer ctx context.Context - responses []querypb.QueryResponse + responses []*querypb.QueryResponse } func newQueryServer(ctx context.Context) *queryServer { @@ -193,7 +194,7 @@ func newQueryServer(ctx context.Context) *queryServer { } func (q *queryServer) Send(r *querypb.QueryResponse) error { - q.responses = append(q.responses, *r) + q.responses = append(q.responses, r) return nil } @@ -205,7 +206,7 @@ type queryRangeServer struct { querypb.Query_QueryRangeServer ctx context.Context - responses []querypb.QueryRangeResponse + responses []*querypb.QueryRangeResponse } func newQueryRangeServer(ctx context.Context) *queryRangeServer { @@ -213,7 +214,7 @@ func newQueryRangeServer(ctx context.Context) *queryRangeServer { } func (q *queryRangeServer) Send(r *querypb.QueryRangeResponse) error { - q.responses = append(q.responses, *r) + q.responses = append(q.responses, r) return nil } diff --git a/pkg/api/query/querypb/query.pb.go b/pkg/api/query/querypb/query.pb.go index ebeec71d80b..53de788f83a 100644 --- a/pkg/api/query/querypb/query.pb.go +++ b/pkg/api/query/querypb/query.pb.go @@ -1,34 +1,31 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.20.1 // source: api/query/querypb/query.proto package querypb import ( - context "context" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + reflect "reflect" + sync "sync" + + _ "github.com/srikrsna/protoc-gen-gotag/tagger" storepb "github.com/thanos-io/thanos/pkg/store/storepb" prompb "github.com/thanos-io/thanos/pkg/store/storepb/prompb" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type EngineType int32 @@ -38,72 +35,112 @@ const ( EngineType_thanos EngineType = 2 ) -var EngineType_name = map[int32]string{ - 0: "default", - 1: "prometheus", - 2: "thanos", -} +// Enum value maps for EngineType. +var ( + EngineType_name = map[int32]string{ + 0: "default", + 1: "prometheus", + 2: "thanos", + } + EngineType_value = map[string]int32{ + "default": 0, + "prometheus": 1, + "thanos": 2, + } +) -var EngineType_value = map[string]int32{ - "default": 0, - "prometheus": 1, - "thanos": 2, +func (x EngineType) Enum() *EngineType { + p := new(EngineType) + *p = x + return p } func (x EngineType) String() string { - return proto.EnumName(EngineType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EngineType) Descriptor() protoreflect.EnumDescriptor { + return file_api_query_querypb_query_proto_enumTypes[0].Descriptor() +} + +func (EngineType) Type() protoreflect.EnumType { + return &file_api_query_querypb_query_proto_enumTypes[0] } +func (x EngineType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EngineType.Descriptor instead. func (EngineType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_4b2aba43925d729f, []int{0} + return file_api_query_querypb_query_proto_rawDescGZIP(), []int{0} } type QueryStats struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + SamplesTotal int64 `protobuf:"varint,1,opt,name=samples_total,json=samplesTotal,proto3" json:"samples_total,omitempty"` PeakSamples int64 `protobuf:"varint,2,opt,name=peak_samples,json=peakSamples,proto3" json:"peak_samples,omitempty"` } -func (m *QueryStats) Reset() { *m = QueryStats{} } -func (m *QueryStats) String() string { return proto.CompactTextString(m) } -func (*QueryStats) ProtoMessage() {} -func (*QueryStats) Descriptor() ([]byte, []int) { - return fileDescriptor_4b2aba43925d729f, []int{0} -} -func (m *QueryStats) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryStats.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *QueryStats) Reset() { + *x = QueryStats{} + mi := &file_api_query_querypb_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QueryStats) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryStats) ProtoMessage() {} + +func (x *QueryStats) ProtoReflect() protoreflect.Message { + mi := &file_api_query_querypb_query_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *QueryStats) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryStats.Merge(m, src) -} -func (m *QueryStats) XXX_Size() int { - return m.Size() + +// Deprecated: Use QueryStats.ProtoReflect.Descriptor instead. +func (*QueryStats) Descriptor() ([]byte, []int) { + return file_api_query_querypb_query_proto_rawDescGZIP(), []int{0} } -func (m *QueryStats) XXX_DiscardUnknown() { - xxx_messageInfo_QueryStats.DiscardUnknown(m) + +func (x *QueryStats) GetSamplesTotal() int64 { + if x != nil { + return x.SamplesTotal + } + return 0 } -var xxx_messageInfo_QueryStats proto.InternalMessageInfo +func (x *QueryStats) GetPeakSamples() int64 { + if x != nil { + return x.PeakSamples + } + return 0 +} type QueryRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` QueryPlan *QueryPlan `protobuf:"bytes,14,opt,name=queryPlan,proto3" json:"queryPlan,omitempty"` TimeSeconds int64 `protobuf:"varint,2,opt,name=time_seconds,json=timeSeconds,proto3" json:"time_seconds,omitempty"` TimeoutSeconds int64 `protobuf:"varint,3,opt,name=timeout_seconds,json=timeoutSeconds,proto3" json:"timeout_seconds,omitempty"` MaxResolutionSeconds int64 `protobuf:"varint,4,opt,name=max_resolution_seconds,json=maxResolutionSeconds,proto3" json:"max_resolution_seconds,omitempty"` ReplicaLabels []string `protobuf:"bytes,5,rep,name=replica_labels,json=replicaLabels,proto3" json:"replica_labels,omitempty"` - StoreMatchers []StoreMatchers `protobuf:"bytes,6,rep,name=storeMatchers,proto3" json:"storeMatchers"` + StoreMatchers []*StoreMatchers `protobuf:"bytes,6,rep,name=storeMatchers,proto3" json:"storeMatchers"` EnableDedup bool `protobuf:"varint,7,opt,name=enableDedup,proto3" json:"enableDedup,omitempty"` EnablePartialResponse bool `protobuf:"varint,8,opt,name=enablePartialResponse,proto3" json:"enablePartialResponse,omitempty"` SkipChunks bool `protobuf:"varint,10,opt,name=skipChunks,proto3" json:"skipChunks,omitempty"` @@ -112,2917 +149,823 @@ type QueryRequest struct { Engine EngineType `protobuf:"varint,13,opt,name=engine,proto3,enum=thanos.EngineType" json:"engine,omitempty"` } -func (m *QueryRequest) Reset() { *m = QueryRequest{} } -func (m *QueryRequest) String() string { return proto.CompactTextString(m) } -func (*QueryRequest) ProtoMessage() {} -func (*QueryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_4b2aba43925d729f, []int{1} -} -func (m *QueryRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryRequest.Merge(m, src) -} -func (m *QueryRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryRequest.DiscardUnknown(m) +func (x *QueryRequest) Reset() { + *x = QueryRequest{} + mi := &file_api_query_querypb_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -var xxx_messageInfo_QueryRequest proto.InternalMessageInfo - -type StoreMatchers struct { - LabelMatchers []storepb.LabelMatcher `protobuf:"bytes,1,rep,name=labelMatchers,proto3" json:"labelMatchers"` +func (x *QueryRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *StoreMatchers) Reset() { *m = StoreMatchers{} } -func (m *StoreMatchers) String() string { return proto.CompactTextString(m) } -func (*StoreMatchers) ProtoMessage() {} -func (*StoreMatchers) Descriptor() ([]byte, []int) { - return fileDescriptor_4b2aba43925d729f, []int{2} -} -func (m *StoreMatchers) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StoreMatchers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StoreMatchers.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (*QueryRequest) ProtoMessage() {} + +func (x *QueryRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_query_querypb_query_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *StoreMatchers) XXX_Merge(src proto.Message) { - xxx_messageInfo_StoreMatchers.Merge(m, src) -} -func (m *StoreMatchers) XXX_Size() int { - return m.Size() -} -func (m *StoreMatchers) XXX_DiscardUnknown() { - xxx_messageInfo_StoreMatchers.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_StoreMatchers proto.InternalMessageInfo - -type QueryResponse struct { - // Types that are valid to be assigned to Result: - // *QueryResponse_Warnings - // *QueryResponse_Timeseries - // *QueryResponse_Stats - Result isQueryResponse_Result `protobuf_oneof:"result"` +// Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead. +func (*QueryRequest) Descriptor() ([]byte, []int) { + return file_api_query_querypb_query_proto_rawDescGZIP(), []int{1} } -func (m *QueryResponse) Reset() { *m = QueryResponse{} } -func (m *QueryResponse) String() string { return proto.CompactTextString(m) } -func (*QueryResponse) ProtoMessage() {} -func (*QueryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4b2aba43925d729f, []int{3} -} -func (m *QueryResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *QueryRequest) GetQuery() string { + if x != nil { + return x.Query } -} -func (m *QueryResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryResponse.Merge(m, src) -} -func (m *QueryResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryResponse.DiscardUnknown(m) + return "" } -var xxx_messageInfo_QueryResponse proto.InternalMessageInfo - -type isQueryResponse_Result interface { - isQueryResponse_Result() - MarshalTo([]byte) (int, error) - Size() int +func (x *QueryRequest) GetQueryPlan() *QueryPlan { + if x != nil { + return x.QueryPlan + } + return nil } -type QueryResponse_Warnings struct { - Warnings string `protobuf:"bytes,1,opt,name=warnings,proto3,oneof" json:"warnings,omitempty"` -} -type QueryResponse_Timeseries struct { - Timeseries *prompb.TimeSeries `protobuf:"bytes,2,opt,name=timeseries,proto3,oneof" json:"timeseries,omitempty"` -} -type QueryResponse_Stats struct { - Stats *QueryStats `protobuf:"bytes,3,opt,name=stats,proto3,oneof" json:"stats,omitempty"` +func (x *QueryRequest) GetTimeSeconds() int64 { + if x != nil { + return x.TimeSeconds + } + return 0 } -func (*QueryResponse_Warnings) isQueryResponse_Result() {} -func (*QueryResponse_Timeseries) isQueryResponse_Result() {} -func (*QueryResponse_Stats) isQueryResponse_Result() {} - -func (m *QueryResponse) GetResult() isQueryResponse_Result { - if m != nil { - return m.Result +func (x *QueryRequest) GetTimeoutSeconds() int64 { + if x != nil { + return x.TimeoutSeconds } - return nil + return 0 } -func (m *QueryResponse) GetWarnings() string { - if x, ok := m.GetResult().(*QueryResponse_Warnings); ok { - return x.Warnings +func (x *QueryRequest) GetMaxResolutionSeconds() int64 { + if x != nil { + return x.MaxResolutionSeconds } - return "" + return 0 } -func (m *QueryResponse) GetTimeseries() *prompb.TimeSeries { - if x, ok := m.GetResult().(*QueryResponse_Timeseries); ok { - return x.Timeseries +func (x *QueryRequest) GetReplicaLabels() []string { + if x != nil { + return x.ReplicaLabels } return nil } -func (m *QueryResponse) GetStats() *QueryStats { - if x, ok := m.GetResult().(*QueryResponse_Stats); ok { - return x.Stats +func (x *QueryRequest) GetStoreMatchers() []*StoreMatchers { + if x != nil { + return x.StoreMatchers } return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*QueryResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*QueryResponse_Warnings)(nil), - (*QueryResponse_Timeseries)(nil), - (*QueryResponse_Stats)(nil), +func (x *QueryRequest) GetEnableDedup() bool { + if x != nil { + return x.EnableDedup } + return false } -type QueryPlan struct { - // Types that are valid to be assigned to Encoding: - // *QueryPlan_Json - Encoding isQueryPlan_Encoding `protobuf_oneof:"encoding"` -} - -func (m *QueryPlan) Reset() { *m = QueryPlan{} } -func (m *QueryPlan) String() string { return proto.CompactTextString(m) } -func (*QueryPlan) ProtoMessage() {} -func (*QueryPlan) Descriptor() ([]byte, []int) { - return fileDescriptor_4b2aba43925d729f, []int{4} -} -func (m *QueryPlan) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryPlan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryPlan.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *QueryRequest) GetEnablePartialResponse() bool { + if x != nil { + return x.EnablePartialResponse } + return false } -func (m *QueryPlan) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryPlan.Merge(m, src) -} -func (m *QueryPlan) XXX_Size() int { - return m.Size() -} -func (m *QueryPlan) XXX_DiscardUnknown() { - xxx_messageInfo_QueryPlan.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryPlan proto.InternalMessageInfo -type isQueryPlan_Encoding interface { - isQueryPlan_Encoding() - MarshalTo([]byte) (int, error) - Size() int -} - -type QueryPlan_Json struct { - Json []byte `protobuf:"bytes,1,opt,name=json,proto3,oneof" json:"json,omitempty"` +func (x *QueryRequest) GetSkipChunks() bool { + if x != nil { + return x.SkipChunks + } + return false } -func (*QueryPlan_Json) isQueryPlan_Encoding() {} - -func (m *QueryPlan) GetEncoding() isQueryPlan_Encoding { - if m != nil { - return m.Encoding +func (x *QueryRequest) GetShardInfo() *storepb.ShardInfo { + if x != nil { + return x.ShardInfo } return nil } -func (m *QueryPlan) GetJson() []byte { - if x, ok := m.GetEncoding().(*QueryPlan_Json); ok { - return x.Json +func (x *QueryRequest) GetLookbackDeltaSeconds() int64 { + if x != nil { + return x.LookbackDeltaSeconds } - return nil + return 0 } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*QueryPlan) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*QueryPlan_Json)(nil), +func (x *QueryRequest) GetEngine() EngineType { + if x != nil { + return x.Engine } + return EngineType_default } -type QueryRangeRequest struct { - Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` - QueryPlan *QueryPlan `protobuf:"bytes,16,opt,name=queryPlan,proto3" json:"queryPlan,omitempty"` - StartTimeSeconds int64 `protobuf:"varint,2,opt,name=start_time_seconds,json=startTimeSeconds,proto3" json:"start_time_seconds,omitempty"` - EndTimeSeconds int64 `protobuf:"varint,3,opt,name=end_time_seconds,json=endTimeSeconds,proto3" json:"end_time_seconds,omitempty"` - IntervalSeconds int64 `protobuf:"varint,4,opt,name=interval_seconds,json=intervalSeconds,proto3" json:"interval_seconds,omitempty"` - TimeoutSeconds int64 `protobuf:"varint,5,opt,name=timeout_seconds,json=timeoutSeconds,proto3" json:"timeout_seconds,omitempty"` - MaxResolutionSeconds int64 `protobuf:"varint,6,opt,name=max_resolution_seconds,json=maxResolutionSeconds,proto3" json:"max_resolution_seconds,omitempty"` - ReplicaLabels []string `protobuf:"bytes,7,rep,name=replica_labels,json=replicaLabels,proto3" json:"replica_labels,omitempty"` - StoreMatchers []StoreMatchers `protobuf:"bytes,8,rep,name=storeMatchers,proto3" json:"storeMatchers"` - EnableDedup bool `protobuf:"varint,9,opt,name=enableDedup,proto3" json:"enableDedup,omitempty"` - EnablePartialResponse bool `protobuf:"varint,10,opt,name=enablePartialResponse,proto3" json:"enablePartialResponse,omitempty"` - SkipChunks bool `protobuf:"varint,12,opt,name=skipChunks,proto3" json:"skipChunks,omitempty"` - ShardInfo *storepb.ShardInfo `protobuf:"bytes,13,opt,name=shard_info,json=shardInfo,proto3" json:"shard_info,omitempty"` - LookbackDeltaSeconds int64 `protobuf:"varint,14,opt,name=lookback_delta_seconds,json=lookbackDeltaSeconds,proto3" json:"lookback_delta_seconds,omitempty"` - Engine EngineType `protobuf:"varint,15,opt,name=engine,proto3,enum=thanos.EngineType" json:"engine,omitempty"` -} +type StoreMatchers struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *QueryRangeRequest) Reset() { *m = QueryRangeRequest{} } -func (m *QueryRangeRequest) String() string { return proto.CompactTextString(m) } -func (*QueryRangeRequest) ProtoMessage() {} -func (*QueryRangeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_4b2aba43925d729f, []int{5} -} -func (m *QueryRangeRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryRangeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryRangeRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryRangeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryRangeRequest.Merge(m, src) -} -func (m *QueryRangeRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryRangeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryRangeRequest.DiscardUnknown(m) + LabelMatchers []*storepb.LabelMatcher `protobuf:"bytes,1,rep,name=labelMatchers,proto3" json:"labelMatchers"` } -var xxx_messageInfo_QueryRangeRequest proto.InternalMessageInfo +func (x *StoreMatchers) Reset() { + *x = StoreMatchers{} + mi := &file_api_query_querypb_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -type QueryRangeResponse struct { - // Types that are valid to be assigned to Result: - // *QueryRangeResponse_Warnings - // *QueryRangeResponse_Timeseries - // *QueryRangeResponse_Stats - Result isQueryRangeResponse_Result `protobuf_oneof:"result"` +func (x *StoreMatchers) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *QueryRangeResponse) Reset() { *m = QueryRangeResponse{} } -func (m *QueryRangeResponse) String() string { return proto.CompactTextString(m) } -func (*QueryRangeResponse) ProtoMessage() {} -func (*QueryRangeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4b2aba43925d729f, []int{6} -} -func (m *QueryRangeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryRangeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryRangeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (*StoreMatchers) ProtoMessage() {} + +func (x *StoreMatchers) ProtoReflect() protoreflect.Message { + mi := &file_api_query_querypb_query_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *QueryRangeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryRangeResponse.Merge(m, src) -} -func (m *QueryRangeResponse) XXX_Size() int { - return m.Size() + +// Deprecated: Use StoreMatchers.ProtoReflect.Descriptor instead. +func (*StoreMatchers) Descriptor() ([]byte, []int) { + return file_api_query_querypb_query_proto_rawDescGZIP(), []int{2} } -func (m *QueryRangeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryRangeResponse.DiscardUnknown(m) + +func (x *StoreMatchers) GetLabelMatchers() []*storepb.LabelMatcher { + if x != nil { + return x.LabelMatchers + } + return nil } -var xxx_messageInfo_QueryRangeResponse proto.InternalMessageInfo +type QueryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -type isQueryRangeResponse_Result interface { - isQueryRangeResponse_Result() - MarshalTo([]byte) (int, error) - Size() int + // Types that are assignable to Result: + // + // *QueryResponse_Warnings + // *QueryResponse_Timeseries + // *QueryResponse_Stats + Result isQueryResponse_Result `protobuf_oneof:"result"` } -type QueryRangeResponse_Warnings struct { - Warnings string `protobuf:"bytes,1,opt,name=warnings,proto3,oneof" json:"warnings,omitempty"` +func (x *QueryResponse) Reset() { + *x = QueryResponse{} + mi := &file_api_query_querypb_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -type QueryRangeResponse_Timeseries struct { - Timeseries *prompb.TimeSeries `protobuf:"bytes,2,opt,name=timeseries,proto3,oneof" json:"timeseries,omitempty"` + +func (x *QueryResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -type QueryRangeResponse_Stats struct { - Stats *QueryStats `protobuf:"bytes,3,opt,name=stats,proto3,oneof" json:"stats,omitempty"` + +func (*QueryResponse) ProtoMessage() {} + +func (x *QueryResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_query_querypb_query_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (*QueryRangeResponse_Warnings) isQueryRangeResponse_Result() {} -func (*QueryRangeResponse_Timeseries) isQueryRangeResponse_Result() {} -func (*QueryRangeResponse_Stats) isQueryRangeResponse_Result() {} +// Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead. +func (*QueryResponse) Descriptor() ([]byte, []int) { + return file_api_query_querypb_query_proto_rawDescGZIP(), []int{3} +} -func (m *QueryRangeResponse) GetResult() isQueryRangeResponse_Result { +func (m *QueryResponse) GetResult() isQueryResponse_Result { if m != nil { return m.Result } return nil } -func (m *QueryRangeResponse) GetWarnings() string { - if x, ok := m.GetResult().(*QueryRangeResponse_Warnings); ok { +func (x *QueryResponse) GetWarnings() string { + if x, ok := x.GetResult().(*QueryResponse_Warnings); ok { return x.Warnings } return "" } -func (m *QueryRangeResponse) GetTimeseries() *prompb.TimeSeries { - if x, ok := m.GetResult().(*QueryRangeResponse_Timeseries); ok { +func (x *QueryResponse) GetTimeseries() *prompb.TimeSeries { + if x, ok := x.GetResult().(*QueryResponse_Timeseries); ok { return x.Timeseries } return nil } -func (m *QueryRangeResponse) GetStats() *QueryStats { - if x, ok := m.GetResult().(*QueryRangeResponse_Stats); ok { +func (x *QueryResponse) GetStats() *QueryStats { + if x, ok := x.GetResult().(*QueryResponse_Stats); ok { return x.Stats } return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*QueryRangeResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*QueryRangeResponse_Warnings)(nil), - (*QueryRangeResponse_Timeseries)(nil), - (*QueryRangeResponse_Stats)(nil), - } +type isQueryResponse_Result interface { + isQueryResponse_Result() } -func init() { - proto.RegisterEnum("thanos.EngineType", EngineType_name, EngineType_value) - proto.RegisterType((*QueryStats)(nil), "thanos.QueryStats") - proto.RegisterType((*QueryRequest)(nil), "thanos.QueryRequest") - proto.RegisterType((*StoreMatchers)(nil), "thanos.StoreMatchers") - proto.RegisterType((*QueryResponse)(nil), "thanos.QueryResponse") - proto.RegisterType((*QueryPlan)(nil), "thanos.queryPlan") - proto.RegisterType((*QueryRangeRequest)(nil), "thanos.QueryRangeRequest") - proto.RegisterType((*QueryRangeResponse)(nil), "thanos.QueryRangeResponse") -} - -func init() { proto.RegisterFile("api/query/querypb/query.proto", fileDescriptor_4b2aba43925d729f) } - -var fileDescriptor_4b2aba43925d729f = []byte{ - // 848 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xcf, 0x8e, 0xdb, 0x44, - 0x1c, 0xb6, 0xbb, 0x49, 0x36, 0xf9, 0x39, 0xc9, 0xba, 0xa3, 0x2c, 0xb8, 0x01, 0x82, 0x09, 0xaa, - 0x08, 0x2b, 0xd8, 0x54, 0xa1, 0x70, 0x43, 0x82, 0xa5, 0x95, 0x16, 0x54, 0xa4, 0xd6, 0xc9, 0x89, - 0x8b, 0x35, 0x89, 0x7f, 0x9b, 0x98, 0x38, 0x33, 0xae, 0x67, 0x0c, 0xdd, 0x17, 0xe0, 0xcc, 0x33, - 0x70, 0xe1, 0x15, 0x78, 0x84, 0x3d, 0x56, 0xe2, 0xc2, 0x09, 0xc1, 0xee, 0x8b, 0x20, 0x8f, 0xff, - 0xc4, 0xae, 0x56, 0x90, 0xa8, 0x17, 0x2e, 0xf6, 0xcc, 0xf7, 0x7d, 0x33, 0xe3, 0xdf, 0xe7, 0xdf, - 0x27, 0x1b, 0xde, 0xa1, 0xa1, 0x3f, 0x7e, 0x1e, 0x63, 0x74, 0x99, 0x5e, 0xc3, 0x79, 0x7a, 0x3f, - 0x0d, 0x23, 0x2e, 0x39, 0x69, 0xc8, 0x15, 0x65, 0x5c, 0xf4, 0x7b, 0x4b, 0xbe, 0xe4, 0x0a, 0x1a, - 0x27, 0xa3, 0x94, 0xed, 0xdf, 0x13, 0x92, 0x47, 0x38, 0x56, 0xd7, 0x70, 0x3e, 0x96, 0x97, 0x21, - 0x8a, 0x8c, 0x7a, 0xb3, 0x4a, 0x45, 0xe1, 0x22, 0x23, 0xec, 0x2a, 0x11, 0x46, 0x7c, 0x53, 0x5d, - 0x3a, 0x9c, 0x01, 0x3c, 0x4b, 0x1e, 0x61, 0x2a, 0xa9, 0x14, 0xe4, 0x7d, 0xe8, 0x08, 0xba, 0x09, - 0x03, 0x14, 0xae, 0xe4, 0x92, 0x06, 0x96, 0x6e, 0xeb, 0xa3, 0x03, 0xa7, 0x9d, 0x81, 0xb3, 0x04, - 0x23, 0xef, 0x41, 0x3b, 0x44, 0xba, 0x76, 0x33, 0xd0, 0xba, 0xa3, 0x34, 0x46, 0x82, 0x4d, 0x53, - 0x68, 0xf8, 0x7b, 0x0d, 0xda, 0x6a, 0x5b, 0x07, 0x9f, 0xc7, 0x28, 0x24, 0xe9, 0x41, 0x5d, 0x55, - 0xaa, 0x36, 0x6c, 0x39, 0xe9, 0x84, 0x8c, 0xa1, 0xa5, 0x06, 0x4f, 0x03, 0xca, 0xac, 0xae, 0xad, - 0x8f, 0x8c, 0xc9, 0xdd, 0xd3, 0xd4, 0x84, 0xd3, 0x82, 0x70, 0xb6, 0x9a, 0xe4, 0x68, 0xe9, 0x6f, - 0xd0, 0x15, 0xb8, 0xe0, 0xcc, 0x2b, 0x8e, 0x4e, 0xb0, 0x69, 0x0a, 0x91, 0x0f, 0xe0, 0x28, 0x99, - 0xf2, 0x58, 0x16, 0xaa, 0x03, 0xa5, 0xea, 0x66, 0x70, 0x2e, 0x7c, 0x08, 0x6f, 0x6c, 0xe8, 0x0b, - 0x37, 0x42, 0xc1, 0x83, 0x58, 0xfa, 0x9c, 0x15, 0xfa, 0x9a, 0xd2, 0xf7, 0x36, 0xf4, 0x85, 0x53, - 0x90, 0xf9, 0xaa, 0xfb, 0xd0, 0x8d, 0x30, 0x0c, 0xfc, 0x05, 0x75, 0x03, 0x3a, 0xc7, 0x40, 0x58, - 0x75, 0xfb, 0x60, 0xd4, 0x72, 0x3a, 0x19, 0xfa, 0x44, 0x81, 0xe4, 0x4b, 0xe8, 0x28, 0xd3, 0xbf, - 0xa5, 0x72, 0xb1, 0xc2, 0x48, 0x58, 0x0d, 0xfb, 0x60, 0x64, 0x4c, 0x8e, 0xf3, 0xea, 0xa6, 0x65, - 0xf2, 0xac, 0x76, 0xf5, 0xe7, 0xbb, 0x9a, 0x53, 0x5d, 0x41, 0x6c, 0x30, 0x90, 0xd1, 0x79, 0x80, - 0x8f, 0xd0, 0x8b, 0x43, 0xeb, 0xd0, 0xd6, 0x47, 0x4d, 0xa7, 0x0c, 0x91, 0x87, 0x70, 0x9c, 0x4e, - 0x9f, 0xd2, 0x48, 0xfa, 0x34, 0x70, 0x50, 0x84, 0x9c, 0x09, 0xb4, 0x9a, 0x4a, 0x7b, 0x3b, 0x49, - 0x06, 0x00, 0x62, 0xed, 0x87, 0x5f, 0xad, 0x62, 0xb6, 0x16, 0x16, 0x28, 0x69, 0x09, 0x21, 0x0f, - 0x00, 0xc4, 0x8a, 0x46, 0x9e, 0xeb, 0xb3, 0x0b, 0x6e, 0x19, 0xd5, 0xb7, 0x32, 0x4d, 0x98, 0xaf, - 0xd9, 0x05, 0x77, 0x5a, 0x22, 0x1f, 0x26, 0x4e, 0x06, 0x9c, 0xaf, 0xe7, 0x74, 0xb1, 0x76, 0x3d, - 0x0c, 0x24, 0x2d, 0x9c, 0x6c, 0xa7, 0x4e, 0xe6, 0xec, 0xa3, 0x84, 0xcc, 0x9d, 0x3c, 0x81, 0x06, - 0xb2, 0xa5, 0xcf, 0xd0, 0xea, 0xd8, 0xfa, 0xa8, 0x3b, 0x21, 0xf9, 0x19, 0x8f, 0x15, 0x3a, 0xbb, - 0x0c, 0xd1, 0xc9, 0x14, 0xdf, 0xd4, 0x9a, 0x2d, 0x13, 0x86, 0xcf, 0xa0, 0x53, 0xf1, 0x8d, 0x7c, - 0x01, 0x1d, 0xf5, 0x12, 0x0a, 0x97, 0x75, 0xe5, 0x72, 0x2f, 0xdf, 0xe9, 0x49, 0x89, 0xcc, 0x4d, - 0xae, 0x2c, 0x18, 0xfe, 0xa2, 0x43, 0x27, 0x6b, 0xd4, 0xcc, 0x9e, 0xb7, 0xa1, 0xf9, 0x23, 0x8d, - 0x98, 0xcf, 0x96, 0x22, 0x6d, 0xd6, 0x73, 0xcd, 0x29, 0x10, 0xf2, 0x39, 0x40, 0xd2, 0x46, 0x02, - 0x23, 0x3f, 0xeb, 0x7c, 0x63, 0xf2, 0x56, 0x12, 0xa5, 0x0d, 0xca, 0x15, 0xc6, 0xc2, 0x5d, 0xf0, - 0xf0, 0xf2, 0x74, 0xa6, 0xfa, 0x31, 0x91, 0x9c, 0x6b, 0x4e, 0x69, 0x01, 0x39, 0x81, 0xba, 0x48, - 0x82, 0xa6, 0x5a, 0xd2, 0xd8, 0x96, 0xbc, 0x8d, 0xe0, 0xb9, 0xe6, 0xa4, 0x92, 0xb3, 0x26, 0x34, - 0x22, 0x14, 0x71, 0x20, 0x87, 0x1f, 0x97, 0x62, 0x42, 0x7a, 0x50, 0xfb, 0x5e, 0x70, 0xa6, 0x9e, - 0xad, 0x7d, 0xae, 0x39, 0x6a, 0x76, 0x06, 0xd0, 0x44, 0xb6, 0xe0, 0x9e, 0xcf, 0x96, 0xc3, 0xdf, - 0xea, 0x70, 0x37, 0xad, 0x89, 0xb2, 0x25, 0xee, 0x91, 0x40, 0x73, 0x87, 0x04, 0x7e, 0x04, 0x44, - 0x48, 0x1a, 0x49, 0xf7, 0x96, 0x1c, 0x9a, 0x8a, 0x99, 0x95, 0xc2, 0x38, 0x02, 0x13, 0x99, 0x57, - 0xd5, 0x66, 0x69, 0x44, 0xe6, 0x95, 0x95, 0x1f, 0x82, 0xe9, 0x33, 0x89, 0xd1, 0x0f, 0x34, 0x78, - 0x25, 0x87, 0x47, 0x39, 0xfe, 0x2f, 0x09, 0xaf, 0xef, 0x99, 0xf0, 0xc6, 0x5e, 0x09, 0x3f, 0xdc, - 0x29, 0xe1, 0xcd, 0xd7, 0x4d, 0x78, 0x6b, 0x8f, 0x84, 0xc3, 0xee, 0x09, 0x6f, 0xff, 0x47, 0xc2, - 0x3b, 0xaf, 0x95, 0xf0, 0xee, 0x4e, 0x09, 0x3f, 0xda, 0x21, 0xe1, 0x86, 0xd9, 0x1e, 0xfe, 0xaa, - 0x03, 0x29, 0xb7, 0xee, 0xff, 0x36, 0x93, 0x27, 0x9f, 0x02, 0x6c, 0xab, 0x20, 0x06, 0x1c, 0x7a, - 0x78, 0x41, 0xe3, 0x40, 0x9a, 0x1a, 0xe9, 0x02, 0x6c, 0x0f, 0x37, 0x75, 0x02, 0x90, 0x7d, 0xd8, - 0xcd, 0x3b, 0x93, 0x9f, 0x74, 0xa8, 0xab, 0x8d, 0xc9, 0x67, 0xf9, 0xa0, 0x57, 0x39, 0x30, 0x8b, - 0x6b, 0xff, 0xf8, 0x15, 0x34, 0x75, 0xe2, 0x81, 0x4e, 0x1e, 0x67, 0x1f, 0x6c, 0xe5, 0x10, 0xb9, - 0x57, 0x95, 0x95, 0x02, 0xdf, 0xef, 0xdf, 0x46, 0xe5, 0xdb, 0x9c, 0xdd, 0xbf, 0xfa, 0x7b, 0xa0, - 0x5d, 0x5d, 0x0f, 0xf4, 0x97, 0xd7, 0x03, 0xfd, 0xaf, 0xeb, 0x81, 0xfe, 0xf3, 0xcd, 0x40, 0x7b, - 0x79, 0x33, 0xd0, 0xfe, 0xb8, 0x19, 0x68, 0xdf, 0x1d, 0x66, 0xbf, 0x27, 0xf3, 0x86, 0xfa, 0x4b, - 0xf8, 0xe4, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x44, 0xb0, 0xce, 0xba, 0x08, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (Query_QueryClient, error) - QueryRange(ctx context.Context, in *QueryRangeRequest, opts ...grpc.CallOption) (Query_QueryRangeClient, error) -} - -type queryClient struct { - cc *grpc.ClientConn -} - -func NewQueryClient(cc *grpc.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (Query_QueryClient, error) { - stream, err := c.cc.NewStream(ctx, &_Query_serviceDesc.Streams[0], "/thanos.Query/Query", opts...) - if err != nil { - return nil, err - } - x := &queryQueryClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil +type QueryResponse_Warnings struct { + // / warnings are additional messages coming from the PromQL engine. + Warnings string `protobuf:"bytes,1,opt,name=warnings,proto3,oneof"` } -type Query_QueryClient interface { - Recv() (*QueryResponse, error) - grpc.ClientStream +type QueryResponse_Timeseries struct { + // / timeseries is one series from the result of the executed query. + Timeseries *prompb.TimeSeries `protobuf:"bytes,2,opt,name=timeseries,proto3,oneof"` } -type queryQueryClient struct { - grpc.ClientStream +type QueryResponse_Stats struct { + // performance stats + Stats *QueryStats `protobuf:"bytes,3,opt,name=stats,proto3,oneof"` } -func (x *queryQueryClient) Recv() (*QueryResponse, error) { - m := new(QueryResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +func (*QueryResponse_Warnings) isQueryResponse_Result() {} -func (c *queryClient) QueryRange(ctx context.Context, in *QueryRangeRequest, opts ...grpc.CallOption) (Query_QueryRangeClient, error) { - stream, err := c.cc.NewStream(ctx, &_Query_serviceDesc.Streams[1], "/thanos.Query/QueryRange", opts...) - if err != nil { - return nil, err - } - x := &queryQueryRangeClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} +func (*QueryResponse_Timeseries) isQueryResponse_Result() {} -type Query_QueryRangeClient interface { - Recv() (*QueryRangeResponse, error) - grpc.ClientStream -} +func (*QueryResponse_Stats) isQueryResponse_Result() {} -type queryQueryRangeClient struct { - grpc.ClientStream -} +type QueryPlan struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (x *queryQueryRangeClient) Recv() (*QueryRangeResponse, error) { - m := new(QueryRangeResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil + // Types that are assignable to Encoding: + // + // *QueryPlan_Json + Encoding isQueryPlan_Encoding `protobuf_oneof:"encoding"` } -// QueryServer is the server API for Query service. -type QueryServer interface { - Query(*QueryRequest, Query_QueryServer) error - QueryRange(*QueryRangeRequest, Query_QueryRangeServer) error +func (x *QueryPlan) Reset() { + *x = QueryPlan{} + mi := &file_api_query_querypb_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { +func (x *QueryPlan) String() string { + return protoimpl.X.MessageStringOf(x) } -func (*UnimplementedQueryServer) Query(req *QueryRequest, srv Query_QueryServer) error { - return status.Errorf(codes.Unimplemented, "method Query not implemented") -} -func (*UnimplementedQueryServer) QueryRange(req *QueryRangeRequest, srv Query_QueryRangeServer) error { - return status.Errorf(codes.Unimplemented, "method QueryRange not implemented") +func (*QueryPlan) ProtoMessage() {} + +func (x *QueryPlan) ProtoReflect() protoreflect.Message { + mi := &file_api_query_querypb_query_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func RegisterQueryServer(s *grpc.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) +// Deprecated: Use QueryPlan.ProtoReflect.Descriptor instead. +func (*QueryPlan) Descriptor() ([]byte, []int) { + return file_api_query_querypb_query_proto_rawDescGZIP(), []int{4} } -func _Query_Query_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(QueryRequest) - if err := stream.RecvMsg(m); err != nil { - return err +func (m *QueryPlan) GetEncoding() isQueryPlan_Encoding { + if m != nil { + return m.Encoding } - return srv.(QueryServer).Query(m, &queryQueryServer{stream}) + return nil } -type Query_QueryServer interface { - Send(*QueryResponse) error - grpc.ServerStream +func (x *QueryPlan) GetJson() []byte { + if x, ok := x.GetEncoding().(*QueryPlan_Json); ok { + return x.Json + } + return nil } -type queryQueryServer struct { - grpc.ServerStream +type isQueryPlan_Encoding interface { + isQueryPlan_Encoding() } -func (x *queryQueryServer) Send(m *QueryResponse) error { - return x.ServerStream.SendMsg(m) +type QueryPlan_Json struct { + Json []byte `protobuf:"bytes,1,opt,name=json,proto3,oneof"` } -func _Query_QueryRange_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(QueryRangeRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(QueryServer).QueryRange(m, &queryQueryRangeServer{stream}) -} +func (*QueryPlan_Json) isQueryPlan_Encoding() {} -type Query_QueryRangeServer interface { - Send(*QueryRangeResponse) error - grpc.ServerStream -} +type QueryRangeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -type queryQueryRangeServer struct { - grpc.ServerStream + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + QueryPlan *QueryPlan `protobuf:"bytes,16,opt,name=queryPlan,proto3" json:"queryPlan,omitempty"` + StartTimeSeconds int64 `protobuf:"varint,2,opt,name=start_time_seconds,json=startTimeSeconds,proto3" json:"start_time_seconds,omitempty"` + EndTimeSeconds int64 `protobuf:"varint,3,opt,name=end_time_seconds,json=endTimeSeconds,proto3" json:"end_time_seconds,omitempty"` + IntervalSeconds int64 `protobuf:"varint,4,opt,name=interval_seconds,json=intervalSeconds,proto3" json:"interval_seconds,omitempty"` + TimeoutSeconds int64 `protobuf:"varint,5,opt,name=timeout_seconds,json=timeoutSeconds,proto3" json:"timeout_seconds,omitempty"` + MaxResolutionSeconds int64 `protobuf:"varint,6,opt,name=max_resolution_seconds,json=maxResolutionSeconds,proto3" json:"max_resolution_seconds,omitempty"` + ReplicaLabels []string `protobuf:"bytes,7,rep,name=replica_labels,json=replicaLabels,proto3" json:"replica_labels,omitempty"` + StoreMatchers []*StoreMatchers `protobuf:"bytes,8,rep,name=storeMatchers,proto3" json:"storeMatchers"` + EnableDedup bool `protobuf:"varint,9,opt,name=enableDedup,proto3" json:"enableDedup,omitempty"` + EnablePartialResponse bool `protobuf:"varint,10,opt,name=enablePartialResponse,proto3" json:"enablePartialResponse,omitempty"` + SkipChunks bool `protobuf:"varint,12,opt,name=skipChunks,proto3" json:"skipChunks,omitempty"` + ShardInfo *storepb.ShardInfo `protobuf:"bytes,13,opt,name=shard_info,json=shardInfo,proto3" json:"shard_info,omitempty"` + LookbackDeltaSeconds int64 `protobuf:"varint,14,opt,name=lookback_delta_seconds,json=lookbackDeltaSeconds,proto3" json:"lookback_delta_seconds,omitempty"` + Engine EngineType `protobuf:"varint,15,opt,name=engine,proto3,enum=thanos.EngineType" json:"engine,omitempty"` } -func (x *queryQueryRangeServer) Send(m *QueryRangeResponse) error { - return x.ServerStream.SendMsg(m) +func (x *QueryRangeRequest) Reset() { + *x = QueryRangeRequest{} + mi := &file_api_query_querypb_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "thanos.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Query", - Handler: _Query_Query_Handler, - ServerStreams: true, - }, - { - StreamName: "QueryRange", - Handler: _Query_QueryRange_Handler, - ServerStreams: true, - }, - }, - Metadata: "api/query/querypb/query.proto", +func (x *QueryRangeRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *QueryStats) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (*QueryRangeRequest) ProtoMessage() {} + +func (x *QueryRangeRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_query_querypb_query_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *QueryStats) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use QueryRangeRequest.ProtoReflect.Descriptor instead. +func (*QueryRangeRequest) Descriptor() ([]byte, []int) { + return file_api_query_querypb_query_proto_rawDescGZIP(), []int{5} } -func (m *QueryStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PeakSamples != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.PeakSamples)) - i-- - dAtA[i] = 0x10 - } - if m.SamplesTotal != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.SamplesTotal)) - i-- - dAtA[i] = 0x8 +func (x *QueryRangeRequest) GetQuery() string { + if x != nil { + return x.Query } - return len(dAtA) - i, nil + return "" } -func (m *QueryRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.QueryPlan != nil { - { - size, err := m.QueryPlan.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x72 - } - if m.Engine != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Engine)) - i-- - dAtA[i] = 0x68 - } - if m.LookbackDeltaSeconds != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.LookbackDeltaSeconds)) - i-- - dAtA[i] = 0x60 - } - if m.ShardInfo != nil { - { - size, err := m.ShardInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - } - if m.SkipChunks { - i-- - if m.SkipChunks { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x50 - } - if m.EnablePartialResponse { - i-- - if m.EnablePartialResponse { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - if m.EnableDedup { - i-- - if m.EnableDedup { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - } - if len(m.StoreMatchers) > 0 { - for iNdEx := len(m.StoreMatchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.StoreMatchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if len(m.ReplicaLabels) > 0 { - for iNdEx := len(m.ReplicaLabels) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ReplicaLabels[iNdEx]) - copy(dAtA[i:], m.ReplicaLabels[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ReplicaLabels[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if m.MaxResolutionSeconds != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.MaxResolutionSeconds)) - i-- - dAtA[i] = 0x20 - } - if m.TimeoutSeconds != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.TimeoutSeconds)) - i-- - dAtA[i] = 0x18 +func (x *QueryRangeRequest) GetQueryPlan() *QueryPlan { + if x != nil { + return x.QueryPlan } - if m.TimeSeconds != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.TimeSeconds)) - i-- - dAtA[i] = 0x10 - } - if len(m.Query) > 0 { - i -= len(m.Query) - copy(dAtA[i:], m.Query) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Query))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return nil } -func (m *StoreMatchers) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *QueryRangeRequest) GetStartTimeSeconds() int64 { + if x != nil { + return x.StartTimeSeconds } - return dAtA[:n], nil -} - -func (m *StoreMatchers) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StoreMatchers) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.LabelMatchers) > 0 { - for iNdEx := len(m.LabelMatchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.LabelMatchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil + return 0 } -func (m *QueryResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Result != nil { - { - size := m.Result.Size() - i -= size - if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *QueryResponse_Warnings) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryResponse_Warnings) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.Warnings) - copy(dAtA[i:], m.Warnings) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Warnings))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} -func (m *QueryResponse_Timeseries) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryResponse_Timeseries) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Timeseries != nil { - { - size, err := m.Timeseries.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *QueryResponse_Stats) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryResponse_Stats) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Stats != nil { - { - size, err := m.Stats.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *QueryPlan) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryPlan) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryPlan) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Encoding != nil { - { - size := m.Encoding.Size() - i -= size - if _, err := m.Encoding.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } +func (x *QueryRangeRequest) GetEndTimeSeconds() int64 { + if x != nil { + return x.EndTimeSeconds } - return len(dAtA) - i, nil + return 0 } -func (m *QueryPlan_Json) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *QueryRangeRequest) GetIntervalSeconds() int64 { + if x != nil { + return x.IntervalSeconds + } + return 0 } -func (m *QueryPlan_Json) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Json != nil { - i -= len(m.Json) - copy(dAtA[i:], m.Json) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Json))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *QueryRangeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryRangeRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryRangeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.QueryPlan != nil { - { - size, err := m.QueryPlan.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 +func (x *QueryRangeRequest) GetTimeoutSeconds() int64 { + if x != nil { + return x.TimeoutSeconds } - if m.Engine != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Engine)) - i-- - dAtA[i] = 0x78 - } - if m.LookbackDeltaSeconds != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.LookbackDeltaSeconds)) - i-- - dAtA[i] = 0x70 - } - if m.ShardInfo != nil { - { - size, err := m.ShardInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a - } - if m.SkipChunks { - i-- - if m.SkipChunks { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x60 - } - if m.EnablePartialResponse { - i-- - if m.EnablePartialResponse { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x50 - } - if m.EnableDedup { - i-- - if m.EnableDedup { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x48 - } - if len(m.StoreMatchers) > 0 { - for iNdEx := len(m.StoreMatchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.StoreMatchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - } - if len(m.ReplicaLabels) > 0 { - for iNdEx := len(m.ReplicaLabels) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ReplicaLabels[iNdEx]) - copy(dAtA[i:], m.ReplicaLabels[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ReplicaLabels[iNdEx]))) - i-- - dAtA[i] = 0x3a - } - } - if m.MaxResolutionSeconds != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.MaxResolutionSeconds)) - i-- - dAtA[i] = 0x30 - } - if m.TimeoutSeconds != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.TimeoutSeconds)) - i-- - dAtA[i] = 0x28 - } - if m.IntervalSeconds != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.IntervalSeconds)) - i-- - dAtA[i] = 0x20 - } - if m.EndTimeSeconds != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.EndTimeSeconds)) - i-- - dAtA[i] = 0x18 - } - if m.StartTimeSeconds != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.StartTimeSeconds)) - i-- - dAtA[i] = 0x10 - } - if len(m.Query) > 0 { - i -= len(m.Query) - copy(dAtA[i:], m.Query) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Query))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return 0 } -func (m *QueryRangeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *QueryRangeRequest) GetMaxResolutionSeconds() int64 { + if x != nil { + return x.MaxResolutionSeconds } - return dAtA[:n], nil -} - -func (m *QueryRangeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryRangeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Result != nil { - { - size := m.Result.Size() - i -= size - if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *QueryRangeResponse_Warnings) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryRangeResponse_Warnings) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.Warnings) - copy(dAtA[i:], m.Warnings) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Warnings))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} -func (m *QueryRangeResponse_Timeseries) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryRangeResponse_Timeseries) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Timeseries != nil { - { - size, err := m.Timeseries.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *QueryRangeResponse_Stats) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryRangeResponse_Stats) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Stats != nil { - { - size, err := m.Stats.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base + return 0 } -func (m *QueryStats) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SamplesTotal != 0 { - n += 1 + sovQuery(uint64(m.SamplesTotal)) - } - if m.PeakSamples != 0 { - n += 1 + sovQuery(uint64(m.PeakSamples)) + +func (x *QueryRangeRequest) GetReplicaLabels() []string { + if x != nil { + return x.ReplicaLabels } - return n + return nil } -func (m *QueryRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Query) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.TimeSeconds != 0 { - n += 1 + sovQuery(uint64(m.TimeSeconds)) - } - if m.TimeoutSeconds != 0 { - n += 1 + sovQuery(uint64(m.TimeoutSeconds)) - } - if m.MaxResolutionSeconds != 0 { - n += 1 + sovQuery(uint64(m.MaxResolutionSeconds)) - } - if len(m.ReplicaLabels) > 0 { - for _, s := range m.ReplicaLabels { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - if len(m.StoreMatchers) > 0 { - for _, e := range m.StoreMatchers { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.EnableDedup { - n += 2 - } - if m.EnablePartialResponse { - n += 2 - } - if m.SkipChunks { - n += 2 - } - if m.ShardInfo != nil { - l = m.ShardInfo.Size() - n += 1 + l + sovQuery(uint64(l)) +func (x *QueryRangeRequest) GetStoreMatchers() []*StoreMatchers { + if x != nil { + return x.StoreMatchers } - if m.LookbackDeltaSeconds != 0 { - n += 1 + sovQuery(uint64(m.LookbackDeltaSeconds)) - } - if m.Engine != 0 { - n += 1 + sovQuery(uint64(m.Engine)) - } - if m.QueryPlan != nil { - l = m.QueryPlan.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + return nil } -func (m *StoreMatchers) Size() (n int) { - if m == nil { - return 0 +func (x *QueryRangeRequest) GetEnableDedup() bool { + if x != nil { + return x.EnableDedup } - var l int - _ = l - if len(m.LabelMatchers) > 0 { - for _, e := range m.LabelMatchers { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n + return false } -func (m *QueryResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Result != nil { - n += m.Result.Size() +func (x *QueryRangeRequest) GetEnablePartialResponse() bool { + if x != nil { + return x.EnablePartialResponse } - return n + return false } -func (m *QueryResponse_Warnings) Size() (n int) { - if m == nil { - return 0 +func (x *QueryRangeRequest) GetSkipChunks() bool { + if x != nil { + return x.SkipChunks } - var l int - _ = l - l = len(m.Warnings) - n += 1 + l + sovQuery(uint64(l)) - return n -} -func (m *QueryResponse_Timeseries) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Timeseries != nil { - l = m.Timeseries.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + return false } -func (m *QueryResponse_Stats) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Stats != nil { - l = m.Stats.Size() - n += 1 + l + sovQuery(uint64(l)) + +func (x *QueryRangeRequest) GetShardInfo() *storepb.ShardInfo { + if x != nil { + return x.ShardInfo } - return n + return nil } -func (m *QueryPlan) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Encoding != nil { - n += m.Encoding.Size() + +func (x *QueryRangeRequest) GetLookbackDeltaSeconds() int64 { + if x != nil { + return x.LookbackDeltaSeconds } - return n + return 0 } -func (m *QueryPlan_Json) Size() (n int) { - if m == nil { - return 0 +func (x *QueryRangeRequest) GetEngine() EngineType { + if x != nil { + return x.Engine } - var l int - _ = l - if m.Json != nil { - l = len(m.Json) - n += 1 + l + sovQuery(uint64(l)) - } - return n + return EngineType_default } -func (m *QueryRangeRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Query) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.StartTimeSeconds != 0 { - n += 1 + sovQuery(uint64(m.StartTimeSeconds)) - } - if m.EndTimeSeconds != 0 { - n += 1 + sovQuery(uint64(m.EndTimeSeconds)) - } - if m.IntervalSeconds != 0 { - n += 1 + sovQuery(uint64(m.IntervalSeconds)) - } - if m.TimeoutSeconds != 0 { - n += 1 + sovQuery(uint64(m.TimeoutSeconds)) - } - if m.MaxResolutionSeconds != 0 { - n += 1 + sovQuery(uint64(m.MaxResolutionSeconds)) - } - if len(m.ReplicaLabels) > 0 { - for _, s := range m.ReplicaLabels { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - if len(m.StoreMatchers) > 0 { - for _, e := range m.StoreMatchers { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.EnableDedup { - n += 2 - } - if m.EnablePartialResponse { - n += 2 - } - if m.SkipChunks { - n += 2 - } - if m.ShardInfo != nil { - l = m.ShardInfo.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.LookbackDeltaSeconds != 0 { - n += 1 + sovQuery(uint64(m.LookbackDeltaSeconds)) - } - if m.Engine != 0 { - n += 1 + sovQuery(uint64(m.Engine)) - } - if m.QueryPlan != nil { - l = m.QueryPlan.Size() - n += 2 + l + sovQuery(uint64(l)) - } - return n + +type QueryRangeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Result: + // + // *QueryRangeResponse_Warnings + // *QueryRangeResponse_Timeseries + // *QueryRangeResponse_Stats + Result isQueryRangeResponse_Result `protobuf_oneof:"result"` } -func (m *QueryRangeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Result != nil { - n += m.Result.Size() - } - return n +func (x *QueryRangeResponse) Reset() { + *x = QueryRangeResponse{} + mi := &file_api_query_querypb_query_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *QueryRangeResponse_Warnings) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Warnings) - n += 1 + l + sovQuery(uint64(l)) - return n -} -func (m *QueryRangeResponse_Timeseries) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Timeseries != nil { - l = m.Timeseries.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n +func (x *QueryRangeResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *QueryRangeResponse_Stats) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Stats != nil { - l = m.Stats.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *QueryStats) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryStats: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryStats: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SamplesTotal", wireType) - } - m.SamplesTotal = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SamplesTotal |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PeakSamples", wireType) - } - m.PeakSamples = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PeakSamples |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + +func (*QueryRangeResponse) ProtoMessage() {} + +func (x *QueryRangeResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_query_querypb_query_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } + return mi.MessageOf(x) +} - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +// Deprecated: Use QueryRangeResponse.ProtoReflect.Descriptor instead. +func (*QueryRangeResponse) Descriptor() ([]byte, []int) { + return file_api_query_querypb_query_proto_rawDescGZIP(), []int{6} } -func (m *QueryRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Query = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeSeconds", wireType) - } - m.TimeSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TimeSeconds |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeoutSeconds", wireType) - } - m.TimeoutSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TimeoutSeconds |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxResolutionSeconds", wireType) - } - m.MaxResolutionSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxResolutionSeconds |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ReplicaLabels", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ReplicaLabels = append(m.ReplicaLabels, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StoreMatchers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StoreMatchers = append(m.StoreMatchers, StoreMatchers{}) - if err := m.StoreMatchers[len(m.StoreMatchers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EnableDedup", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.EnableDedup = bool(v != 0) - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EnablePartialResponse", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.EnablePartialResponse = bool(v != 0) - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SkipChunks", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.SkipChunks = bool(v != 0) - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShardInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ShardInfo == nil { - m.ShardInfo = &storepb.ShardInfo{} - } - if err := m.ShardInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LookbackDeltaSeconds", wireType) - } - m.LookbackDeltaSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LookbackDeltaSeconds |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Engine", wireType) - } - m.Engine = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Engine |= EngineType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QueryPlan", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.QueryPlan == nil { - m.QueryPlan = &QueryPlan{} - } - if err := m.QueryPlan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (m *QueryRangeResponse) GetResult() isQueryRangeResponse_Result { + if m != nil { + return m.Result } return nil } -func (m *StoreMatchers) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StoreMatchers: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StoreMatchers: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LabelMatchers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LabelMatchers = append(m.LabelMatchers, storepb.LabelMatcher{}) - if err := m.LabelMatchers[len(m.LabelMatchers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *QueryRangeResponse) GetWarnings() string { + if x, ok := x.GetResult().(*QueryRangeResponse_Warnings); ok { + return x.Warnings } - return nil + return "" } -func (m *QueryResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Warnings", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Result = &QueryResponse_Warnings{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &prompb.TimeSeries{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Result = &QueryResponse_Timeseries{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &QueryStats{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Result = &QueryResponse_Stats{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *QueryRangeResponse) GetTimeseries() *prompb.TimeSeries { + if x, ok := x.GetResult().(*QueryRangeResponse_Timeseries); ok { + return x.Timeseries } return nil } -func (m *QueryPlan) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: queryPlan: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: queryPlan: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Json", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := make([]byte, postIndex-iNdEx) - copy(v, dAtA[iNdEx:postIndex]) - m.Encoding = &QueryPlan_Json{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *QueryRangeResponse) GetStats() *QueryStats { + if x, ok := x.GetResult().(*QueryRangeResponse_Stats); ok { + return x.Stats } return nil } -func (m *QueryRangeRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryRangeRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryRangeRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Query = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTimeSeconds", wireType) - } - m.StartTimeSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartTimeSeconds |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTimeSeconds", wireType) - } - m.EndTimeSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EndTimeSeconds |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IntervalSeconds", wireType) - } - m.IntervalSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.IntervalSeconds |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeoutSeconds", wireType) - } - m.TimeoutSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TimeoutSeconds |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxResolutionSeconds", wireType) - } - m.MaxResolutionSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxResolutionSeconds |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ReplicaLabels", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ReplicaLabels = append(m.ReplicaLabels, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StoreMatchers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StoreMatchers = append(m.StoreMatchers, StoreMatchers{}) - if err := m.StoreMatchers[len(m.StoreMatchers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EnableDedup", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.EnableDedup = bool(v != 0) - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EnablePartialResponse", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.EnablePartialResponse = bool(v != 0) - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SkipChunks", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.SkipChunks = bool(v != 0) - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShardInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ShardInfo == nil { - m.ShardInfo = &storepb.ShardInfo{} - } - if err := m.ShardInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LookbackDeltaSeconds", wireType) - } - m.LookbackDeltaSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LookbackDeltaSeconds |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Engine", wireType) - } - m.Engine = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Engine |= EngineType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QueryPlan", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.QueryPlan == nil { - m.QueryPlan = &QueryPlan{} - } - if err := m.QueryPlan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +type isQueryRangeResponse_Result interface { + isQueryRangeResponse_Result() } -func (m *QueryRangeResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryRangeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryRangeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Warnings", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Result = &QueryRangeResponse_Warnings{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &prompb.TimeSeries{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Result = &QueryRangeResponse_Timeseries{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &QueryStats{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Result = &QueryRangeResponse_Stats{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +type QueryRangeResponse_Warnings struct { + // / warnings are additional messages coming from the PromQL engine. + Warnings string `protobuf:"bytes,1,opt,name=warnings,proto3,oneof"` } -func skipQuery(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF + +type QueryRangeResponse_Timeseries struct { + // / timeseries is one series from the result of the executed query. + Timeseries *prompb.TimeSeries `protobuf:"bytes,2,opt,name=timeseries,proto3,oneof"` +} + +type QueryRangeResponse_Stats struct { + // performance stats + Stats *QueryStats `protobuf:"bytes,3,opt,name=stats,proto3,oneof"` +} + +func (*QueryRangeResponse_Warnings) isQueryRangeResponse_Result() {} + +func (*QueryRangeResponse_Timeseries) isQueryRangeResponse_Result() {} + +func (*QueryRangeResponse_Stats) isQueryRangeResponse_Result() {} + +var File_api_query_querypb_query_proto protoreflect.FileDescriptor + +var file_api_query_querypb_query_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x61, 0x70, 0x69, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x70, 0x62, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x06, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x1a, 0x19, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x17, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, + 0x62, 0x2f, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2f, 0x70, 0x72, 0x6f, 0x6d, 0x70, + 0x62, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x74, + 0x61, 0x67, 0x67, 0x65, 0x72, 0x2f, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x54, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, + 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x5f, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, + 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x65, 0x61, 0x6b, 0x5f, 0x73, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x70, 0x65, 0x61, + 0x6b, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x22, 0xe8, 0x04, 0x0a, 0x0c, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, + 0x2f, 0x0a, 0x09, 0x71, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x6e, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x09, 0x71, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x6e, + 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x63, 0x6f, + 0x6e, 0x64, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, + 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x74, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x34, 0x0a, 0x16, + 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, + 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x14, 0x6d, 0x61, + 0x78, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x6f, 0x6e, + 0x64, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x5f, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x56, 0x0a, 0x0d, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x15, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4d, + 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x42, 0x19, 0x9a, 0x84, 0x9e, 0x03, 0x14, 0x6a, 0x73, + 0x6f, 0x6e, 0x3a, 0x22, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, + 0x73, 0x22, 0x52, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, + 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x64, 0x75, 0x70, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, + 0x64, 0x75, 0x70, 0x12, 0x34, 0x0a, 0x15, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x61, 0x72, + 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x15, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x6b, 0x69, + 0x70, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, + 0x6b, 0x69, 0x70, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x12, 0x30, 0x0a, 0x0a, 0x73, 0x68, 0x61, + 0x72, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x09, 0x73, 0x68, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x34, 0x0a, 0x16, 0x6c, + 0x6f, 0x6f, 0x6b, 0x62, 0x61, 0x63, 0x6b, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x5f, 0x73, 0x65, + 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x14, 0x6c, 0x6f, 0x6f, + 0x6b, 0x62, 0x61, 0x63, 0x6b, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, + 0x73, 0x12, 0x2a, 0x0a, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x12, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x4a, 0x04, 0x08, + 0x09, 0x10, 0x0a, 0x22, 0x66, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x72, 0x73, 0x12, 0x55, 0x0a, 0x0d, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x74, 0x68, + 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x72, 0x42, 0x19, 0x9a, 0x84, 0x9e, 0x03, 0x14, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x22, 0x52, 0x0d, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x22, 0xa2, 0x01, 0x0a, 0x0d, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, + 0x08, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x08, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3d, 0x0a, 0x0a, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x70, + 0x79, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x48, 0x00, 0x52, 0x0a, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x68, 0x61, 0x6e, + 0x6f, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x48, 0x00, 0x52, + 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x22, 0x2d, 0x0a, 0x09, 0x71, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x14, 0x0a, + 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x04, 0x6a, + 0x73, 0x6f, 0x6e, 0x42, 0x0a, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x22, + 0xcd, 0x05, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2f, 0x0a, 0x09, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, + 0x6e, 0x52, 0x09, 0x71, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x2c, 0x0a, 0x12, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, + 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, + 0x69, 0x6d, 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x28, 0x0a, 0x10, 0x65, 0x6e, + 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x63, + 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, + 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, + 0x27, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, + 0x64, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x6d, 0x61, 0x78, 0x5f, + 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, + 0x64, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x14, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x73, + 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x25, + 0x0a, 0x0e, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x56, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, + 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, + 0x65, 0x72, 0x73, 0x42, 0x19, 0x9a, 0x84, 0x9e, 0x03, 0x14, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x22, 0x52, 0x0d, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x12, 0x20, 0x0a, + 0x0b, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x64, 0x75, 0x70, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0b, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x64, 0x75, 0x70, 0x12, + 0x34, 0x0a, 0x15, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x6b, 0x69, 0x70, 0x43, 0x68, 0x75, + 0x6e, 0x6b, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, 0x6b, 0x69, 0x70, 0x43, + 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x12, 0x30, 0x0a, 0x0a, 0x73, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x69, + 0x6e, 0x66, 0x6f, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x68, 0x61, 0x6e, + 0x6f, 0x73, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x73, 0x68, + 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x34, 0x0a, 0x16, 0x6c, 0x6f, 0x6f, 0x6b, 0x62, + 0x61, 0x63, 0x6b, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, + 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x14, 0x6c, 0x6f, 0x6f, 0x6b, 0x62, 0x61, 0x63, + 0x6b, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x2a, 0x0a, + 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, + 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x4a, 0x04, 0x08, 0x0b, 0x10, 0x0c, 0x22, + 0xa7, 0x01, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x08, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, + 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x77, 0x61, 0x72, 0x6e, + 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3d, 0x0a, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x65, 0x72, 0x69, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, + 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x53, + 0x65, 0x72, 0x69, 0x65, 0x73, 0x48, 0x00, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x65, 0x72, + 0x69, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x48, 0x00, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x42, + 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2a, 0x35, 0x0a, 0x0a, 0x45, 0x6e, 0x67, + 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, + 0x75, 0x73, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x10, 0x02, + 0x32, 0x86, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x36, 0x0a, 0x05, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x12, 0x14, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x74, 0x68, 0x61, 0x6e, + 0x6f, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x30, 0x01, 0x12, 0x45, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x12, 0x19, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, + 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x74, 0x68, + 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2d, 0x69, + 0x6f, 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") + file_api_query_querypb_query_proto_rawDescOnce sync.Once + file_api_query_querypb_query_proto_rawDescData = file_api_query_querypb_query_proto_rawDesc ) + +func file_api_query_querypb_query_proto_rawDescGZIP() []byte { + file_api_query_querypb_query_proto_rawDescOnce.Do(func() { + file_api_query_querypb_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_query_querypb_query_proto_rawDescData) + }) + return file_api_query_querypb_query_proto_rawDescData +} + +var file_api_query_querypb_query_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_api_query_querypb_query_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_api_query_querypb_query_proto_goTypes = []any{ + (EngineType)(0), // 0: thanos.EngineType + (*QueryStats)(nil), // 1: thanos.QueryStats + (*QueryRequest)(nil), // 2: thanos.QueryRequest + (*StoreMatchers)(nil), // 3: thanos.StoreMatchers + (*QueryResponse)(nil), // 4: thanos.QueryResponse + (*QueryPlan)(nil), // 5: thanos.queryPlan + (*QueryRangeRequest)(nil), // 6: thanos.QueryRangeRequest + (*QueryRangeResponse)(nil), // 7: thanos.QueryRangeResponse + (*storepb.ShardInfo)(nil), // 8: thanos.ShardInfo + (*storepb.LabelMatcher)(nil), // 9: thanos.LabelMatcher + (*prompb.TimeSeries)(nil), // 10: prometheus_copy.TimeSeries +} +var file_api_query_querypb_query_proto_depIdxs = []int32{ + 5, // 0: thanos.QueryRequest.queryPlan:type_name -> thanos.queryPlan + 3, // 1: thanos.QueryRequest.storeMatchers:type_name -> thanos.StoreMatchers + 8, // 2: thanos.QueryRequest.shard_info:type_name -> thanos.ShardInfo + 0, // 3: thanos.QueryRequest.engine:type_name -> thanos.EngineType + 9, // 4: thanos.StoreMatchers.labelMatchers:type_name -> thanos.LabelMatcher + 10, // 5: thanos.QueryResponse.timeseries:type_name -> prometheus_copy.TimeSeries + 1, // 6: thanos.QueryResponse.stats:type_name -> thanos.QueryStats + 5, // 7: thanos.QueryRangeRequest.queryPlan:type_name -> thanos.queryPlan + 3, // 8: thanos.QueryRangeRequest.storeMatchers:type_name -> thanos.StoreMatchers + 8, // 9: thanos.QueryRangeRequest.shard_info:type_name -> thanos.ShardInfo + 0, // 10: thanos.QueryRangeRequest.engine:type_name -> thanos.EngineType + 10, // 11: thanos.QueryRangeResponse.timeseries:type_name -> prometheus_copy.TimeSeries + 1, // 12: thanos.QueryRangeResponse.stats:type_name -> thanos.QueryStats + 2, // 13: thanos.Query.Query:input_type -> thanos.QueryRequest + 6, // 14: thanos.Query.QueryRange:input_type -> thanos.QueryRangeRequest + 4, // 15: thanos.Query.Query:output_type -> thanos.QueryResponse + 7, // 16: thanos.Query.QueryRange:output_type -> thanos.QueryRangeResponse + 15, // [15:17] is the sub-list for method output_type + 13, // [13:15] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name +} + +func init() { file_api_query_querypb_query_proto_init() } +func file_api_query_querypb_query_proto_init() { + if File_api_query_querypb_query_proto != nil { + return + } + file_api_query_querypb_query_proto_msgTypes[3].OneofWrappers = []any{ + (*QueryResponse_Warnings)(nil), + (*QueryResponse_Timeseries)(nil), + (*QueryResponse_Stats)(nil), + } + file_api_query_querypb_query_proto_msgTypes[4].OneofWrappers = []any{ + (*QueryPlan_Json)(nil), + } + file_api_query_querypb_query_proto_msgTypes[6].OneofWrappers = []any{ + (*QueryRangeResponse_Warnings)(nil), + (*QueryRangeResponse_Timeseries)(nil), + (*QueryRangeResponse_Stats)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_query_querypb_query_proto_rawDesc, + NumEnums: 1, + NumMessages: 7, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_query_querypb_query_proto_goTypes, + DependencyIndexes: file_api_query_querypb_query_proto_depIdxs, + EnumInfos: file_api_query_querypb_query_proto_enumTypes, + MessageInfos: file_api_query_querypb_query_proto_msgTypes, + }.Build() + File_api_query_querypb_query_proto = out.File + file_api_query_querypb_query_proto_rawDesc = nil + file_api_query_querypb_query_proto_goTypes = nil + file_api_query_querypb_query_proto_depIdxs = nil +} diff --git a/pkg/api/query/querypb/query.proto b/pkg/api/query/querypb/query.proto index 6a55365a1b5..2d8d90e9d3d 100644 --- a/pkg/api/query/querypb/query.proto +++ b/pkg/api/query/querypb/query.proto @@ -4,23 +4,12 @@ syntax = "proto3"; package thanos; -option go_package = "querypb"; +option go_package = "github.com/thanos-io/thanos/pkg/api/query/querypb"; -import "gogoproto/gogo.proto"; import "store/storepb/types.proto"; import "store/storepb/rpc.proto"; import "store/storepb/prompb/types.proto"; - -option (gogoproto.sizer_all) = true; -option (gogoproto.marshaler_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; +import "tagger/tagger.proto"; enum EngineType { default = 0; @@ -43,7 +32,7 @@ message QueryRequest { repeated string replica_labels = 5; - repeated StoreMatchers storeMatchers = 6 [(gogoproto.nullable) = false]; + repeated StoreMatchers storeMatchers = 6 [(tagger.tags) = "json:\"storeMatchers\""]; bool enableDedup = 7; bool enablePartialResponse = 8; @@ -58,7 +47,7 @@ message QueryRequest { } message StoreMatchers { - repeated LabelMatcher labelMatchers = 1 [(gogoproto.nullable) = false]; + repeated LabelMatcher labelMatchers = 1 [(tagger.tags) = "json:\"labelMatchers\""]; } message QueryResponse { @@ -93,7 +82,7 @@ message QueryRangeRequest { repeated string replica_labels = 7; - repeated StoreMatchers storeMatchers = 8 [(gogoproto.nullable) = false]; + repeated StoreMatchers storeMatchers = 8 [(tagger.tags) = "json:\"storeMatchers\""]; bool enableDedup = 9; bool enablePartialResponse = 10; diff --git a/pkg/api/query/querypb/query_grpc.pb.go b/pkg/api/query/querypb/query_grpc.pb.go new file mode 100644 index 00000000000..0ec64b5e144 --- /dev/null +++ b/pkg/api/query/querypb/query_grpc.pb.go @@ -0,0 +1,169 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v3.20.1 +// source: api/query/querypb/query.proto + +package querypb + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Query_Query_FullMethodName = "/thanos.Query/Query" + Query_QueryRange_FullMethodName = "/thanos.Query/QueryRange" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type QueryClient interface { + Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[QueryResponse], error) + QueryRange(ctx context.Context, in *QueryRangeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[QueryRangeResponse], error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[QueryResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &Query_ServiceDesc.Streams[0], Query_Query_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[QueryRequest, QueryResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Query_QueryClient = grpc.ServerStreamingClient[QueryResponse] + +func (c *queryClient) QueryRange(ctx context.Context, in *QueryRangeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[QueryRangeResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &Query_ServiceDesc.Streams[1], Query_QueryRange_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[QueryRangeRequest, QueryRangeResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Query_QueryRangeClient = grpc.ServerStreamingClient[QueryRangeResponse] + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility. +type QueryServer interface { + Query(*QueryRequest, grpc.ServerStreamingServer[QueryResponse]) error + QueryRange(*QueryRangeRequest, grpc.ServerStreamingServer[QueryRangeResponse]) error + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} + +func (UnimplementedQueryServer) Query(*QueryRequest, grpc.ServerStreamingServer[QueryResponse]) error { + return status.Errorf(codes.Unimplemented, "method Query not implemented") +} +func (UnimplementedQueryServer) QueryRange(*QueryRangeRequest, grpc.ServerStreamingServer[QueryRangeResponse]) error { + return status.Errorf(codes.Unimplemented, "method QueryRange not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Query_ServiceDesc, srv) +} + +func _Query_Query_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(QueryRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(QueryServer).Query(m, &grpc.GenericServerStream[QueryRequest, QueryResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Query_QueryServer = grpc.ServerStreamingServer[QueryResponse] + +func _Query_QueryRange_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(QueryRangeRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(QueryServer).QueryRange(m, &grpc.GenericServerStream[QueryRangeRequest, QueryRangeResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Query_QueryRangeServer = grpc.ServerStreamingServer[QueryRangeResponse] + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "thanos.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Query", + Handler: _Query_Query_Handler, + ServerStreams: true, + }, + { + StreamName: "QueryRange", + Handler: _Query_QueryRange_Handler, + ServerStreams: true, + }, + }, + Metadata: "api/query/querypb/query.proto", +} diff --git a/pkg/api/query/querypb/query_vtproto.pb.go b/pkg/api/query/querypb/query_vtproto.pb.go new file mode 100644 index 00000000000..e6f1dfe6d97 --- /dev/null +++ b/pkg/api/query/querypb/query_vtproto.pb.go @@ -0,0 +1,3024 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.1-0.20250313105119-ba97887b0a25 +// source: api/query/querypb/query.proto + +package querypb + +import ( + fmt "fmt" + io "io" + + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + storepb "github.com/thanos-io/thanos/pkg/store/storepb" + prompb "github.com/thanos-io/thanos/pkg/store/storepb/prompb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *QueryStats) CloneVT() *QueryStats { + if m == nil { + return (*QueryStats)(nil) + } + r := new(QueryStats) + r.SamplesTotal = m.SamplesTotal + r.PeakSamples = m.PeakSamples + return r +} + +func (m *QueryStats) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *QueryRequest) CloneVT() *QueryRequest { + if m == nil { + return (*QueryRequest)(nil) + } + r := new(QueryRequest) + r.Query = m.Query + r.QueryPlan = m.QueryPlan.CloneVT() + r.TimeSeconds = m.TimeSeconds + r.TimeoutSeconds = m.TimeoutSeconds + r.MaxResolutionSeconds = m.MaxResolutionSeconds + r.EnableDedup = m.EnableDedup + r.EnablePartialResponse = m.EnablePartialResponse + r.SkipChunks = m.SkipChunks + r.ShardInfo = m.ShardInfo.CloneVT() + r.LookbackDeltaSeconds = m.LookbackDeltaSeconds + r.Engine = m.Engine + if rhs := m.ReplicaLabels; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.ReplicaLabels = tmpContainer + } + if rhs := m.StoreMatchers; rhs != nil { + tmpContainer := make([]*StoreMatchers, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.StoreMatchers = tmpContainer + } + return r +} + +func (m *QueryRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *StoreMatchers) CloneVT() *StoreMatchers { + if m == nil { + return (*StoreMatchers)(nil) + } + r := new(StoreMatchers) + if rhs := m.LabelMatchers; rhs != nil { + tmpContainer := make([]*storepb.LabelMatcher, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.LabelMatchers = tmpContainer + } + return r +} + +func (m *StoreMatchers) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *QueryResponse) CloneVT() *QueryResponse { + if m == nil { + return (*QueryResponse)(nil) + } + r := new(QueryResponse) + if m.Result != nil { + r.Result = m.Result.(interface{ CloneVT() isQueryResponse_Result }).CloneVT() + } + return r +} + +func (m *QueryResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *QueryResponse_Warnings) CloneVT() isQueryResponse_Result { + if m == nil { + return (*QueryResponse_Warnings)(nil) + } + r := new(QueryResponse_Warnings) + r.Warnings = m.Warnings + return r +} + +func (m *QueryResponse_Timeseries) CloneVT() isQueryResponse_Result { + if m == nil { + return (*QueryResponse_Timeseries)(nil) + } + r := new(QueryResponse_Timeseries) + if rhs := m.Timeseries; rhs != nil { + if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *prompb.TimeSeries }); ok { + r.Timeseries = vtpb.CloneVT() + } else { + r.Timeseries = proto.Clone(rhs).(*prompb.TimeSeries) + } + } + return r +} + +func (m *QueryResponse_Stats) CloneVT() isQueryResponse_Result { + if m == nil { + return (*QueryResponse_Stats)(nil) + } + r := new(QueryResponse_Stats) + r.Stats = m.Stats.CloneVT() + return r +} + +func (m *QueryPlan) CloneVT() *QueryPlan { + if m == nil { + return (*QueryPlan)(nil) + } + r := new(QueryPlan) + if m.Encoding != nil { + r.Encoding = m.Encoding.(interface{ CloneVT() isQueryPlan_Encoding }).CloneVT() + } + return r +} + +func (m *QueryPlan) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *QueryPlan_Json) CloneVT() isQueryPlan_Encoding { + if m == nil { + return (*QueryPlan_Json)(nil) + } + r := new(QueryPlan_Json) + if rhs := m.Json; rhs != nil { + tmpBytes := make([]byte, len(rhs)) + copy(tmpBytes, rhs) + r.Json = tmpBytes + } + return r +} + +func (m *QueryRangeRequest) CloneVT() *QueryRangeRequest { + if m == nil { + return (*QueryRangeRequest)(nil) + } + r := new(QueryRangeRequest) + r.Query = m.Query + r.QueryPlan = m.QueryPlan.CloneVT() + r.StartTimeSeconds = m.StartTimeSeconds + r.EndTimeSeconds = m.EndTimeSeconds + r.IntervalSeconds = m.IntervalSeconds + r.TimeoutSeconds = m.TimeoutSeconds + r.MaxResolutionSeconds = m.MaxResolutionSeconds + r.EnableDedup = m.EnableDedup + r.EnablePartialResponse = m.EnablePartialResponse + r.SkipChunks = m.SkipChunks + r.ShardInfo = m.ShardInfo.CloneVT() + r.LookbackDeltaSeconds = m.LookbackDeltaSeconds + r.Engine = m.Engine + if rhs := m.ReplicaLabels; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.ReplicaLabels = tmpContainer + } + if rhs := m.StoreMatchers; rhs != nil { + tmpContainer := make([]*StoreMatchers, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.StoreMatchers = tmpContainer + } + return r +} + +func (m *QueryRangeRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *QueryRangeResponse) CloneVT() *QueryRangeResponse { + if m == nil { + return (*QueryRangeResponse)(nil) + } + r := new(QueryRangeResponse) + if m.Result != nil { + r.Result = m.Result.(interface { + CloneVT() isQueryRangeResponse_Result + }).CloneVT() + } + return r +} + +func (m *QueryRangeResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *QueryRangeResponse_Warnings) CloneVT() isQueryRangeResponse_Result { + if m == nil { + return (*QueryRangeResponse_Warnings)(nil) + } + r := new(QueryRangeResponse_Warnings) + r.Warnings = m.Warnings + return r +} + +func (m *QueryRangeResponse_Timeseries) CloneVT() isQueryRangeResponse_Result { + if m == nil { + return (*QueryRangeResponse_Timeseries)(nil) + } + r := new(QueryRangeResponse_Timeseries) + if rhs := m.Timeseries; rhs != nil { + if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *prompb.TimeSeries }); ok { + r.Timeseries = vtpb.CloneVT() + } else { + r.Timeseries = proto.Clone(rhs).(*prompb.TimeSeries) + } + } + return r +} + +func (m *QueryRangeResponse_Stats) CloneVT() isQueryRangeResponse_Result { + if m == nil { + return (*QueryRangeResponse_Stats)(nil) + } + r := new(QueryRangeResponse_Stats) + r.Stats = m.Stats.CloneVT() + return r +} + +func (this *QueryStats) EqualVT(that *QueryStats) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.SamplesTotal != that.SamplesTotal { + return false + } + if this.PeakSamples != that.PeakSamples { + return false + } + return true +} + +func (this *QueryStats) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*QueryStats) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *QueryRequest) EqualVT(that *QueryRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Query != that.Query { + return false + } + if this.TimeSeconds != that.TimeSeconds { + return false + } + if this.TimeoutSeconds != that.TimeoutSeconds { + return false + } + if this.MaxResolutionSeconds != that.MaxResolutionSeconds { + return false + } + if len(this.ReplicaLabels) != len(that.ReplicaLabels) { + return false + } + for i, vx := range this.ReplicaLabels { + vy := that.ReplicaLabels[i] + if vx != vy { + return false + } + } + if len(this.StoreMatchers) != len(that.StoreMatchers) { + return false + } + for i, vx := range this.StoreMatchers { + vy := that.StoreMatchers[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &StoreMatchers{} + } + if q == nil { + q = &StoreMatchers{} + } + if !p.EqualVT(q) { + return false + } + } + } + if this.EnableDedup != that.EnableDedup { + return false + } + if this.EnablePartialResponse != that.EnablePartialResponse { + return false + } + if this.SkipChunks != that.SkipChunks { + return false + } + if !this.ShardInfo.EqualVT(that.ShardInfo) { + return false + } + if this.LookbackDeltaSeconds != that.LookbackDeltaSeconds { + return false + } + if this.Engine != that.Engine { + return false + } + if !this.QueryPlan.EqualVT(that.QueryPlan) { + return false + } + return true +} + +func (this *QueryRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*QueryRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *StoreMatchers) EqualVT(that *StoreMatchers) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.LabelMatchers) != len(that.LabelMatchers) { + return false + } + for i, vx := range this.LabelMatchers { + vy := that.LabelMatchers[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &storepb.LabelMatcher{} + } + if q == nil { + q = &storepb.LabelMatcher{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *StoreMatchers) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*StoreMatchers) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *QueryResponse) EqualVT(that *QueryResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Result == nil && that.Result != nil { + return false + } else if this.Result != nil { + if that.Result == nil { + return false + } + if !this.Result.(interface { + EqualVT(isQueryResponse_Result) bool + }).EqualVT(that.Result) { + return false + } + } + return true +} + +func (this *QueryResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*QueryResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *QueryResponse_Warnings) EqualVT(thatIface isQueryResponse_Result) bool { + that, ok := thatIface.(*QueryResponse_Warnings) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.Warnings != that.Warnings { + return false + } + return true +} + +func (this *QueryResponse_Timeseries) EqualVT(thatIface isQueryResponse_Result) bool { + that, ok := thatIface.(*QueryResponse_Timeseries) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Timeseries, that.Timeseries; p != q { + if p == nil { + p = &prompb.TimeSeries{} + } + if q == nil { + q = &prompb.TimeSeries{} + } + if equal, ok := interface{}(p).(interface{ EqualVT(*prompb.TimeSeries) bool }); ok { + if !equal.EqualVT(q) { + return false + } + } else if !proto.Equal(p, q) { + return false + } + } + return true +} + +func (this *QueryResponse_Stats) EqualVT(thatIface isQueryResponse_Result) bool { + that, ok := thatIface.(*QueryResponse_Stats) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Stats, that.Stats; p != q { + if p == nil { + p = &QueryStats{} + } + if q == nil { + q = &QueryStats{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *QueryPlan) EqualVT(that *QueryPlan) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Encoding == nil && that.Encoding != nil { + return false + } else if this.Encoding != nil { + if that.Encoding == nil { + return false + } + if !this.Encoding.(interface { + EqualVT(isQueryPlan_Encoding) bool + }).EqualVT(that.Encoding) { + return false + } + } + return true +} + +func (this *QueryPlan) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*QueryPlan) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *QueryPlan_Json) EqualVT(thatIface isQueryPlan_Encoding) bool { + that, ok := thatIface.(*QueryPlan_Json) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if string(this.Json) != string(that.Json) { + return false + } + return true +} + +func (this *QueryRangeRequest) EqualVT(that *QueryRangeRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Query != that.Query { + return false + } + if this.StartTimeSeconds != that.StartTimeSeconds { + return false + } + if this.EndTimeSeconds != that.EndTimeSeconds { + return false + } + if this.IntervalSeconds != that.IntervalSeconds { + return false + } + if this.TimeoutSeconds != that.TimeoutSeconds { + return false + } + if this.MaxResolutionSeconds != that.MaxResolutionSeconds { + return false + } + if len(this.ReplicaLabels) != len(that.ReplicaLabels) { + return false + } + for i, vx := range this.ReplicaLabels { + vy := that.ReplicaLabels[i] + if vx != vy { + return false + } + } + if len(this.StoreMatchers) != len(that.StoreMatchers) { + return false + } + for i, vx := range this.StoreMatchers { + vy := that.StoreMatchers[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &StoreMatchers{} + } + if q == nil { + q = &StoreMatchers{} + } + if !p.EqualVT(q) { + return false + } + } + } + if this.EnableDedup != that.EnableDedup { + return false + } + if this.EnablePartialResponse != that.EnablePartialResponse { + return false + } + if this.SkipChunks != that.SkipChunks { + return false + } + if !this.ShardInfo.EqualVT(that.ShardInfo) { + return false + } + if this.LookbackDeltaSeconds != that.LookbackDeltaSeconds { + return false + } + if this.Engine != that.Engine { + return false + } + if !this.QueryPlan.EqualVT(that.QueryPlan) { + return false + } + return true +} + +func (this *QueryRangeRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*QueryRangeRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *QueryRangeResponse) EqualVT(that *QueryRangeResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Result == nil && that.Result != nil { + return false + } else if this.Result != nil { + if that.Result == nil { + return false + } + if !this.Result.(interface { + EqualVT(isQueryRangeResponse_Result) bool + }).EqualVT(that.Result) { + return false + } + } + return true +} + +func (this *QueryRangeResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*QueryRangeResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *QueryRangeResponse_Warnings) EqualVT(thatIface isQueryRangeResponse_Result) bool { + that, ok := thatIface.(*QueryRangeResponse_Warnings) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.Warnings != that.Warnings { + return false + } + return true +} + +func (this *QueryRangeResponse_Timeseries) EqualVT(thatIface isQueryRangeResponse_Result) bool { + that, ok := thatIface.(*QueryRangeResponse_Timeseries) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Timeseries, that.Timeseries; p != q { + if p == nil { + p = &prompb.TimeSeries{} + } + if q == nil { + q = &prompb.TimeSeries{} + } + if equal, ok := interface{}(p).(interface{ EqualVT(*prompb.TimeSeries) bool }); ok { + if !equal.EqualVT(q) { + return false + } + } else if !proto.Equal(p, q) { + return false + } + } + return true +} + +func (this *QueryRangeResponse_Stats) EqualVT(thatIface isQueryRangeResponse_Result) bool { + that, ok := thatIface.(*QueryRangeResponse_Stats) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Stats, that.Stats; p != q { + if p == nil { + p = &QueryStats{} + } + if q == nil { + q = &QueryStats{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (m *QueryStats) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryStats) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *QueryStats) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.PeakSamples != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PeakSamples)) + i-- + dAtA[i] = 0x10 + } + if m.SamplesTotal != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SamplesTotal)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *QueryRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.QueryPlan != nil { + size, err := m.QueryPlan.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x72 + } + if m.Engine != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Engine)) + i-- + dAtA[i] = 0x68 + } + if m.LookbackDeltaSeconds != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.LookbackDeltaSeconds)) + i-- + dAtA[i] = 0x60 + } + if m.ShardInfo != nil { + size, err := m.ShardInfo.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x5a + } + if m.SkipChunks { + i-- + if m.SkipChunks { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if m.EnablePartialResponse { + i-- + if m.EnablePartialResponse { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.EnableDedup { + i-- + if m.EnableDedup { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if len(m.StoreMatchers) > 0 { + for iNdEx := len(m.StoreMatchers) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.StoreMatchers[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + } + if len(m.ReplicaLabels) > 0 { + for iNdEx := len(m.ReplicaLabels) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ReplicaLabels[iNdEx]) + copy(dAtA[i:], m.ReplicaLabels[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ReplicaLabels[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if m.MaxResolutionSeconds != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MaxResolutionSeconds)) + i-- + dAtA[i] = 0x20 + } + if m.TimeoutSeconds != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TimeoutSeconds)) + i-- + dAtA[i] = 0x18 + } + if m.TimeSeconds != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TimeSeconds)) + i-- + dAtA[i] = 0x10 + } + if len(m.Query) > 0 { + i -= len(m.Query) + copy(dAtA[i:], m.Query) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Query))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StoreMatchers) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StoreMatchers) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StoreMatchers) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.LabelMatchers) > 0 { + for iNdEx := len(m.LabelMatchers) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.LabelMatchers[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *QueryResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if vtmsg, ok := m.Result.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *QueryResponse_Warnings) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *QueryResponse_Warnings) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Warnings) + copy(dAtA[i:], m.Warnings) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Warnings))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} +func (m *QueryResponse_Timeseries) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *QueryResponse_Timeseries) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Timeseries != nil { + if vtmsg, ok := interface{}(m.Timeseries).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Timeseries) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x12 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *QueryResponse_Stats) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *QueryResponse_Stats) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Stats != nil { + size, err := m.Stats.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *QueryPlan) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryPlan) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *QueryPlan) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if vtmsg, ok := m.Encoding.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *QueryPlan_Json) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *QueryPlan_Json) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Json) + copy(dAtA[i:], m.Json) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Json))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} +func (m *QueryRangeRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryRangeRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *QueryRangeRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.QueryPlan != nil { + size, err := m.QueryPlan.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if m.Engine != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Engine)) + i-- + dAtA[i] = 0x78 + } + if m.LookbackDeltaSeconds != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.LookbackDeltaSeconds)) + i-- + dAtA[i] = 0x70 + } + if m.ShardInfo != nil { + size, err := m.ShardInfo.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x6a + } + if m.SkipChunks { + i-- + if m.SkipChunks { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } + if m.EnablePartialResponse { + i-- + if m.EnablePartialResponse { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if m.EnableDedup { + i-- + if m.EnableDedup { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + if len(m.StoreMatchers) > 0 { + for iNdEx := len(m.StoreMatchers) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.StoreMatchers[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } + } + if len(m.ReplicaLabels) > 0 { + for iNdEx := len(m.ReplicaLabels) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ReplicaLabels[iNdEx]) + copy(dAtA[i:], m.ReplicaLabels[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ReplicaLabels[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if m.MaxResolutionSeconds != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MaxResolutionSeconds)) + i-- + dAtA[i] = 0x30 + } + if m.TimeoutSeconds != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TimeoutSeconds)) + i-- + dAtA[i] = 0x28 + } + if m.IntervalSeconds != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.IntervalSeconds)) + i-- + dAtA[i] = 0x20 + } + if m.EndTimeSeconds != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.EndTimeSeconds)) + i-- + dAtA[i] = 0x18 + } + if m.StartTimeSeconds != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StartTimeSeconds)) + i-- + dAtA[i] = 0x10 + } + if len(m.Query) > 0 { + i -= len(m.Query) + copy(dAtA[i:], m.Query) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Query))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryRangeResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryRangeResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *QueryRangeResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if vtmsg, ok := m.Result.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *QueryRangeResponse_Warnings) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *QueryRangeResponse_Warnings) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Warnings) + copy(dAtA[i:], m.Warnings) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Warnings))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} +func (m *QueryRangeResponse_Timeseries) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *QueryRangeResponse_Timeseries) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Timeseries != nil { + if vtmsg, ok := interface{}(m.Timeseries).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Timeseries) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x12 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *QueryRangeResponse_Stats) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *QueryRangeResponse_Stats) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Stats != nil { + size, err := m.Stats.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *QueryStats) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SamplesTotal != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.SamplesTotal)) + } + if m.PeakSamples != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PeakSamples)) + } + return n +} + +func (m *QueryRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Query) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.TimeSeconds != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.TimeSeconds)) + } + if m.TimeoutSeconds != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.TimeoutSeconds)) + } + if m.MaxResolutionSeconds != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MaxResolutionSeconds)) + } + if len(m.ReplicaLabels) > 0 { + for _, s := range m.ReplicaLabels { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.StoreMatchers) > 0 { + for _, e := range m.StoreMatchers { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.EnableDedup { + n += 2 + } + if m.EnablePartialResponse { + n += 2 + } + if m.SkipChunks { + n += 2 + } + if m.ShardInfo != nil { + l = m.ShardInfo.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.LookbackDeltaSeconds != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.LookbackDeltaSeconds)) + } + if m.Engine != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Engine)) + } + if m.QueryPlan != nil { + l = m.QueryPlan.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *StoreMatchers) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.LabelMatchers) > 0 { + for _, e := range m.LabelMatchers { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *QueryResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Result.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + return n +} + +func (m *QueryResponse_Warnings) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Warnings) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return n +} +func (m *QueryResponse_Timeseries) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Timeseries != nil { + if size, ok := interface{}(m.Timeseries).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Timeseries) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *QueryResponse_Stats) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Stats != nil { + l = m.Stats.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *QueryPlan) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Encoding.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + return n +} + +func (m *QueryPlan_Json) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Json) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return n +} +func (m *QueryRangeRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Query) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.StartTimeSeconds != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StartTimeSeconds)) + } + if m.EndTimeSeconds != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.EndTimeSeconds)) + } + if m.IntervalSeconds != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.IntervalSeconds)) + } + if m.TimeoutSeconds != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.TimeoutSeconds)) + } + if m.MaxResolutionSeconds != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MaxResolutionSeconds)) + } + if len(m.ReplicaLabels) > 0 { + for _, s := range m.ReplicaLabels { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.StoreMatchers) > 0 { + for _, e := range m.StoreMatchers { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.EnableDedup { + n += 2 + } + if m.EnablePartialResponse { + n += 2 + } + if m.SkipChunks { + n += 2 + } + if m.ShardInfo != nil { + l = m.ShardInfo.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.LookbackDeltaSeconds != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.LookbackDeltaSeconds)) + } + if m.Engine != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Engine)) + } + if m.QueryPlan != nil { + l = m.QueryPlan.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *QueryRangeResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Result.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + return n +} + +func (m *QueryRangeResponse_Warnings) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Warnings) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return n +} +func (m *QueryRangeResponse_Timeseries) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Timeseries != nil { + if size, ok := interface{}(m.Timeseries).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Timeseries) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *QueryRangeResponse_Stats) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Stats != nil { + l = m.Stats.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *QueryStats) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryStats: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryStats: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SamplesTotal", wireType) + } + m.SamplesTotal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SamplesTotal |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PeakSamples", wireType) + } + m.PeakSamples = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PeakSamples |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Query = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeSeconds", wireType) + } + m.TimeSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutSeconds", wireType) + } + m.TimeoutSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeoutSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxResolutionSeconds", wireType) + } + m.MaxResolutionSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxResolutionSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReplicaLabels", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ReplicaLabels = append(m.ReplicaLabels, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StoreMatchers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StoreMatchers = append(m.StoreMatchers, &StoreMatchers{}) + if err := m.StoreMatchers[len(m.StoreMatchers)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableDedup", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableDedup = bool(v != 0) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnablePartialResponse", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnablePartialResponse = bool(v != 0) + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipChunks", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SkipChunks = bool(v != 0) + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShardInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ShardInfo == nil { + m.ShardInfo = &storepb.ShardInfo{} + } + if err := m.ShardInfo.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LookbackDeltaSeconds", wireType) + } + m.LookbackDeltaSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LookbackDeltaSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Engine", wireType) + } + m.Engine = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Engine |= EngineType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryPlan", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.QueryPlan == nil { + m.QueryPlan = &QueryPlan{} + } + if err := m.QueryPlan.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StoreMatchers) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StoreMatchers: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StoreMatchers: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LabelMatchers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LabelMatchers = append(m.LabelMatchers, &storepb.LabelMatcher{}) + if err := m.LabelMatchers[len(m.LabelMatchers)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Warnings", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Result = &QueryResponse_Warnings{Warnings: string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Result.(*QueryResponse_Timeseries); ok { + if unmarshal, ok := interface{}(oneof.Timeseries).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], oneof.Timeseries); err != nil { + return err + } + } + } else { + v := &prompb.TimeSeries{} + if unmarshal, ok := interface{}(v).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], v); err != nil { + return err + } + } + m.Result = &QueryResponse_Timeseries{Timeseries: v} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Result.(*QueryResponse_Stats); ok { + if err := oneof.Stats.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &QueryStats{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Result = &QueryResponse_Stats{Stats: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryPlan) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryPlan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPlan: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Json", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := make([]byte, postIndex-iNdEx) + copy(v, dAtA[iNdEx:postIndex]) + m.Encoding = &QueryPlan_Json{Json: v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryRangeRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryRangeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRangeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Query = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTimeSeconds", wireType) + } + m.StartTimeSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartTimeSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EndTimeSeconds", wireType) + } + m.EndTimeSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EndTimeSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IntervalSeconds", wireType) + } + m.IntervalSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.IntervalSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutSeconds", wireType) + } + m.TimeoutSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeoutSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxResolutionSeconds", wireType) + } + m.MaxResolutionSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxResolutionSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReplicaLabels", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ReplicaLabels = append(m.ReplicaLabels, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StoreMatchers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StoreMatchers = append(m.StoreMatchers, &StoreMatchers{}) + if err := m.StoreMatchers[len(m.StoreMatchers)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableDedup", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableDedup = bool(v != 0) + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnablePartialResponse", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnablePartialResponse = bool(v != 0) + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipChunks", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SkipChunks = bool(v != 0) + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShardInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ShardInfo == nil { + m.ShardInfo = &storepb.ShardInfo{} + } + if err := m.ShardInfo.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LookbackDeltaSeconds", wireType) + } + m.LookbackDeltaSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LookbackDeltaSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Engine", wireType) + } + m.Engine = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Engine |= EngineType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryPlan", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.QueryPlan == nil { + m.QueryPlan = &QueryPlan{} + } + if err := m.QueryPlan.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryRangeResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryRangeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRangeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Warnings", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Result = &QueryRangeResponse_Warnings{Warnings: string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Result.(*QueryRangeResponse_Timeseries); ok { + if unmarshal, ok := interface{}(oneof.Timeseries).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], oneof.Timeseries); err != nil { + return err + } + } + } else { + v := &prompb.TimeSeries{} + if unmarshal, ok := interface{}(v).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], v); err != nil { + return err + } + } + m.Result = &QueryRangeResponse_Timeseries{Timeseries: v} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Result.(*QueryRangeResponse_Stats); ok { + if err := oneof.Stats.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &QueryStats{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Result = &QueryRangeResponse_Stats{Stats: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pkg/api/query/querypb/store_matchers.go b/pkg/api/query/querypb/store_matchers.go index 41b8f223cb5..15932958068 100644 --- a/pkg/api/query/querypb/store_matchers.go +++ b/pkg/api/query/querypb/store_matchers.go @@ -8,7 +8,7 @@ import ( "github.com/thanos-io/thanos/pkg/store/storepb" ) -func StoreMatchersToLabelMatchers(matchers []StoreMatchers) ([][]*labels.Matcher, error) { +func StoreMatchersToLabelMatchers(matchers []*StoreMatchers) ([][]*labels.Matcher, error) { if len(matchers) == 0 { return nil, nil } diff --git a/pkg/api/query/v1.go b/pkg/api/query/v1.go index 1b4bb205008..6f02cb47d87 100644 --- a/pkg/api/query/v1.go +++ b/pkg/api/query/v1.go @@ -1623,7 +1623,7 @@ func NewMetricMetadataHandler(client metadata.UnaryClient, enablePartialResponse defer span.Finish() var ( - t map[string][]metadatapb.Meta + t map[string][]*metadatapb.Meta warnings annotations.Annotations err error ) diff --git a/pkg/api/query/v1_test.go b/pkg/api/query/v1_test.go index 0c08a0ebca9..5f0f0db2748 100644 --- a/pkg/api/query/v1_test.go +++ b/pkg/api/query/v1_test.go @@ -62,6 +62,7 @@ import ( "github.com/thanos-io/thanos/pkg/testutil/custom" "github.com/thanos-io/thanos/pkg/testutil/e2eutil" "github.com/thanos-io/thanos/pkg/testutil/testpromcompatibility" + "google.golang.org/protobuf/types/known/timestamppb" ) func TestMain(m *testing.M) { @@ -794,7 +795,7 @@ func newProxyStoreWithTSDBStore(db store.TSDBReader) *store.ProxyStore { nil, func() []store.Client { return []store.Client{c} }, component.Query, - nil, + labelpb.EmptyLabels(), 0, store.EagerRetrieval, ) @@ -1809,44 +1810,44 @@ func TestRulesHandler(t *testing.T) { all := []*rulespb.Rule{ rulespb.NewRecordingRule(&rulespb.RecordingRule{ Name: "1", - LastEvaluation: time.Time{}.Add(1 * time.Minute), + LastEvaluation: timestamppb.New(time.Time{}.Add(1 * time.Minute)), EvaluationDurationSeconds: 12, Health: "x", Query: "sum(up)", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "some", Value: "label"}}}, + Labels: labelpb.LabelSetFromStrings("some", "label"), LastError: "err1", }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ Name: "2", - LastEvaluation: time.Time{}.Add(2 * time.Minute), + LastEvaluation: timestamppb.New(time.Time{}.Add(2 * time.Minute)), EvaluationDurationSeconds: 12, Health: "x", Query: "sum(up1)", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "some", Value: "label2"}}}, + Labels: labelpb.LabelSetFromStrings("some", "label2"), }), rulespb.NewAlertingRule(&rulespb.Alert{ Name: "3", - LastEvaluation: time.Time{}.Add(3 * time.Minute), + LastEvaluation: timestamppb.New(time.Time{}.Add(3 * time.Minute)), EvaluationDurationSeconds: 12, Health: "x", Query: "sum(up2) == 2", DurationSeconds: 101, KeepFiringForSeconds: 102, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "some", Value: "label3"}}}, - Annotations: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "ann", Value: "a1"}}}, + Labels: labelpb.LabelSetFromStrings("some", "label3"), + Annotations: labelpb.LabelSetFromStrings("ann", "a1"), Alerts: []*rulespb.AlertInstance{ { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "inside", Value: "1"}}}, - Annotations: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "insideann", Value: "2"}}}, + Labels: labelpb.LabelSetFromStrings("inside", "1"), + Annotations: labelpb.LabelSetFromStrings("insideann", "2"), State: rulespb.AlertState_FIRING, - ActiveAt: &twoHAgo, + ActiveAt: timestamppb.New(twoHAgo), Value: "1", // This is unlikely if groups is warn, but test nevertheless. PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT, }, { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "inside", Value: "3"}}}, - Annotations: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "insideann", Value: "4"}}}, + Labels: labelpb.LabelSetFromStrings("inside", "3"), + Annotations: labelpb.LabelSetFromStrings("insideann", "4"), State: rulespb.AlertState_PENDING, ActiveAt: nil, Value: "2", @@ -1858,24 +1859,24 @@ func TestRulesHandler(t *testing.T) { }), rulespb.NewAlertingRule(&rulespb.Alert{ Name: "4", - LastEvaluation: time.Time{}.Add(4 * time.Minute), + LastEvaluation: timestamppb.New(time.Time{}.Add(4 * time.Minute)), EvaluationDurationSeconds: 122, Health: "x", DurationSeconds: 102, KeepFiringForSeconds: 103, Query: "sum(up3) == 3", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "some", Value: "label4"}}}, + Labels: labelpb.LabelSetFromStrings("some", "label4"), State: rulespb.AlertState_INACTIVE, }), rulespb.NewAlertingRule(&rulespb.Alert{ Name: "5", - LastEvaluation: time.Time{}.Add(4 * time.Minute), + LastEvaluation: timestamppb.New(time.Time{}.Add(4 * time.Minute)), EvaluationDurationSeconds: 122, Health: "x", DurationSeconds: 61, KeepFiringForSeconds: 62, Query: "sum(up4) == 4", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "some", Value: "label5"}}}, + Labels: labelpb.LabelSetFromStrings("some", "label5"), State: rulespb.AlertState_INACTIVE, }), } @@ -1889,7 +1890,7 @@ func TestRulesHandler(t *testing.T) { Rules: all, Interval: 1, EvaluationDurationSeconds: 214, - LastEvaluation: time.Time{}.Add(10 * time.Minute), + LastEvaluation: timestamppb.New(time.Time{}.Add(10 * time.Minute)), PartialResponseStrategy: storepb.PartialResponseStrategy_WARN, }, { @@ -1898,7 +1899,7 @@ func TestRulesHandler(t *testing.T) { Rules: all[3:], Interval: 10, EvaluationDurationSeconds: 2142, - LastEvaluation: time.Time{}.Add(100 * time.Minute), + LastEvaluation: timestamppb.New(time.Time{}.Add(100 * time.Minute)), PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT, }, }, @@ -1909,7 +1910,7 @@ func TestRulesHandler(t *testing.T) { Rules: all[:2], Interval: 1, EvaluationDurationSeconds: 214, - LastEvaluation: time.Time{}.Add(20 * time.Minute), + LastEvaluation: timestamppb.New(time.Time{}.Add(20 * time.Minute)), PartialResponseStrategy: storepb.PartialResponseStrategy_WARN, }, }, @@ -1920,7 +1921,7 @@ func TestRulesHandler(t *testing.T) { Rules: all[2:], Interval: 1, EvaluationDurationSeconds: 214, - LastEvaluation: time.Time{}.Add(30 * time.Minute), + LastEvaluation: timestamppb.New(time.Time{}.Add(30 * time.Minute)), PartialResponseStrategy: storepb.PartialResponseStrategy_WARN, }, }, @@ -1932,24 +1933,31 @@ func TestRulesHandler(t *testing.T) { query url.Values response interface{} } + tsToTimePtr := func(ts *timestamppb.Timestamp) *time.Time { + if ts == nil { + return nil + } + t := ts.AsTime() + return &t + } expectedAll := []testpromcompatibility.Rule{ testpromcompatibility.RecordingRule{ Name: all[0].GetRecording().Name, Query: all[0].GetRecording().Query, - Labels: labelpb.ZLabelsToPromLabels(all[0].GetRecording().Labels.Labels), + Labels: all[0].GetRecording().GetLabels().PromLabels(), Health: rules.RuleHealth(all[0].GetRecording().Health), LastError: all[0].GetRecording().LastError, - LastEvaluation: all[0].GetRecording().LastEvaluation, + LastEvaluation: all[0].GetRecording().LastEvaluation.AsTime(), EvaluationTime: all[0].GetRecording().EvaluationDurationSeconds, Type: "recording", }, testpromcompatibility.RecordingRule{ Name: all[1].GetRecording().Name, Query: all[1].GetRecording().Query, - Labels: labelpb.ZLabelsToPromLabels(all[1].GetRecording().Labels.Labels), + Labels: all[1].GetRecording().GetLabels().PromLabels(), Health: rules.RuleHealth(all[1].GetRecording().Health), LastError: all[1].GetRecording().LastError, - LastEvaluation: all[1].GetRecording().LastEvaluation, + LastEvaluation: all[1].GetRecording().LastEvaluation.AsTime(), EvaluationTime: all[1].GetRecording().EvaluationDurationSeconds, Type: "recording", }, @@ -1957,28 +1965,28 @@ func TestRulesHandler(t *testing.T) { State: strings.ToLower(all[2].GetAlert().State.String()), Name: all[2].GetAlert().Name, Query: all[2].GetAlert().Query, - Labels: labelpb.ZLabelsToPromLabels(all[2].GetAlert().Labels.Labels), + Labels: all[2].GetAlert().GetLabels().PromLabels(), Health: rules.RuleHealth(all[2].GetAlert().Health), LastError: all[2].GetAlert().LastError, - LastEvaluation: all[2].GetAlert().LastEvaluation, + LastEvaluation: all[2].GetAlert().LastEvaluation.AsTime(), EvaluationTime: all[2].GetAlert().EvaluationDurationSeconds, Duration: all[2].GetAlert().DurationSeconds, KeepFiringFor: all[2].GetAlert().KeepFiringForSeconds, - Annotations: labelpb.ZLabelsToPromLabels(all[2].GetAlert().Annotations.Labels), + Annotations: all[2].GetAlert().GetAnnotations().PromLabels(), Alerts: []*testpromcompatibility.Alert{ { - Labels: labelpb.ZLabelsToPromLabels(all[2].GetAlert().Alerts[0].Labels.Labels), - Annotations: labelpb.ZLabelsToPromLabels(all[2].GetAlert().Alerts[0].Annotations.Labels), + Labels: all[2].GetAlert().Alerts[0].GetLabels().PromLabels(), + Annotations: all[2].GetAlert().Alerts[0].GetAnnotations().PromLabels(), State: strings.ToLower(all[2].GetAlert().Alerts[0].State.String()), - ActiveAt: all[2].GetAlert().Alerts[0].ActiveAt, + ActiveAt: tsToTimePtr(all[2].GetAlert().Alerts[0].ActiveAt), Value: all[2].GetAlert().Alerts[0].Value, PartialResponseStrategy: all[2].GetAlert().Alerts[0].PartialResponseStrategy.String(), }, { - Labels: labelpb.ZLabelsToPromLabels(all[2].GetAlert().Alerts[1].Labels.Labels), - Annotations: labelpb.ZLabelsToPromLabels(all[2].GetAlert().Alerts[1].Annotations.Labels), + Labels: all[2].GetAlert().Alerts[1].GetLabels().PromLabels(), + Annotations: all[2].GetAlert().Alerts[1].GetAnnotations().PromLabels(), State: strings.ToLower(all[2].GetAlert().Alerts[1].State.String()), - ActiveAt: all[2].GetAlert().Alerts[1].ActiveAt, + ActiveAt: tsToTimePtr(all[2].GetAlert().Alerts[1].ActiveAt), Value: all[2].GetAlert().Alerts[1].Value, PartialResponseStrategy: all[2].GetAlert().Alerts[1].PartialResponseStrategy.String(), }, @@ -1989,10 +1997,10 @@ func TestRulesHandler(t *testing.T) { State: strings.ToLower(all[3].GetAlert().State.String()), Name: all[3].GetAlert().Name, Query: all[3].GetAlert().Query, - Labels: labelpb.ZLabelsToPromLabels(all[3].GetAlert().Labels.Labels), + Labels: all[3].GetAlert().GetLabels().PromLabels(), Health: rules.RuleHealth(all[2].GetAlert().Health), LastError: all[3].GetAlert().LastError, - LastEvaluation: all[3].GetAlert().LastEvaluation, + LastEvaluation: all[3].GetAlert().LastEvaluation.AsTime(), EvaluationTime: all[3].GetAlert().EvaluationDurationSeconds, Duration: all[3].GetAlert().DurationSeconds, KeepFiringFor: all[3].GetAlert().KeepFiringForSeconds, @@ -2004,10 +2012,10 @@ func TestRulesHandler(t *testing.T) { State: strings.ToLower(all[4].GetAlert().State.String()), Name: all[4].GetAlert().Name, Query: all[4].GetAlert().Query, - Labels: labelpb.ZLabelsToPromLabels(all[4].GetAlert().Labels.Labels), + Labels: all[4].GetAlert().GetLabels().PromLabels(), Health: rules.RuleHealth(all[2].GetAlert().Health), LastError: all[4].GetAlert().LastError, - LastEvaluation: all[4].GetAlert().LastEvaluation, + LastEvaluation: all[4].GetAlert().LastEvaluation.AsTime(), EvaluationTime: all[4].GetAlert().EvaluationDurationSeconds, Duration: all[4].GetAlert().DurationSeconds, KeepFiringFor: all[4].GetAlert().KeepFiringForSeconds, @@ -2094,16 +2102,27 @@ func TestRulesHandler(t *testing.T) { testutil.Assert(t, apiError == nil, "unexpected error %v", apiError) // Those are different types now, but let's JSON outputs. - got, err := json.MarshalIndent(res, "", " ") - testutil.Ok(t, err) - exp, err := json.MarshalIndent(test.response, "", " ") - testutil.Ok(t, err) - + got := stableJsonMarshal(t, res) + exp := stableJsonMarshal(t, test.response) testutil.Equals(t, string(exp), string(got)) }) } } +// stableJsonMarshal marshals the given value to JSON and returns the sorted JSON string. +// This is useful since we are comparing two types with different field orderings. +func stableJsonMarshal(t *testing.T, v any) []byte { + data, err := json.Marshal(v) + testutil.Ok(t, err) + // unmarshal back into a map. During JSON unmarshalling, the fields are sorted by key. + m := make(map[string]any) + testutil.Ok(t, json.Unmarshal(data, &m)) + // And back into a string this time, it'll all be sorted by key. + data, err = json.MarshalIndent(m, "", " ") + testutil.Ok(t, err) + return data +} + func BenchmarkQueryResultEncoding(b *testing.B) { var mat promql.Matrix for i := 0; i < 1000; i++ { diff --git a/pkg/dedup/iter.go b/pkg/dedup/iter.go index 2917d2af2cd..c58f539bd07 100644 --- a/pkg/dedup/iter.go +++ b/pkg/dedup/iter.go @@ -7,10 +7,11 @@ import ( "math" "github.com/prometheus/prometheus/model/histogram" - "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/util/annotations" + + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" ) @@ -29,13 +30,31 @@ const ( AlgorithmQuorum = "quorum" ) +// Series mirrors storage.Series but uses labelpb.Labels instead of +// prometheus/model/labels.Labels. This is the Thanos-internal contract +// for a single time series. +type Series interface { + Labels() labelpb.Labels + Iterator(chunkenc.Iterator) chunkenc.Iterator +} + +// SeriesSet mirrors storage.SeriesSet but uses the Thanos-internal Series +// type. Everything inside Thanos operates on this interface; it is converted +// to storage.SeriesSet only at the PromQL boundary. +type SeriesSet interface { + Next() bool + At() Series + Err() error + Warnings() annotations.Annotations +} + type dedupSeriesSet struct { - set storage.SeriesSet + set SeriesSet - replicas []storage.Series + replicas []Series - lset labels.Labels - peek storage.Series + lset labelpb.Labels + peek Series ok bool f string @@ -60,9 +79,9 @@ type overlapSplitSet struct { ok bool set storepb.SeriesSet - currLabels labels.Labels + currLabels labelpb.Labels currI int - replicas [][]storepb.AggrChunk + replicas [][]*storepb.AggrChunk } func (o *overlapSplitSet) Next() bool { @@ -84,7 +103,7 @@ func (o *overlapSplitSet) Next() bool { return false } - var chunks []storepb.AggrChunk + var chunks []*storepb.AggrChunk o.currLabels, chunks = o.set.At() if len(chunks) == 0 { return true @@ -101,12 +120,12 @@ chunksLoop: continue chunksLoop } } - o.replicas = append(o.replicas, []storepb.AggrChunk{chunks[i]}) // Not found, add to a new "fake" series. + o.replicas = append(o.replicas, []*storepb.AggrChunk{chunks[i]}) } return true } -func (o *overlapSplitSet) At() (labels.Labels, []storepb.AggrChunk) { +func (o *overlapSplitSet) At() (labelpb.Labels, []*storepb.AggrChunk) { return o.currLabels, o.replicas[o.currI] } @@ -114,9 +133,9 @@ func (o *overlapSplitSet) Err() error { return o.set.Err() } -// NewSeriesSet returns seriesSet that deduplicates the same series. -// The series in series set are expected be sorted by all labels. -func NewSeriesSet(set storage.SeriesSet, f string, deduplicationFunc string) storage.SeriesSet { +// NewSeriesSet returns a SeriesSet that deduplicates the same series. +// The series in the input set are expected to be sorted by all labels. +func NewSeriesSet(set SeriesSet, f string, deduplicationFunc string) SeriesSet { s := &dedupSeriesSet{set: set, f: f, deduplicationFunc: deduplicationFunc} s.ok = s.set.Next() if s.ok { @@ -132,7 +151,6 @@ func (s *dedupSeriesSet) Next() bool { } s.replicas = s.replicas[:0] - // Set the label set we are currently gathering to the peek element. s.lset = s.peek.Labels() s.replicas = append(s.replicas[:0], s.peek) @@ -151,7 +169,7 @@ func (s *dedupSeriesSet) next() bool { // If the label set modulo the replica label is equal to the current label set // look for more replicas, otherwise a series is complete. - if !labels.Equal(s.lset, nextLset) { + if !labelpb.Equal(s.lset, nextLset) { return true } @@ -160,19 +178,18 @@ func (s *dedupSeriesSet) next() bool { return s.next() } -func (s *dedupSeriesSet) At() storage.Series { +func (s *dedupSeriesSet) At() Series { if len(s.replicas) == 1 { return seriesWithLabels{Series: s.replicas[0], lset: s.lset} } // Clients may store the series, so we must make a copy of the slice before advancing. - repl := make([]storage.Series, len(s.replicas)) + repl := make([]Series, len(s.replicas)) copy(repl, s.replicas) if s.deduplicationFunc == AlgorithmQuorum { - // merge all samples which are ingested via receiver, no skips. return NewQuorumSeries(s.lset, repl, s.f) } if s.deduplicationFunc == AlgorithmChain { - return seriesWithLabels{Series: storage.ChainedSeriesMerge(repl...), lset: s.lset} + return newChainedMergeSeries(s.lset, repl) } return newDedupSeries(s.lset, repl, s.f) } @@ -186,25 +203,45 @@ func (s *dedupSeriesSet) Warnings() annotations.Annotations { } type seriesWithLabels struct { - storage.Series - lset labels.Labels + Series + lset labelpb.Labels } -func (s seriesWithLabels) Labels() labels.Labels { return s.lset } +func (s seriesWithLabels) Labels() labelpb.Labels { return s.lset } + +// chainedMergeSeries merges multiple Series by chaining their sample iterators. +type chainedMergeSeries struct { + lset labelpb.Labels + replicas []Series +} + +func newChainedMergeSeries(lset labelpb.Labels, replicas []Series) Series { + return &chainedMergeSeries{lset: lset, replicas: replicas} +} + +func (s *chainedMergeSeries) Labels() labelpb.Labels { return s.lset } + +func (s *chainedMergeSeries) Iterator(it chunkenc.Iterator) chunkenc.Iterator { + iterators := make([]chunkenc.Iterator, 0, len(s.replicas)) + for _, r := range s.replicas { + iterators = append(iterators, r.Iterator(nil)) + } + return storage.ChainSampleIteratorFromIterators(it, iterators) +} type dedupSeries struct { - lset labels.Labels - replicas []storage.Series + lset labelpb.Labels + replicas []Series isCounter bool f string } -func newDedupSeries(lset labels.Labels, replicas []storage.Series, f string) *dedupSeries { +func newDedupSeries(lset labelpb.Labels, replicas []Series, f string) *dedupSeries { return &dedupSeries{lset: lset, isCounter: isCounter(f), replicas: replicas, f: f} } -func (s *dedupSeries) Labels() labels.Labels { +func (s *dedupSeries) Labels() labelpb.Labels { return s.lset } diff --git a/pkg/dedup/iter_test.go b/pkg/dedup/iter_test.go index e822e6f6ef3..71d7ae0d64b 100644 --- a/pkg/dedup/iter_test.go +++ b/pkg/dedup/iter_test.go @@ -12,8 +12,6 @@ import ( "testing" "github.com/prometheus/prometheus/model/histogram" - "github.com/prometheus/prometheus/model/labels" - "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/tsdbutil" "github.com/prometheus/prometheus/util/annotations" @@ -21,6 +19,7 @@ import ( "github.com/efficientgo/core/testutil" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" "github.com/thanos-io/thanos/pkg/testutil/testiters" ) @@ -52,12 +51,12 @@ func (s sample) Type() chunkenc.ValueType { } type series struct { - lset labels.Labels + lset labelpb.Labels samples []sample } -func (s series) Labels() labels.Labels { return s.lset } -func (s series) Iterator(chunkenc.Iterator) chunkenc.Iterator { +func (s series) Labels() labelpb.Labels { return s.lset } +func (s series) Iterator(_ chunkenc.Iterator) chunkenc.Iterator { return newMockedSeriesIterator(s.samples) } @@ -72,7 +71,7 @@ func (s *mockedSeriesSet) Next() bool { return s.cur <= len(s.series) } -func (s *mockedSeriesSet) At() storage.Series { +func (s *mockedSeriesSet) At() Series { return s.series[s.cur-1] } func (s *mockedSeriesSet) Err() error { return nil } @@ -152,8 +151,8 @@ var expectedRealSeriesWithStaleMarkerDeduplicatedForRate = []sample{ } type chunkedSeries struct { - lset labels.Labels - chunks []storepb.AggrChunk + lset labelpb.Labels + chunks []*storepb.AggrChunk } type chunkedSeriesSet struct { @@ -177,7 +176,7 @@ func (*chunkedSeriesSet) Err() error { return nil } -func (s *chunkedSeriesSet) At() (labels.Labels, []storepb.AggrChunk) { +func (s *chunkedSeriesSet) At() (labelpb.Labels, []*storepb.AggrChunk) { return s.series[s.i].lset, s.series[s.i].chunks } @@ -196,73 +195,73 @@ func toChunkedSeriesSlice(t testing.TB, set storepb.SeriesSet) []chunkedSeries { func TestOverlapSplitSet(t *testing.T) { input := []chunkedSeries{ { - lset: labels.FromStrings("a", "1_empty"), + lset: labelpb.FromStrings("a", "1_empty"), }, { - lset: labels.FromStrings("a", "2_nonoverlap"), - chunks: []storepb.AggrChunk{{MinTime: 0, MaxTime: 20}, {MinTime: 21, MaxTime: 100}, {MinTime: 110, MaxTime: 300}}, + lset: labelpb.FromStrings("a", "2_nonoverlap"), + chunks: []*storepb.AggrChunk{{MinTime: 0, MaxTime: 20}, {MinTime: 21, MaxTime: 100}, {MinTime: 110, MaxTime: 300}}, }, { - lset: labels.FromStrings("a", "3_tworeplicas"), - chunks: []storepb.AggrChunk{{MinTime: 0, MaxTime: 20}, {MinTime: 0, MaxTime: 30}, {MinTime: 21, MaxTime: 50}, {MinTime: 31, MaxTime: 60}, {MinTime: 100, MaxTime: 160}}, + lset: labelpb.FromStrings("a", "3_tworeplicas"), + chunks: []*storepb.AggrChunk{{MinTime: 0, MaxTime: 20}, {MinTime: 0, MaxTime: 30}, {MinTime: 21, MaxTime: 50}, {MinTime: 31, MaxTime: 60}, {MinTime: 100, MaxTime: 160}}, }, { - lset: labels.FromStrings("a", "4_nonoverlap"), - chunks: []storepb.AggrChunk{{MinTime: 50, MaxTime: 55}, {MinTime: 56, MaxTime: 100}}, + lset: labelpb.FromStrings("a", "4_nonoverlap"), + chunks: []*storepb.AggrChunk{{MinTime: 50, MaxTime: 55}, {MinTime: 56, MaxTime: 100}}, }, { - lset: labels.FromStrings("a", "5_minimaloverlap"), - chunks: []storepb.AggrChunk{{MinTime: 50, MaxTime: 55}, {MinTime: 55, MaxTime: 100}}, + lset: labelpb.FromStrings("a", "5_minimaloverlap"), + chunks: []*storepb.AggrChunk{{MinTime: 50, MaxTime: 55}, {MinTime: 55, MaxTime: 100}}, }, { - lset: labels.FromStrings("a", "6_fourreplica"), - chunks: []storepb.AggrChunk{{MinTime: 0, MaxTime: 20}, {MinTime: 0, MaxTime: 30}, {MinTime: 1, MaxTime: 15}, {MinTime: 2, MaxTime: 36}, {MinTime: 16, MaxTime: 200}, + lset: labelpb.FromStrings("a", "6_fourreplica"), + chunks: []*storepb.AggrChunk{{MinTime: 0, MaxTime: 20}, {MinTime: 0, MaxTime: 30}, {MinTime: 1, MaxTime: 15}, {MinTime: 2, MaxTime: 36}, {MinTime: 16, MaxTime: 200}, {MinTime: 21, MaxTime: 50}, {MinTime: 31, MaxTime: 60}, {MinTime: 100, MaxTime: 160}}, }, } exp := []chunkedSeries{ { - lset: labels.FromStrings("a", "1_empty"), + lset: labelpb.FromStrings("a", "1_empty"), }, { - lset: labels.FromStrings("a", "2_nonoverlap"), - chunks: []storepb.AggrChunk{{MinTime: 0, MaxTime: 20}, {MinTime: 21, MaxTime: 100}, {MinTime: 110, MaxTime: 300}}, + lset: labelpb.FromStrings("a", "2_nonoverlap"), + chunks: []*storepb.AggrChunk{{MinTime: 0, MaxTime: 20}, {MinTime: 21, MaxTime: 100}, {MinTime: 110, MaxTime: 300}}, }, { - lset: labels.FromStrings("a", "3_tworeplicas"), - chunks: []storepb.AggrChunk{{MinTime: 0, MaxTime: 20}, {MinTime: 21, MaxTime: 50}, {MinTime: 100, MaxTime: 160}}, + lset: labelpb.FromStrings("a", "3_tworeplicas"), + chunks: []*storepb.AggrChunk{{MinTime: 0, MaxTime: 20}, {MinTime: 21, MaxTime: 50}, {MinTime: 100, MaxTime: 160}}, }, { - lset: labels.FromStrings("a", "3_tworeplicas"), - chunks: []storepb.AggrChunk{{MinTime: 0, MaxTime: 30}, {MinTime: 31, MaxTime: 60}}, + lset: labelpb.FromStrings("a", "3_tworeplicas"), + chunks: []*storepb.AggrChunk{{MinTime: 0, MaxTime: 30}, {MinTime: 31, MaxTime: 60}}, }, { - lset: labels.FromStrings("a", "4_nonoverlap"), - chunks: []storepb.AggrChunk{{MinTime: 50, MaxTime: 55}, {MinTime: 56, MaxTime: 100}}, + lset: labelpb.FromStrings("a", "4_nonoverlap"), + chunks: []*storepb.AggrChunk{{MinTime: 50, MaxTime: 55}, {MinTime: 56, MaxTime: 100}}, }, { - lset: labels.FromStrings("a", "5_minimaloverlap"), - chunks: []storepb.AggrChunk{{MinTime: 50, MaxTime: 55}}, + lset: labelpb.FromStrings("a", "5_minimaloverlap"), + chunks: []*storepb.AggrChunk{{MinTime: 50, MaxTime: 55}}, }, { - lset: labels.FromStrings("a", "5_minimaloverlap"), - chunks: []storepb.AggrChunk{{MinTime: 55, MaxTime: 100}}, + lset: labelpb.FromStrings("a", "5_minimaloverlap"), + chunks: []*storepb.AggrChunk{{MinTime: 55, MaxTime: 100}}, }, { - lset: labels.FromStrings("a", "6_fourreplica"), - chunks: []storepb.AggrChunk{{MinTime: 0, MaxTime: 20}, {MinTime: 21, MaxTime: 50}, {MinTime: 100, MaxTime: 160}}, + lset: labelpb.FromStrings("a", "6_fourreplica"), + chunks: []*storepb.AggrChunk{{MinTime: 0, MaxTime: 20}, {MinTime: 21, MaxTime: 50}, {MinTime: 100, MaxTime: 160}}, }, { - lset: labels.FromStrings("a", "6_fourreplica"), - chunks: []storepb.AggrChunk{{MinTime: 0, MaxTime: 30}, {MinTime: 31, MaxTime: 60}}, + lset: labelpb.FromStrings("a", "6_fourreplica"), + chunks: []*storepb.AggrChunk{{MinTime: 0, MaxTime: 30}, {MinTime: 31, MaxTime: 60}}, }, { - lset: labels.FromStrings("a", "6_fourreplica"), - chunks: []storepb.AggrChunk{{MinTime: 1, MaxTime: 15}, {MinTime: 16, MaxTime: 200}}, + lset: labelpb.FromStrings("a", "6_fourreplica"), + chunks: []*storepb.AggrChunk{{MinTime: 1, MaxTime: 15}, {MinTime: 16, MaxTime: 200}}, }, { - lset: labels.FromStrings("a", "6_fourreplica"), - chunks: []storepb.AggrChunk{{MinTime: 2, MaxTime: 36}}, + lset: labelpb.FromStrings("a", "6_fourreplica"), + chunks: []*storepb.AggrChunk{{MinTime: 2, MaxTime: 36}}, }, } @@ -281,46 +280,46 @@ func TestDedupSeriesSet(t *testing.T) { name: "Single dedup label", input: []series{ { - lset: labels.FromStrings("a", "1", "c", "3"), + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.FromStrings("a", "1", "c", "3"), + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{60000, 3}, {70000, 4}}, }, { - lset: labels.FromStrings("a", "1", "c", "3"), + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{200000, 5}, {210000, 6}}, }, { - lset: labels.FromStrings("a", "1", "c", "3"), + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.FromStrings("a", "1", "c", "3", "d", "4"), + lset: labelpb.FromStrings("a", "1", "c", "3", "d", "4"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.FromStrings("a", "1", "c", "4"), + lset: labelpb.FromStrings("a", "1", "c", "4"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.FromStrings("a", "2", "c", "3"), + lset: labelpb.FromStrings("a", "2", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.FromStrings("a", "2", "c", "3"), + lset: labelpb.FromStrings("a", "2", "c", "3"), samples: []sample{{60000, 3}, {70000, 4}}, }, }, exp: []series{ { - lset: labels.FromStrings("a", "1", "c", "3"), + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}, {60000, 3}, {70000, 4}, {200000, 5}, {210000, 6}}, }, { - lset: labels.FromStrings("a", "1", "c", "3", "d", "4"), + lset: labelpb.FromStrings("a", "1", "c", "3", "d", "4"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.FromStrings("a", "1", "c", "4"), + lset: labelpb.FromStrings("a", "1", "c", "4"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.FromStrings("a", "2", "c", "3"), + lset: labelpb.FromStrings("a", "2", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}, {60000, 3}, {70000, 4}}, }, }, @@ -329,50 +328,50 @@ func TestDedupSeriesSet(t *testing.T) { name: "Multi dedup label", input: []series{ { - lset: labels.FromStrings("a", "1", "c", "3"), + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.FromStrings("a", "1", "c", "3"), + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{60000, 3}, {70000, 4}}, }, { - lset: labels.FromStrings("a", "1", "c", "3"), + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{200000, 5}, {210000, 6}}, }, { - lset: labels.FromStrings("a", "1", "c", "3", "d", "4"), + lset: labelpb.FromStrings("a", "1", "c", "3", "d", "4"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.FromStrings("a", "1", "c", "3"), + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.FromStrings("a", "1", "c", "4"), + lset: labelpb.FromStrings("a", "1", "c", "4"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.FromStrings("a", "2", "c", "3"), + lset: labelpb.FromStrings("a", "2", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.FromStrings("a", "2", "c", "3"), + lset: labelpb.FromStrings("a", "2", "c", "3"), samples: []sample{{60000, 3}, {70000, 4}}, }, }, exp: []series{ { - lset: labels.FromStrings("a", "1", "c", "3"), + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}, {60000, 3}, {70000, 4}, {200000, 5}, {210000, 6}}, }, { - lset: labels.FromStrings("a", "1", "c", "3", "d", "4"), + lset: labelpb.FromStrings("a", "1", "c", "3", "d", "4"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.FromStrings("a", "1", "c", "3"), + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.FromStrings("a", "1", "c", "4"), + lset: labelpb.FromStrings("a", "1", "c", "4"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.FromStrings("a", "2", "c", "3"), + lset: labelpb.FromStrings("a", "2", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}, {60000, 3}, {70000, 4}}, }, }, @@ -381,16 +380,16 @@ func TestDedupSeriesSet(t *testing.T) { name: "Multi dedup label - some series don't have all dedup labels", input: []series{ { - lset: labels.FromStrings("a", "1", "c", "3"), + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.FromStrings("a", "1", "c", "3"), + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{60000, 3}, {70000, 4}}, }, }, exp: []series{ { - lset: labels.FromStrings("a", "1", "c", "3"), + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}, {60000, 3}, {70000, 4}}, }, }, @@ -406,7 +405,7 @@ func TestDedupSeriesSet(t *testing.T) { isCounter: true, input: []series{ { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {10000, 8.0}, // Smaller timestamp, this will be chosen. CurrValue = 8.0. {20000, 9.0}, // Same. CurrValue = 9.0. @@ -419,7 +418,7 @@ func TestDedupSeriesSet(t *testing.T) { {100000, 9 + 6.0}, }, }, { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {10001, 8.0}, // Penalty 5000 will be added. // 20001 was app reset. No sample, because stale marker but removed by downsample.CounterSeriesIterator. Penalty 2 * (20000 - 10000) will be added. @@ -433,7 +432,7 @@ func TestDedupSeriesSet(t *testing.T) { }, exp: []series{ { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{{10000, 8}, {20000, 9}, {45001, 9}, {55001, 10}, {65001, 11}, {90000, 14}, {100000, 15}}, }, }, @@ -444,12 +443,12 @@ func TestDedupSeriesSet(t *testing.T) { isCounter: false, input: []series{ { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {10000, 8.0}, {20000, 9.0}, {50001, 9 + 1.0}, {60000, 9 + 2.0}, {70000, 9 + 3.0}, {80000, 9 + 4.0}, {90000, 9 + 5.0}, {100000, 9 + 6.0}, }, }, { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {10001, 8.0}, {45001, 8 + 0.5}, {55001, 8 + 1.5}, {65001, 8 + 2.5}, }, @@ -457,7 +456,7 @@ func TestDedupSeriesSet(t *testing.T) { }, exp: []series{ { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{{10000, 8}, {20000, 9}, {45001, 8.5}, {55001, 9.5}, {65001, 10.5}, {90000, 14}, {100000, 15}}, }, }, @@ -469,7 +468,7 @@ func TestDedupSeriesSet(t *testing.T) { isCounter: true, input: []series{ { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {t: 1587690005791, f: 461968}, {t: 1587690020791, f: 462151}, {t: 1587690035797, f: 462336}, {t: 1587690050791, f: 462650}, {t: 1587690065791, f: 462813}, {t: 1587690080791, f: 462987}, {t: 1587690095791, f: 463095}, {t: 1587690110791, f: 463247}, {t: 1587690125791, f: 463440}, {t: 1587690140791, f: 463642}, {t: 1587690155791, f: 463811}, {t: 1587690170791, f: 464027}, {t: 1587690185791, f: 464308}, {t: 1587690200791, f: 464514}, {t: 1587690215791, f: 464798}, {t: 1587690230791, f: 465018}, {t: 1587690245791, f: 465215}, {t: 1587690260813, f: 465431}, {t: 1587690275791, f: 465651}, {t: 1587690290791, f: 465870}, {t: 1587690305791, f: 466070}, {t: 1587690320792, f: 466248}, @@ -495,7 +494,7 @@ func TestDedupSeriesSet(t *testing.T) { {t: 1587693530816, f: 510666}, {t: 1587693545791, f: 510871}, {t: 1587693560791, f: 511123}, {t: 1587693575791, f: 511303}, {t: 1587693590791, f: 511500}, }, }, { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {t: 1587690007139, f: 461993}, {t: 1587690022139, f: 462164}, {t: 1587690037139, f: 462409}, {t: 1587690052139, f: 462662}, {t: 1587690067139, f: 462824}, {t: 1587690082139, f: 462987}, {t: 1587690097155, f: 463108}, {t: 1587690112139, f: 463261}, {t: 1587690127139, f: 463465}, {t: 1587690142139, f: 463642}, {t: 1587690157139, f: 463823}, {t: 1587690172139, f: 464065}, {t: 1587690187139, f: 464333}, {t: 1587690202139, f: 464566}, {t: 1587690217139, f: 464811}, {t: 1587690232140, f: 465032}, {t: 1587690247139, f: 465229}, {t: 1587690262139, f: 465445}, {t: 1587690277139, f: 465700}, {t: 1587690292139, f: 465884}, @@ -526,7 +525,7 @@ func TestDedupSeriesSet(t *testing.T) { }, exp: []series{ { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: expectedRealSeriesWithStaleMarkerDeduplicatedForRate, }, }, @@ -539,7 +538,7 @@ func TestDedupSeriesSet(t *testing.T) { f = "rate" } dedupSet := NewSeriesSet(&mockedSeriesSet{series: tcase.input}, f, AlgorithmPenalty) - var ats []storage.Series + var ats []Series for dedupSet.Next() { ats = append(ats, dedupSet.At()) } diff --git a/pkg/dedup/quorum_iter.go b/pkg/dedup/quorum_iter.go index fcef658c52d..f29e50d3eb7 100644 --- a/pkg/dedup/quorum_iter.go +++ b/pkg/dedup/quorum_iter.go @@ -7,21 +7,21 @@ import ( "math" "github.com/prometheus/prometheus/model/histogram" - "github.com/prometheus/prometheus/model/labels" - "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" + + "github.com/thanos-io/thanos/pkg/store/labelpb" ) -// quorumSeries is a storage.Series that implements quorum algorithm. -// when replicas has conflict values at the same timestamp, the value in majority replica will be selected. +// quorumSeries implements dedup.Series using the quorum algorithm. +// When replicas have conflicting values at the same timestamp, the majority value is selected. type quorumSeries struct { - lset labels.Labels - replicas []storage.Series + lset labelpb.Labels + replicas []Series isCounter bool } -func NewQuorumSeries(lset labels.Labels, replicas []storage.Series, f string) storage.Series { +func NewQuorumSeries(lset labelpb.Labels, replicas []Series, f string) Series { return &quorumSeries{ lset: lset, replicas: replicas, @@ -30,7 +30,7 @@ func NewQuorumSeries(lset labels.Labels, replicas []storage.Series, f string) st } } -func (m *quorumSeries) Labels() labels.Labels { +func (m *quorumSeries) Labels() labelpb.Labels { return m.lset } func (m *quorumSeries) Iterator(_ chunkenc.Iterator) chunkenc.Iterator { diff --git a/pkg/dedup/quorum_iter_test.go b/pkg/dedup/quorum_iter_test.go index 1b77c00ce2e..4bcab7b2706 100644 --- a/pkg/dedup/quorum_iter_test.go +++ b/pkg/dedup/quorum_iter_test.go @@ -8,13 +8,13 @@ import ( "testing" "github.com/efficientgo/core/testutil" - "github.com/prometheus/prometheus/model/labels" - "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" + + "github.com/thanos-io/thanos/pkg/store/labelpb" ) func TestIteratorEdgeCases(t *testing.T) { - ms := NewQuorumSeries(labels.Labels{}, []storage.Series{}, "") + ms := NewQuorumSeries(labelpb.Labels{}, []Series{}, "") it := ms.Iterator(nil) testutil.Ok(t, it.Err()) testutil.Equals(t, int64(math.MinInt64), it.AtT()) @@ -34,46 +34,46 @@ func TestMergedSeriesIterator(t *testing.T) { name: "Single dedup label", input: []series{ { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{60000, 3}, {70000, 4}}, }, { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{200000, 5}, {210000, 6}}, }, { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}, {Name: "d", Value: "4"}}, + lset: labelpb.FromStrings("a", "1", "c", "3", "d", "4"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "4"}}, + lset: labelpb.FromStrings("a", "1", "c", "4"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.Labels{{Name: "a", Value: "2"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "2", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.Labels{{Name: "a", Value: "2"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "2", "c", "3"), samples: []sample{{60000, 3}, {70000, 4}}, }, }, exp: []series{ { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}, {60000, 3}, {70000, 4}, {200000, 5}, {210000, 6}}, }, { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}, {Name: "d", Value: "4"}}, + lset: labelpb.FromStrings("a", "1", "c", "3", "d", "4"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "4"}}, + lset: labelpb.FromStrings("a", "1", "c", "4"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.Labels{{Name: "a", Value: "2"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "2", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}, {60000, 3}, {70000, 4}}, }, }, @@ -82,50 +82,50 @@ func TestMergedSeriesIterator(t *testing.T) { name: "Multi dedup label", input: []series{ { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{60000, 3}, {70000, 4}}, }, { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{200000, 5}, {210000, 6}}, }, { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}, {Name: "d", Value: "4"}}, + lset: labelpb.FromStrings("a", "1", "c", "3", "d", "4"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "4"}}, + lset: labelpb.FromStrings("a", "1", "c", "4"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.Labels{{Name: "a", Value: "2"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "2", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.Labels{{Name: "a", Value: "2"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "2", "c", "3"), samples: []sample{{60000, 3}, {70000, 4}}, }, }, exp: []series{ { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}, {60000, 3}, {70000, 4}, {200000, 5}, {210000, 6}}, }, { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}, {Name: "d", Value: "4"}}, + lset: labelpb.FromStrings("a", "1", "c", "3", "d", "4"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "4"}}, + lset: labelpb.FromStrings("a", "1", "c", "4"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.Labels{{Name: "a", Value: "2"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "2", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}, {60000, 3}, {70000, 4}}, }, }, @@ -134,16 +134,16 @@ func TestMergedSeriesIterator(t *testing.T) { name: "Multi dedup label - some series don't have all dedup labels", input: []series{ { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}}, }, { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{60000, 3}, {70000, 4}}, }, }, exp: []series{ { - lset: labels.Labels{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}}, + lset: labelpb.FromStrings("a", "1", "c", "3"), samples: []sample{{10000, 1}, {20000, 2}, {60000, 3}, {70000, 4}}, }, }, @@ -158,19 +158,19 @@ func TestMergedSeriesIterator(t *testing.T) { name: "Multi dedup labels - data points absent", input: []series{ { - lset: labels.Labels{{Name: "a", Value: "5"}, {Name: "c", Value: "6"}}, + lset: labelpb.FromStrings("a", "5", "c", "6"), samples: []sample{{10000, 1}, {30000, 3}, {40000, 4}}, }, { - lset: labels.Labels{{Name: "a", Value: "5"}, {Name: "c", Value: "6"}}, + lset: labelpb.FromStrings("a", "5", "c", "6"), samples: []sample{{10000, 1}, {20000, 2}, {30000, 3}, {50000, 5}}, }, { - lset: labels.Labels{{Name: "a", Value: "5"}, {Name: "c", Value: "6"}}, + lset: labelpb.FromStrings("a", "5", "c", "6"), samples: []sample{{10000, 1}, {80000, 10}}, }, }, exp: []series{ { - lset: labels.Labels{{Name: "a", Value: "5"}, {Name: "c", Value: "6"}}, + lset: labelpb.FromStrings("a", "5", "c", "6"), samples: []sample{{10000, 1}, {20000, 2}, {30000, 3}, {40000, 4}, {50000, 5}, {80000, 10}}, }, }, @@ -179,32 +179,32 @@ func TestMergedSeriesIterator(t *testing.T) { name: "Avoid corrupt Values", input: []series{ { - lset: labels.Labels{{Name: "a", Value: "5"}, {Name: "c", Value: "6"}}, + lset: labelpb.FromStrings("a", "5", "c", "6"), samples: []sample{{10000, 1}, {20000, 23492}, {30000, 3}, {50000, 5}}, }, { - lset: labels.Labels{{Name: "a", Value: "5"}, {Name: "c", Value: "6"}}, + lset: labelpb.FromStrings("a", "5", "c", "6"), samples: []sample{{10000, 1}, {20000, 2}, {30000, 3}, {50000, 5}}, }, { - lset: labels.Labels{{Name: "a", Value: "5"}, {Name: "c", Value: "6"}}, + lset: labelpb.FromStrings("a", "5", "c", "6"), samples: []sample{{10000, 1}, {20000, 2}, {30000, 3}, {50000, 5}}, }, { - lset: labels.Labels{{Name: "b", Value: "5"}, {Name: "c", Value: "6"}}, + lset: labelpb.FromStrings("b", "5", "c", "6"), samples: []sample{{10000, 1}, {20000, 2}, {30000, 3}, {50000, 5}}, }, { - lset: labels.Labels{{Name: "b", Value: "5"}, {Name: "c", Value: "6"}}, + lset: labelpb.FromStrings("b", "5", "c", "6"), samples: []sample{{10000, 1}, {20000, 2}, {30000, 3}, {50000, 5}}, }, { - lset: labels.Labels{{Name: "b", Value: "5"}, {Name: "c", Value: "6"}}, + lset: labelpb.FromStrings("b", "5", "c", "6"), samples: []sample{{10000, 1}, {20000, 1234}, {30000, 3}, {50000, 5}}, }, }, exp: []series{ { - lset: labels.Labels{{Name: "a", Value: "5"}, {Name: "c", Value: "6"}}, + lset: labelpb.FromStrings("a", "5", "c", "6"), samples: []sample{{10000, 1}, {20000, 2}, {30000, 3}, {50000, 5}}, }, { - lset: labels.Labels{{Name: "b", Value: "5"}, {Name: "c", Value: "6"}}, + lset: labelpb.FromStrings("b", "5", "c", "6"), samples: []sample{{10000, 1}, {20000, 2}, {30000, 3}, {50000, 5}}, }, }, @@ -213,7 +213,7 @@ func TestMergedSeriesIterator(t *testing.T) { name: "ignore sampling interval too small", input: []series{ { - lset: labels.Labels{{Name: "a", Value: "1"}}, + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {10000, 8.0}, {20000, 9.0}, @@ -225,7 +225,7 @@ func TestMergedSeriesIterator(t *testing.T) { {100000, 9 + 6.0}, }, }, { - lset: labels.Labels{{Name: "a", Value: "1"}}, + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {10001, 8.0}, // Penalty 5000 will be added. // 20001 was app reset. No sample, because stale marker but removed by downsample.CounterSeriesIterator. Penalty 2 * (20000 - 10000) will be added. @@ -239,7 +239,7 @@ func TestMergedSeriesIterator(t *testing.T) { }, exp: []series{ { - lset: labels.Labels{{Name: "a", Value: "1"}}, + lset: labelpb.FromStrings("a", "1"), samples: []sample{{10000, 8}, {20000, 9}, {45001, 9}, {50001, 10}, {55001, 10}, {65001, 11}, {80000, 13}, {90000, 14}, {100000, 15}}, }, }, @@ -255,7 +255,7 @@ func TestMergedSeriesIterator(t *testing.T) { isCounter: true, input: []series{ { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {10000, 8.0}, // Smaller timestamp, this will be chosen. CurrValue = 8.0. {20000, 9.0}, // Same. CurrValue = 9.0. @@ -268,7 +268,7 @@ func TestMergedSeriesIterator(t *testing.T) { {100000, 9 + 6.0}, }, }, { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {10001, 8.0}, // Penalty 5000 will be added. // 20001 was app reset. No sample, because stale marker but removed by downsample.CounterSeriesIterator. Penalty 2 * (20000 - 10000) will be added. @@ -282,7 +282,7 @@ func TestMergedSeriesIterator(t *testing.T) { }, exp: []series{ { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{{10000, 8}, {20000, 9}, {45001, 9}, {t: 50001, f: 10}, {55001, 10}, {65001, 11}, {t: 80000, f: 13}, {90000, 14}, {100000, 15}}, }, }, @@ -293,12 +293,12 @@ func TestMergedSeriesIterator(t *testing.T) { isCounter: false, input: []series{ { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {10000, 8.0}, {20000, 9.0}, {50001, 9 + 1.0}, {60000, 9 + 2.0}, {70000, 9 + 3.0}, {80000, 9 + 4.0}, {90000, 9 + 5.0}, {100000, 9 + 6.0}, }, }, { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {10001, 8.0}, {45001, 8 + 0.5}, {55001, 8 + 1.5}, {65001, 8 + 2.5}, }, @@ -306,7 +306,7 @@ func TestMergedSeriesIterator(t *testing.T) { }, exp: []series{ { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{{10000, 8}, {20000, 9}, {45001, 8.5}, {t: 50001, f: 10}, {55001, 9.5}, {65001, 10.5}, {t: 80000, f: 13}, {90000, 14}, {100000, 15}}, }, }, @@ -316,13 +316,13 @@ func TestMergedSeriesIterator(t *testing.T) { isCounter: false, input: []series{ { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {10000, 8.0}, {20000, 9.0}, {1050001, 1.0}, {1060001, 5.0}, {2060001, 3.0}, }, }, { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {10000, 8.0}, {20000, 9.0}, {1050001, 1.0}, {1060001, 5.0}, {2060001, 3.0}, }, @@ -330,7 +330,7 @@ func TestMergedSeriesIterator(t *testing.T) { }, exp: []series{ { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{{10000, 8.0}, {20000, 9.0}, {1050001, 1.0}, {1060001, 5.0}, {2060001, 3.0}}, }, }, @@ -340,13 +340,13 @@ func TestMergedSeriesIterator(t *testing.T) { isCounter: true, input: []series{ { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {10000, 8.0}, {20000, 9.0}, {1050001, 1.0}, {1060001, 5.0}, {2060001, 3.0}, }, }, { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {10000, 8.0}, {20000, 9.0}, {1050001, 1.0}, {1060001, 5.0}, {2060001, 3.0}, }, @@ -354,7 +354,7 @@ func TestMergedSeriesIterator(t *testing.T) { }, exp: []series{ { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{{10000, 8.0}, {20000, 9.0}, {1050001, 9.0}, {1060001, 13.0}, {2060001, 13.0}}, }, }, @@ -364,19 +364,19 @@ func TestMergedSeriesIterator(t *testing.T) { isCounter: true, input: []series{ { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {10000, 10.0}, {100000, 8.0}, {110000, 10.0}, }, }, { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {10000, 10.0}, {20000, 0.0}, {30000, 1.0}, {40000, 2.0}, {50000, 3.0}, {60000, 4.0}, {70000, 5.0}, {80000, 6.0}, {90000, 7.0}, {100000, 8.0}, {110000, 10.0}, }, }, { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {10000, 10.0}, {20000, 0.0}, {30000, 1.0}, {40000, 2.0}, {50000, 3.0}, {60000, 4.0}, {70000, 5.0}, {80000, 6.0}, {90000, 7.0}, {100000, 8.0}, {110000, 10.0}, }, @@ -384,7 +384,7 @@ func TestMergedSeriesIterator(t *testing.T) { }, exp: []series{ { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), samples: []sample{ {10000, 10.0}, {20000, 10.0}, {30000, 11.0}, {40000, 12.0}, {50000, 13.0}, {60000, 14.0}, {70000, 15.0}, {80000, 16.0}, {90000, 17.0}, {100000, 18.0}, {110000, 20.0}, }, @@ -400,7 +400,7 @@ func TestMergedSeriesIterator(t *testing.T) { f = "rate" } dedupSet := NewSeriesSet(&mockedSeriesSet{series: tcase.input}, f, AlgorithmQuorum) - var ats []storage.Series + var ats []Series for dedupSet.Next() { ats = append(ats, dedupSet.At()) } diff --git a/pkg/exemplars/exemplars.go b/pkg/exemplars/exemplars.go index 9638074bd02..29df066104d 100644 --- a/pkg/exemplars/exemplars.go +++ b/pkg/exemplars/exemplars.go @@ -109,8 +109,8 @@ func dedupExemplarsResponse(exemplarsData []*exemplarspb.ExemplarData, replicaLa if len(e.Exemplars) == 0 { continue } - e.SeriesLabels.Labels = removeReplicaLabels(e.SeriesLabels.Labels, replicaLabels) - h := labelpb.ZLabelsToPromLabels(e.SeriesLabels.Labels).Hash() + e.SeriesLabels.Labels = removeReplicaLabels(e.SeriesLabels.GetLabels(), replicaLabels) + h := labelpb.Hash(e.SeriesLabels.GetLabels()) if ref, ok := hashToExemplar[h]; ok { ref.Exemplars = append(ref.Exemplars, e.Exemplars...) } else { @@ -155,12 +155,12 @@ func dedupExemplars(exemplars []*exemplarspb.Exemplar) []*exemplarspb.Exemplar { return exemplars[:i+1] } -func removeReplicaLabels(labels []labelpb.ZLabel, replicaLabels map[string]struct{}) []labelpb.ZLabel { +func removeReplicaLabels(lbls []*labelpb.Label, replicaLabels map[string]struct{}) []*labelpb.Label { if len(replicaLabels) == 0 { - return labels + return lbls } - newLabels := make([]labelpb.ZLabel, 0, len(labels)) - for _, l := range labels { + newLabels := make([]*labelpb.Label, 0, len(lbls)) + for _, l := range lbls { if _, ok := replicaLabels[l.Name]; !ok { newLabels = append(newLabels, l) } diff --git a/pkg/exemplars/exemplars_test.go b/pkg/exemplars/exemplars_test.go index daea15182a4..96ef9c50988 100644 --- a/pkg/exemplars/exemplars_test.go +++ b/pkg/exemplars/exemplars_test.go @@ -6,9 +6,9 @@ package exemplars import ( "testing" - "github.com/efficientgo/core/testutil" "github.com/thanos-io/thanos/pkg/exemplars/exemplarspb" "github.com/thanos-io/thanos/pkg/store/labelpb" + thanostestutil "github.com/thanos-io/thanos/pkg/testutil" "github.com/thanos-io/thanos/pkg/testutil/custom" ) @@ -36,12 +36,12 @@ func TestDedupExemplarsResponse(t *testing.T) { name: "empty exemplars data", exemplars: []*exemplarspb.ExemplarData{ { - SeriesLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__name__", Value: "test_exemplar_metric_total"}, - {Name: "instance", Value: "localhost:8090"}, - {Name: "job", Value: "prometheus"}, - {Name: "service", Value: "bar"}, - }}, + SeriesLabels: labelpb.LabelSetFromStrings( + "__name__", "test_exemplar_metric_total", + "instance", "localhost:8090", + "job", "prometheus", + "service", "bar", + ), }, }, want: []*exemplarspb.ExemplarData{}, @@ -51,64 +51,56 @@ func TestDedupExemplarsResponse(t *testing.T) { replicaLabels: []string{"replica"}, exemplars: []*exemplarspb.ExemplarData{ { - SeriesLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__name__", Value: "test_exemplar_metric_total"}, - {Name: "instance", Value: "localhost:8090"}, - {Name: "job", Value: "prometheus"}, - {Name: "service", Value: "bar"}, - {Name: "replica", Value: "0"}, - }}, + SeriesLabels: labelpb.LabelSetFromStrings( + "__name__", "test_exemplar_metric_total", + "instance", "localhost:8090", + "job", "prometheus", + "service", "bar", + "replica", "0", + ), Exemplars: []*exemplarspb.Exemplar{ { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "traceID", Value: "EpTxMJ40fUus7aGY"}, - }}, - Value: 19, - Ts: 1600096955479, + Labels: labelpb.LabelSetFromStrings("traceID", "EpTxMJ40fUus7aGY"), + Value: 19, + Ts: 1600096955479, }, { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "traceID", Value: "EpTxMJ40fUus7aGY"}, - }}, - Value: 19, - Ts: 1600096955479, + Labels: labelpb.LabelSetFromStrings("traceID", "EpTxMJ40fUus7aGY"), + Value: 19, + Ts: 1600096955479, }, }, }, { - SeriesLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__name__", Value: "test_exemplar_metric_total"}, - {Name: "instance", Value: "localhost:8090"}, - {Name: "job", Value: "prometheus"}, - {Name: "service", Value: "bar"}, - {Name: "replica", Value: "1"}, - }}, + SeriesLabels: labelpb.LabelSetFromStrings( + "__name__", "test_exemplar_metric_total", + "instance", "localhost:8090", + "job", "prometheus", + "service", "bar", + "replica", "1", + ), Exemplars: []*exemplarspb.Exemplar{ { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "traceID", Value: "EpTxMJ40fUus7aGY"}, - }}, - Value: 19, - Ts: 1600096955479, + Labels: labelpb.LabelSetFromStrings("traceID", "EpTxMJ40fUus7aGY"), + Value: 19, + Ts: 1600096955479, }, }, }, }, want: []*exemplarspb.ExemplarData{ { - SeriesLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__name__", Value: "test_exemplar_metric_total"}, - {Name: "instance", Value: "localhost:8090"}, - {Name: "job", Value: "prometheus"}, - {Name: "service", Value: "bar"}, - }}, + SeriesLabels: labelpb.LabelSetFromStrings( + "__name__", "test_exemplar_metric_total", + "instance", "localhost:8090", + "job", "prometheus", + "service", "bar", + ), Exemplars: []*exemplarspb.Exemplar{ { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "traceID", Value: "EpTxMJ40fUus7aGY"}, - }}, - Value: 19, - Ts: 1600096955479, + Labels: labelpb.LabelSetFromStrings("traceID", "EpTxMJ40fUus7aGY"), + Value: 19, + Ts: 1600096955479, }, }, }, @@ -119,100 +111,82 @@ func TestDedupExemplarsResponse(t *testing.T) { replicaLabels: []string{"replica"}, exemplars: []*exemplarspb.ExemplarData{ { - SeriesLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__name__", Value: "test_exemplar_metric_total"}, - {Name: "instance", Value: "localhost:8090"}, - {Name: "job", Value: "prometheus"}, - {Name: "service", Value: "bar"}, - {Name: "replica", Value: "0"}, - }}, + SeriesLabels: labelpb.LabelSetFromStrings( + "__name__", "test_exemplar_metric_total", + "instance", "localhost:8090", + "job", "prometheus", + "service", "bar", + "replica", "0", + ), Exemplars: []*exemplarspb.Exemplar{ { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "traceID", Value: "EpTxMJ40fUus7aGY"}, - }}, - Value: 19, - Ts: 1600096955479, + Labels: labelpb.LabelSetFromStrings("traceID", "EpTxMJ40fUus7aGY"), + Value: 19, + Ts: 1600096955479, }, { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "traceID", Value: "foo"}, - }}, - Value: 19, - Ts: 1600096955470, + Labels: labelpb.LabelSetFromStrings("traceID", "foo"), + Value: 19, + Ts: 1600096955470, }, }, }, { - SeriesLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__name__", Value: "test_exemplar_metric_total"}, - {Name: "instance", Value: "localhost:8090"}, - {Name: "job", Value: "prometheus"}, - {Name: "service", Value: "bar"}, - {Name: "replica", Value: "1"}, - }}, + SeriesLabels: labelpb.LabelSetFromStrings( + "__name__", "test_exemplar_metric_total", + "instance", "localhost:8090", + "job", "prometheus", + "service", "bar", + "replica", "1", + ), Exemplars: []*exemplarspb.Exemplar{ { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "traceID", Value: "bar"}, - }}, - Value: 19, - Ts: 1600096955579, + Labels: labelpb.LabelSetFromStrings("traceID", "bar"), + Value: 19, + Ts: 1600096955579, }, { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "traceID", Value: "EpTxMJ40fUus7aGY"}, - }}, - Value: 19, - Ts: 1600096955479, + Labels: labelpb.LabelSetFromStrings("traceID", "EpTxMJ40fUus7aGY"), + Value: 19, + Ts: 1600096955479, }, // Same ts but different labels, cannot dedup. { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "traceID", Value: "test"}, - }}, - Value: 19, - Ts: 1600096955479, + Labels: labelpb.LabelSetFromStrings("traceID", "test"), + Value: 19, + Ts: 1600096955479, }, }, }, }, want: []*exemplarspb.ExemplarData{ { - SeriesLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__name__", Value: "test_exemplar_metric_total"}, - {Name: "instance", Value: "localhost:8090"}, - {Name: "job", Value: "prometheus"}, - {Name: "service", Value: "bar"}, - }}, + SeriesLabels: labelpb.LabelSetFromStrings( + "__name__", "test_exemplar_metric_total", + "instance", "localhost:8090", + "job", "prometheus", + "service", "bar", + ), Exemplars: []*exemplarspb.Exemplar{ { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "traceID", Value: "foo"}, - }}, - Value: 19, - Ts: 1600096955470, + Labels: labelpb.LabelSetFromStrings("traceID", "foo"), + Value: 19, + Ts: 1600096955470, }, { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "traceID", Value: "EpTxMJ40fUus7aGY"}, - }}, - Value: 19, - Ts: 1600096955479, + Labels: labelpb.LabelSetFromStrings("traceID", "EpTxMJ40fUus7aGY"), + Value: 19, + Ts: 1600096955479, }, { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "traceID", Value: "test"}, - }}, - Value: 19, - Ts: 1600096955479, + Labels: labelpb.LabelSetFromStrings("traceID", "test"), + Value: 19, + Ts: 1600096955479, }, { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "traceID", Value: "bar"}, - }}, - Value: 19, - Ts: 1600096955579, + Labels: labelpb.LabelSetFromStrings("traceID", "bar"), + Value: 19, + Ts: 1600096955579, }, }, }, @@ -224,7 +198,7 @@ func TestDedupExemplarsResponse(t *testing.T) { for _, lbl := range tc.replicaLabels { replicaLabels[lbl] = struct{}{} } - testutil.Equals(t, tc.want, dedupExemplarsResponse(tc.exemplars, replicaLabels)) + thanostestutil.ProtoEquals(t, tc.want, dedupExemplarsResponse(tc.exemplars, replicaLabels)) }) } } diff --git a/pkg/exemplars/exemplarspb/custom.go b/pkg/exemplars/exemplarspb/custom.go index b636d98faf0..683ff57253e 100644 --- a/pkg/exemplars/exemplarspb/custom.go +++ b/pkg/exemplars/exemplarspb/custom.go @@ -17,13 +17,13 @@ import ( // ExemplarStore wraps the ExemplarsClient and contains the info of external labels. type ExemplarStore struct { ExemplarsClient - LabelSets []labels.Labels + LabelSets []labelpb.Labels } // UnmarshalJSON implements json.Unmarshaler. func (m *Exemplar) UnmarshalJSON(b []byte) error { v := struct { - Labels labelpb.ZLabelSet + Labels *labelpb.LabelSet TimeStamp model.Time Value model.SampleValue }{} @@ -45,7 +45,7 @@ func (m *Exemplar) MarshalJSON() ([]byte, error) { TimeStamp model.Time `json:"timestamp"` Value model.SampleValue `json:"value"` }{ - Labels: labelpb.ZLabelsToPromLabels(m.Labels.Labels), + Labels: m.GetLabels().PromLabels(), TimeStamp: model.Time(m.Ts), Value: model.SampleValue(m.Value), } @@ -70,17 +70,7 @@ func NewWarningExemplarsResponse(warning error) *ExemplarsResponse { // Compare only compares the series labels of two exemplar data. func (s1 *ExemplarData) Compare(s2 *ExemplarData) int { - return labels.Compare(s1.SeriesLabels.PromLabels(), s2.SeriesLabels.PromLabels()) -} - -func (s *ExemplarData) SetSeriesLabels(ls labels.Labels) { - var result labelpb.ZLabelSet - - if !ls.IsEmpty() { - result = labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(ls)} - } - - s.SeriesLabels = result + return labelpb.Compare(s1.SeriesLabels.GetLabels(), s2.SeriesLabels.GetLabels()) } // Compare is used for sorting and comparing exemplars. Start from timestamp, then labels, finally values. @@ -92,7 +82,7 @@ func (e1 *Exemplar) Compare(e2 *Exemplar) int { return 1 } - if d := labels.Compare(e1.Labels.PromLabels(), e2.Labels.PromLabels()); d != 0 { + if d := labelpb.Compare(e1.Labels.GetLabels(), e2.Labels.GetLabels()); d != 0 { return d } return big.NewFloat(e1.Value).Cmp(big.NewFloat(e2.Value)) @@ -101,11 +91,14 @@ func (e1 *Exemplar) Compare(e2 *Exemplar) int { func ExemplarsFromPromExemplars(exemplars []exemplar.Exemplar) []*Exemplar { ex := make([]*Exemplar, 0, len(exemplars)) for _, e := range exemplars { - ex = append(ex, &Exemplar{ - Labels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(e.Labels)}, - Value: e.Value, - Ts: e.Ts, - }) + r := &Exemplar{ + Value: e.Value, + Ts: e.Ts, + } + if e.Labels.Len() > 0 { + r.Labels = &labelpb.LabelSet{Labels: labelpb.FromPromLabels(e.Labels)} + } + ex = append(ex, r) } return ex } diff --git a/pkg/exemplars/exemplarspb/rpc.pb.go b/pkg/exemplars/exemplarspb/rpc.pb.go index 886a140aea9..122a164c34e 100644 --- a/pkg/exemplars/exemplarspb/rpc.pb.go +++ b/pkg/exemplars/exemplarspb/rpc.pb.go @@ -1,1269 +1,414 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.20.1 // source: exemplars/exemplarspb/rpc.proto package exemplarspb import ( - context "context" - encoding_binary "encoding/binary" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" + reflect "reflect" + sync "sync" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/srikrsna/protoc-gen-gotag/tagger" labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" storepb "github.com/thanos-io/thanos/pkg/store/storepb" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type ExemplarsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` Start int64 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"` End int64 `protobuf:"varint,3,opt,name=end,proto3" json:"end,omitempty"` PartialResponseStrategy storepb.PartialResponseStrategy `protobuf:"varint,4,opt,name=partial_response_strategy,json=partialResponseStrategy,proto3,enum=thanos.PartialResponseStrategy" json:"partial_response_strategy,omitempty"` } -func (m *ExemplarsRequest) Reset() { *m = ExemplarsRequest{} } -func (m *ExemplarsRequest) String() string { return proto.CompactTextString(m) } -func (*ExemplarsRequest) ProtoMessage() {} -func (*ExemplarsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fd9ad2a40bac3cc9, []int{0} -} -func (m *ExemplarsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ExemplarsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ExemplarsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ExemplarsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExemplarsRequest.Merge(m, src) -} -func (m *ExemplarsRequest) XXX_Size() int { - return m.Size() +func (x *ExemplarsRequest) Reset() { + *x = ExemplarsRequest{} + mi := &file_exemplars_exemplarspb_rpc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ExemplarsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ExemplarsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ExemplarsRequest proto.InternalMessageInfo -type ExemplarsResponse struct { - // Types that are valid to be assigned to Result: - // *ExemplarsResponse_Data - // *ExemplarsResponse_Warning - Result isExemplarsResponse_Result `protobuf_oneof:"result"` -} - -func (m *ExemplarsResponse) Reset() { *m = ExemplarsResponse{} } -func (m *ExemplarsResponse) String() string { return proto.CompactTextString(m) } -func (*ExemplarsResponse) ProtoMessage() {} -func (*ExemplarsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fd9ad2a40bac3cc9, []int{1} -} -func (m *ExemplarsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ExemplarsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ExemplarsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ExemplarsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExemplarsResponse.Merge(m, src) -} -func (m *ExemplarsResponse) XXX_Size() int { - return m.Size() -} -func (m *ExemplarsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ExemplarsResponse.DiscardUnknown(m) +func (x *ExemplarsRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_ExemplarsResponse proto.InternalMessageInfo +func (*ExemplarsRequest) ProtoMessage() {} -type isExemplarsResponse_Result interface { - isExemplarsResponse_Result() - MarshalTo([]byte) (int, error) - Size() int -} - -type ExemplarsResponse_Data struct { - Data *ExemplarData `protobuf:"bytes,1,opt,name=data,proto3,oneof" json:"data,omitempty"` -} -type ExemplarsResponse_Warning struct { - Warning string `protobuf:"bytes,2,opt,name=warning,proto3,oneof" json:"warning,omitempty"` -} - -func (*ExemplarsResponse_Data) isExemplarsResponse_Result() {} -func (*ExemplarsResponse_Warning) isExemplarsResponse_Result() {} - -func (m *ExemplarsResponse) GetResult() isExemplarsResponse_Result { - if m != nil { - return m.Result +func (x *ExemplarsRequest) ProtoReflect() protoreflect.Message { + mi := &file_exemplars_exemplarspb_rpc_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) } -func (m *ExemplarsResponse) GetData() *ExemplarData { - if x, ok := m.GetResult().(*ExemplarsResponse_Data); ok { - return x.Data - } - return nil +// Deprecated: Use ExemplarsRequest.ProtoReflect.Descriptor instead. +func (*ExemplarsRequest) Descriptor() ([]byte, []int) { + return file_exemplars_exemplarspb_rpc_proto_rawDescGZIP(), []int{0} } -func (m *ExemplarsResponse) GetWarning() string { - if x, ok := m.GetResult().(*ExemplarsResponse_Warning); ok { - return x.Warning +func (x *ExemplarsRequest) GetQuery() string { + if x != nil { + return x.Query } return "" } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ExemplarsResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ExemplarsResponse_Data)(nil), - (*ExemplarsResponse_Warning)(nil), +func (x *ExemplarsRequest) GetStart() int64 { + if x != nil { + return x.Start } + return 0 } -type ExemplarData struct { - SeriesLabels labelpb.ZLabelSet `protobuf:"bytes,1,opt,name=seriesLabels,proto3" json:"seriesLabels"` - Exemplars []*Exemplar `protobuf:"bytes,2,rep,name=exemplars,proto3" json:"exemplars"` -} - -func (m *ExemplarData) Reset() { *m = ExemplarData{} } -func (m *ExemplarData) String() string { return proto.CompactTextString(m) } -func (*ExemplarData) ProtoMessage() {} -func (*ExemplarData) Descriptor() ([]byte, []int) { - return fileDescriptor_fd9ad2a40bac3cc9, []int{2} -} -func (m *ExemplarData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ExemplarData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ExemplarData.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *ExemplarsRequest) GetEnd() int64 { + if x != nil { + return x.End } -} -func (m *ExemplarData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExemplarData.Merge(m, src) -} -func (m *ExemplarData) XXX_Size() int { - return m.Size() -} -func (m *ExemplarData) XXX_DiscardUnknown() { - xxx_messageInfo_ExemplarData.DiscardUnknown(m) -} - -var xxx_messageInfo_ExemplarData proto.InternalMessageInfo - -type Exemplar struct { - Labels labelpb.ZLabelSet `protobuf:"bytes,1,opt,name=labels,proto3" json:"labels"` - Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value"` - Ts int64 `protobuf:"varint,3,opt,name=ts,proto3" json:"timestamp"` + return 0 } -func (m *Exemplar) Reset() { *m = Exemplar{} } -func (m *Exemplar) String() string { return proto.CompactTextString(m) } -func (*Exemplar) ProtoMessage() {} -func (*Exemplar) Descriptor() ([]byte, []int) { - return fileDescriptor_fd9ad2a40bac3cc9, []int{3} -} -func (m *Exemplar) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Exemplar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Exemplar.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *ExemplarsRequest) GetPartialResponseStrategy() storepb.PartialResponseStrategy { + if x != nil { + return x.PartialResponseStrategy } -} -func (m *Exemplar) XXX_Merge(src proto.Message) { - xxx_messageInfo_Exemplar.Merge(m, src) -} -func (m *Exemplar) XXX_Size() int { - return m.Size() -} -func (m *Exemplar) XXX_DiscardUnknown() { - xxx_messageInfo_Exemplar.DiscardUnknown(m) -} - -var xxx_messageInfo_Exemplar proto.InternalMessageInfo - -func init() { - proto.RegisterType((*ExemplarsRequest)(nil), "thanos.ExemplarsRequest") - proto.RegisterType((*ExemplarsResponse)(nil), "thanos.ExemplarsResponse") - proto.RegisterType((*ExemplarData)(nil), "thanos.ExemplarData") - proto.RegisterType((*Exemplar)(nil), "thanos.Exemplar") + return storepb.PartialResponseStrategy(0) } -func init() { proto.RegisterFile("exemplars/exemplarspb/rpc.proto", fileDescriptor_fd9ad2a40bac3cc9) } +type ExemplarsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -var fileDescriptor_fd9ad2a40bac3cc9 = []byte{ - // 465 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x86, 0xbd, 0x49, 0x1b, 0xea, 0x49, 0xa9, 0xd2, 0x55, 0x24, 0x9c, 0x48, 0xd8, 0x51, 0x4e, - 0x81, 0x43, 0x8c, 0xc2, 0x89, 0x03, 0x17, 0x0b, 0xa4, 0x4a, 0x20, 0x81, 0xb6, 0xb7, 0x72, 0xa8, - 0x36, 0x74, 0x14, 0x22, 0x39, 0xf6, 0x76, 0x77, 0x02, 0xe4, 0x01, 0xb8, 0x73, 0xe6, 0x1d, 0x78, - 0x8f, 0x1c, 0x7b, 0xe4, 0x14, 0x41, 0x72, 0xcb, 0x53, 0xa0, 0xec, 0xda, 0x69, 0x1a, 0x55, 0xea, - 0xc5, 0x3b, 0xf3, 0xcf, 0x67, 0xef, 0x3f, 0x3b, 0x6b, 0x88, 0xf0, 0x3b, 0x4e, 0x54, 0x2a, 0xb5, - 0x89, 0xb7, 0x91, 0x1a, 0xc6, 0x5a, 0x7d, 0xee, 0x2b, 0x9d, 0x53, 0xce, 0x6b, 0xf4, 0x45, 0x66, - 0xb9, 0x69, 0xb7, 0x0c, 0xe5, 0x1a, 0x63, 0xfb, 0x54, 0xc3, 0x98, 0x66, 0x0a, 0x8d, 0x43, 0xca, - 0x52, 0x2a, 0x87, 0x98, 0xee, 0x95, 0x9a, 0xa3, 0x7c, 0x94, 0xdb, 0x30, 0xde, 0x44, 0x4e, 0xed, - 0xfe, 0x66, 0xd0, 0x78, 0x5b, 0xee, 0x26, 0xf0, 0x7a, 0x8a, 0x86, 0x78, 0x13, 0x0e, 0xaf, 0xa7, - 0xa8, 0x67, 0x01, 0xeb, 0xb0, 0x9e, 0x2f, 0x5c, 0xb2, 0x51, 0x0d, 0x49, 0x4d, 0x41, 0xa5, 0xc3, - 0x7a, 0x55, 0xe1, 0x12, 0xde, 0x80, 0x2a, 0x66, 0x57, 0x41, 0xd5, 0x6a, 0x9b, 0x90, 0x7f, 0x82, - 0x96, 0x92, 0x9a, 0xc6, 0x32, 0xbd, 0xd4, 0x68, 0x54, 0x9e, 0x19, 0xbc, 0x34, 0xa4, 0x25, 0xe1, - 0x68, 0x16, 0x1c, 0x74, 0x58, 0xef, 0x64, 0x10, 0xf5, 0x5d, 0x2b, 0xfd, 0x8f, 0x0e, 0x14, 0x05, - 0x77, 0x5e, 0x60, 0xe2, 0x89, 0xba, 0xbf, 0xd0, 0x45, 0x38, 0xdd, 0xb1, 0xeb, 0x8a, 0xfc, 0x39, - 0x1c, 0x5c, 0x49, 0x92, 0xd6, 0x6e, 0x7d, 0xd0, 0x2c, 0x3f, 0x5e, 0x82, 0x6f, 0x24, 0xc9, 0x33, - 0x4f, 0x58, 0x86, 0xb7, 0xe1, 0xd1, 0x37, 0xa9, 0xb3, 0x71, 0x36, 0xb2, 0x7d, 0xf8, 0x67, 0x9e, - 0x28, 0x85, 0xe4, 0x08, 0x6a, 0x1a, 0xcd, 0x34, 0xa5, 0xee, 0x2f, 0x06, 0xc7, 0xbb, 0xaf, 0xf3, - 0x77, 0x70, 0x6c, 0x50, 0x8f, 0xd1, 0xbc, 0xdf, 0x1c, 0xad, 0x29, 0xb6, 0x3a, 0x2d, 0xb7, 0xba, - 0xb0, 0xf2, 0x39, 0x52, 0xd2, 0x9c, 0x2f, 0x22, 0x6f, 0xbd, 0x88, 0xee, 0xe0, 0xe2, 0x4e, 0xc6, - 0x5f, 0x83, 0xbf, 0x9d, 0x70, 0x50, 0xe9, 0x54, 0x7b, 0xf5, 0x41, 0x63, 0xdf, 0x74, 0xf2, 0x78, - 0xbd, 0x88, 0x6e, 0x31, 0x71, 0x1b, 0x76, 0x7f, 0x30, 0x38, 0x2a, 0x31, 0xfe, 0x0a, 0x6a, 0xe9, - 0x03, 0x96, 0x4e, 0x0a, 0x4b, 0x05, 0x28, 0x8a, 0x95, 0x47, 0x70, 0xf8, 0x55, 0xa6, 0x53, 0xb4, - 0x07, 0xc1, 0x12, 0x7f, 0xbd, 0x88, 0x9c, 0x20, 0xdc, 0xc2, 0x9f, 0x42, 0x85, 0x8c, 0x1b, 0xad, - 0xb3, 0x43, 0xe3, 0x09, 0x1a, 0x92, 0x13, 0x25, 0x2a, 0x64, 0x06, 0x1f, 0xc0, 0xdf, 0xce, 0x82, - 0x27, 0xbb, 0x49, 0xb0, 0xdf, 0x4d, 0x79, 0xb5, 0xda, 0xad, 0x7b, 0x2a, 0x6e, 0x8a, 0x2f, 0x58, - 0xf2, 0x6c, 0xfe, 0x2f, 0xf4, 0xe6, 0xcb, 0x90, 0xdd, 0x2c, 0x43, 0xf6, 0x77, 0x19, 0xb2, 0x9f, - 0xab, 0xd0, 0xbb, 0x59, 0x85, 0xde, 0x9f, 0x55, 0xe8, 0x5d, 0xd4, 0x77, 0xfe, 0x8a, 0x61, 0xcd, - 0x5e, 0xdf, 0x97, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x15, 0xe4, 0x68, 0x35, 0x03, 0x00, - 0x00, + // Types that are assignable to Result: + // + // *ExemplarsResponse_Data + // *ExemplarsResponse_Warning + Result isExemplarsResponse_Result `protobuf_oneof:"result"` } -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// ExemplarsClient is the client API for Exemplars service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ExemplarsClient interface { - /// Exemplars has info for all exemplars. - /// Returned exemplars are expected to include external labels. - Exemplars(ctx context.Context, in *ExemplarsRequest, opts ...grpc.CallOption) (Exemplars_ExemplarsClient, error) +func (x *ExemplarsResponse) Reset() { + *x = ExemplarsResponse{} + mi := &file_exemplars_exemplarspb_rpc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -type exemplarsClient struct { - cc *grpc.ClientConn +func (x *ExemplarsResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func NewExemplarsClient(cc *grpc.ClientConn) ExemplarsClient { - return &exemplarsClient{cc} -} +func (*ExemplarsResponse) ProtoMessage() {} -func (c *exemplarsClient) Exemplars(ctx context.Context, in *ExemplarsRequest, opts ...grpc.CallOption) (Exemplars_ExemplarsClient, error) { - stream, err := c.cc.NewStream(ctx, &_Exemplars_serviceDesc.Streams[0], "/thanos.Exemplars/Exemplars", opts...) - if err != nil { - return nil, err - } - x := &exemplarsExemplarsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err +func (x *ExemplarsResponse) ProtoReflect() protoreflect.Message { + mi := &file_exemplars_exemplarspb_rpc_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return x, nil -} - -type Exemplars_ExemplarsClient interface { - Recv() (*ExemplarsResponse, error) - grpc.ClientStream + return mi.MessageOf(x) } -type exemplarsExemplarsClient struct { - grpc.ClientStream +// Deprecated: Use ExemplarsResponse.ProtoReflect.Descriptor instead. +func (*ExemplarsResponse) Descriptor() ([]byte, []int) { + return file_exemplars_exemplarspb_rpc_proto_rawDescGZIP(), []int{1} } -func (x *exemplarsExemplarsClient) Recv() (*ExemplarsResponse, error) { - m := new(ExemplarsResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err +func (m *ExemplarsResponse) GetResult() isExemplarsResponse_Result { + if m != nil { + return m.Result } - return m, nil -} - -// ExemplarsServer is the server API for Exemplars service. -type ExemplarsServer interface { - /// Exemplars has info for all exemplars. - /// Returned exemplars are expected to include external labels. - Exemplars(*ExemplarsRequest, Exemplars_ExemplarsServer) error -} - -// UnimplementedExemplarsServer can be embedded to have forward compatible implementations. -type UnimplementedExemplarsServer struct { -} - -func (*UnimplementedExemplarsServer) Exemplars(req *ExemplarsRequest, srv Exemplars_ExemplarsServer) error { - return status.Errorf(codes.Unimplemented, "method Exemplars not implemented") -} - -func RegisterExemplarsServer(s *grpc.Server, srv ExemplarsServer) { - s.RegisterService(&_Exemplars_serviceDesc, srv) + return nil } -func _Exemplars_Exemplars_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ExemplarsRequest) - if err := stream.RecvMsg(m); err != nil { - return err +func (x *ExemplarsResponse) GetData() *ExemplarData { + if x, ok := x.GetResult().(*ExemplarsResponse_Data); ok { + return x.Data } - return srv.(ExemplarsServer).Exemplars(m, &exemplarsExemplarsServer{stream}) + return nil } -type Exemplars_ExemplarsServer interface { - Send(*ExemplarsResponse) error - grpc.ServerStream +func (x *ExemplarsResponse) GetWarning() string { + if x, ok := x.GetResult().(*ExemplarsResponse_Warning); ok { + return x.Warning + } + return "" } -type exemplarsExemplarsServer struct { - grpc.ServerStream +type isExemplarsResponse_Result interface { + isExemplarsResponse_Result() } -func (x *exemplarsExemplarsServer) Send(m *ExemplarsResponse) error { - return x.ServerStream.SendMsg(m) +type ExemplarsResponse_Data struct { + Data *ExemplarData `protobuf:"bytes,1,opt,name=data,proto3,oneof"` } -var _Exemplars_serviceDesc = grpc.ServiceDesc{ - ServiceName: "thanos.Exemplars", - HandlerType: (*ExemplarsServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Exemplars", - Handler: _Exemplars_Exemplars_Handler, - ServerStreams: true, - }, - }, - Metadata: "exemplars/exemplarspb/rpc.proto", +type ExemplarsResponse_Warning struct { + Warning string `protobuf:"bytes,2,opt,name=warning,proto3,oneof"` } -func (m *ExemplarsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} +func (*ExemplarsResponse_Data) isExemplarsResponse_Result() {} -func (m *ExemplarsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} +func (*ExemplarsResponse_Warning) isExemplarsResponse_Result() {} -func (m *ExemplarsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) - i-- - dAtA[i] = 0x20 - } - if m.End != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.End)) - i-- - dAtA[i] = 0x18 - } - if m.Start != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Start)) - i-- - dAtA[i] = 0x10 - } - if len(m.Query) > 0 { - i -= len(m.Query) - copy(dAtA[i:], m.Query) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Query))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} +type ExemplarData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ExemplarsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil + SeriesLabels *labelpb.LabelSet `protobuf:"bytes,1,opt,name=seriesLabels,proto3" json:"seriesLabels"` + Exemplars []*Exemplar `protobuf:"bytes,2,rep,name=exemplars,proto3" json:"exemplars"` } -func (m *ExemplarsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *ExemplarData) Reset() { + *x = ExemplarData{} + mi := &file_exemplars_exemplarspb_rpc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ExemplarsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Result != nil { - { - size := m.Result.Size() - i -= size - if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil +func (x *ExemplarData) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ExemplarsResponse_Data) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} +func (*ExemplarData) ProtoMessage() {} -func (m *ExemplarsResponse_Data) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Data != nil { - { - size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) +func (x *ExemplarData) ProtoReflect() protoreflect.Message { + mi := &file_exemplars_exemplarspb_rpc_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *ExemplarsResponse_Warning) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ExemplarsResponse_Warning) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.Warning) - copy(dAtA[i:], m.Warning) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Warning))) - i-- - dAtA[i] = 0x12 - return len(dAtA) - i, nil -} -func (m *ExemplarData) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + return ms } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *ExemplarData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use ExemplarData.ProtoReflect.Descriptor instead. +func (*ExemplarData) Descriptor() ([]byte, []int) { + return file_exemplars_exemplarspb_rpc_proto_rawDescGZIP(), []int{2} } -func (m *ExemplarData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Exemplars) > 0 { - for iNdEx := len(m.Exemplars) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Exemplars[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } +func (x *ExemplarData) GetSeriesLabels() *labelpb.LabelSet { + if x != nil { + return x.SeriesLabels } - { - size, err := m.SeriesLabels.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + return nil } -func (m *Exemplar) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ExemplarData) GetExemplars() []*Exemplar { + if x != nil { + return x.Exemplars } - return dAtA[:n], nil -} - -func (m *Exemplar) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return nil } -func (m *Exemplar) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Ts != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Ts)) - i-- - dAtA[i] = 0x18 - } - if m.Value != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) - i-- - dAtA[i] = 0x11 - } - { - size, err := m.Labels.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} +type Exemplar struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func encodeVarintRpc(dAtA []byte, offset int, v uint64) int { - offset -= sovRpc(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ExemplarsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Query) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.Start != 0 { - n += 1 + sovRpc(uint64(m.Start)) - } - if m.End != 0 { - n += 1 + sovRpc(uint64(m.End)) - } - if m.PartialResponseStrategy != 0 { - n += 1 + sovRpc(uint64(m.PartialResponseStrategy)) - } - return n + Labels *labelpb.LabelSet `protobuf:"bytes,1,opt,name=labels,proto3" json:"labels"` + Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value"` + Ts int64 `protobuf:"varint,3,opt,name=ts,proto3" json:"timestamp"` } -func (m *ExemplarsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Result != nil { - n += m.Result.Size() - } - return n +func (x *Exemplar) Reset() { + *x = Exemplar{} + mi := &file_exemplars_exemplarspb_rpc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ExemplarsResponse_Data) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Data != nil { - l = m.Data.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *ExemplarsResponse_Warning) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Warning) - n += 1 + l + sovRpc(uint64(l)) - return n -} -func (m *ExemplarData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.SeriesLabels.Size() - n += 1 + l + sovRpc(uint64(l)) - if len(m.Exemplars) > 0 { - for _, e := range m.Exemplars { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n +func (x *Exemplar) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Exemplar) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Labels.Size() - n += 1 + l + sovRpc(uint64(l)) - if m.Value != 0 { - n += 9 - } - if m.Ts != 0 { - n += 1 + sovRpc(uint64(m.Ts)) - } - return n -} +func (*Exemplar) ProtoMessage() {} -func sovRpc(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRpc(x uint64) (n int) { - return sovRpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ExemplarsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ExemplarsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ExemplarsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Query = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) - } - m.Start = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Start |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) - } - m.End = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.End |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) - } - m.PartialResponseStrategy = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PartialResponseStrategy |= storepb.PartialResponseStrategy(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy +func (x *Exemplar) ProtoReflect() protoreflect.Message { + mi := &file_exemplars_exemplarspb_rpc_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil + return mi.MessageOf(x) } -func (m *ExemplarsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ExemplarsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ExemplarsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ExemplarData{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Result = &ExemplarsResponse_Data{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Warning", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Result = &ExemplarsResponse_Warning{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +// Deprecated: Use Exemplar.ProtoReflect.Descriptor instead. +func (*Exemplar) Descriptor() ([]byte, []int) { + return file_exemplars_exemplarspb_rpc_proto_rawDescGZIP(), []int{3} } -func (m *ExemplarData) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ExemplarData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ExemplarData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SeriesLabels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.SeriesLabels.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Exemplars", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Exemplars = append(m.Exemplars, &Exemplar{}) - if err := m.Exemplars[len(m.Exemplars)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *Exemplar) GetLabels() *labelpb.LabelSet { + if x != nil { + return x.Labels } return nil } -func (m *Exemplar) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Exemplar: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Exemplar: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Labels.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Value = float64(math.Float64frombits(v)) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Ts", wireType) - } - m.Ts = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Ts |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRpc(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthRpc - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRpc - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRpc - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF +func (x *Exemplar) GetValue() float64 { + if x != nil { + return x.Value + } + return 0 +} + +func (x *Exemplar) GetTs() int64 { + if x != nil { + return x.Ts + } + return 0 +} + +var File_exemplars_exemplarspb_rpc_proto protoreflect.FileDescriptor + +var file_exemplars_exemplarspb_rpc_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x2f, 0x65, 0x78, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x72, 0x73, 0x70, 0x62, 0x2f, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x06, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x1a, 0x19, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x70, 0x62, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x13, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2f, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xad, 0x01, 0x0a, 0x10, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, + 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x5b, 0x0a, 0x19, 0x70, 0x61, 0x72, 0x74, 0x69, + 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x73, 0x74, 0x72, 0x61, + 0x74, 0x65, 0x67, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x61, + 0x6e, 0x6f, 0x73, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x52, 0x17, 0x70, 0x61, 0x72, + 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x72, 0x61, + 0x74, 0x65, 0x67, 0x79, 0x22, 0x65, 0x0a, 0x11, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, + 0x2e, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x07, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, + 0x67, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xa5, 0x01, 0x0a, 0x0c, + 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x4e, 0x0a, 0x0c, + 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x53, 0x65, 0x74, 0x42, 0x18, 0x9a, 0x84, 0x9e, 0x03, 0x13, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x22, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x52, 0x0c, + 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x45, 0x0a, 0x09, + 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, + 0x72, 0x42, 0x15, 0x9a, 0x84, 0x9e, 0x03, 0x10, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x65, 0x78, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x22, 0x52, 0x09, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x72, 0x73, 0x22, 0x98, 0x01, 0x0a, 0x08, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, + 0x12, 0x3c, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, + 0x65, 0x74, 0x42, 0x12, 0x9a, 0x84, 0x9e, 0x03, 0x0d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x27, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x42, 0x11, 0x9a, + 0x84, 0x9e, 0x03, 0x0c, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x02, 0x74, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x42, 0x15, 0x9a, 0x84, 0x9e, 0x03, 0x10, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x52, 0x02, 0x74, 0x73, 0x32, 0x4f, + 0x0a, 0x09, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x42, 0x0a, 0x09, 0x45, + 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x18, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, + 0x73, 0x2e, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x45, 0x78, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, + 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x68, + 0x61, 0x6e, 0x6f, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2f, 0x70, + 0x6b, 0x67, 0x2f, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x2f, 0x65, 0x78, 0x65, + 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRpc = fmt.Errorf("proto: unexpected end of group") + file_exemplars_exemplarspb_rpc_proto_rawDescOnce sync.Once + file_exemplars_exemplarspb_rpc_proto_rawDescData = file_exemplars_exemplarspb_rpc_proto_rawDesc ) + +func file_exemplars_exemplarspb_rpc_proto_rawDescGZIP() []byte { + file_exemplars_exemplarspb_rpc_proto_rawDescOnce.Do(func() { + file_exemplars_exemplarspb_rpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_exemplars_exemplarspb_rpc_proto_rawDescData) + }) + return file_exemplars_exemplarspb_rpc_proto_rawDescData +} + +var file_exemplars_exemplarspb_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_exemplars_exemplarspb_rpc_proto_goTypes = []any{ + (*ExemplarsRequest)(nil), // 0: thanos.ExemplarsRequest + (*ExemplarsResponse)(nil), // 1: thanos.ExemplarsResponse + (*ExemplarData)(nil), // 2: thanos.ExemplarData + (*Exemplar)(nil), // 3: thanos.Exemplar + (storepb.PartialResponseStrategy)(0), // 4: thanos.PartialResponseStrategy + (*labelpb.LabelSet)(nil), // 5: thanos.LabelSet +} +var file_exemplars_exemplarspb_rpc_proto_depIdxs = []int32{ + 4, // 0: thanos.ExemplarsRequest.partial_response_strategy:type_name -> thanos.PartialResponseStrategy + 2, // 1: thanos.ExemplarsResponse.data:type_name -> thanos.ExemplarData + 5, // 2: thanos.ExemplarData.seriesLabels:type_name -> thanos.LabelSet + 3, // 3: thanos.ExemplarData.exemplars:type_name -> thanos.Exemplar + 5, // 4: thanos.Exemplar.labels:type_name -> thanos.LabelSet + 0, // 5: thanos.Exemplars.Exemplars:input_type -> thanos.ExemplarsRequest + 1, // 6: thanos.Exemplars.Exemplars:output_type -> thanos.ExemplarsResponse + 6, // [6:7] is the sub-list for method output_type + 5, // [5:6] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_exemplars_exemplarspb_rpc_proto_init() } +func file_exemplars_exemplarspb_rpc_proto_init() { + if File_exemplars_exemplarspb_rpc_proto != nil { + return + } + file_exemplars_exemplarspb_rpc_proto_msgTypes[1].OneofWrappers = []any{ + (*ExemplarsResponse_Data)(nil), + (*ExemplarsResponse_Warning)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_exemplars_exemplarspb_rpc_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_exemplars_exemplarspb_rpc_proto_goTypes, + DependencyIndexes: file_exemplars_exemplarspb_rpc_proto_depIdxs, + MessageInfos: file_exemplars_exemplarspb_rpc_proto_msgTypes, + }.Build() + File_exemplars_exemplarspb_rpc_proto = out.File + file_exemplars_exemplarspb_rpc_proto_rawDesc = nil + file_exemplars_exemplarspb_rpc_proto_goTypes = nil + file_exemplars_exemplarspb_rpc_proto_depIdxs = nil +} diff --git a/pkg/exemplars/exemplarspb/rpc.proto b/pkg/exemplars/exemplarspb/rpc.proto index 50dc94fa09f..d29aef7b97d 100644 --- a/pkg/exemplars/exemplarspb/rpc.proto +++ b/pkg/exemplars/exemplarspb/rpc.proto @@ -6,20 +6,9 @@ package thanos; import "store/storepb/types.proto"; import "store/labelpb/types.proto"; -import "gogoproto/gogo.proto"; +import "tagger/tagger.proto"; -option go_package = "exemplarspb"; - -option (gogoproto.sizer_all) = true; -option (gogoproto.marshaler_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; +option go_package = "github.com/thanos-io/thanos/pkg/exemplars/exemplarspb"; /// Exemplars represents API that is responsible for gathering exemplars and their states. service Exemplars { @@ -43,12 +32,12 @@ message ExemplarsResponse { } message ExemplarData { - ZLabelSet seriesLabels = 1 [(gogoproto.jsontag) = "seriesLabels", (gogoproto.nullable) = false]; - repeated Exemplar exemplars = 2 [(gogoproto.jsontag) = "exemplars"]; + LabelSet seriesLabels = 1 [(tagger.tags) = "json:\"seriesLabels\""]; + repeated Exemplar exemplars = 2 [(tagger.tags) = "json:\"exemplars\""]; } message Exemplar { - ZLabelSet labels = 1 [(gogoproto.jsontag) = "labels", (gogoproto.nullable) = false]; - double value = 2 [(gogoproto.jsontag) = "value"]; - int64 ts = 3 [(gogoproto.jsontag) = "timestamp"]; + LabelSet labels = 1 [(tagger.tags) = "json:\"labels\""]; + double value = 2 [(tagger.tags) = "json:\"value\""]; + int64 ts = 3 [(tagger.tags) = "json:\"timestamp\""]; } diff --git a/pkg/exemplars/exemplarspb/rpc_grpc.pb.go b/pkg/exemplars/exemplarspb/rpc_grpc.pb.go new file mode 100644 index 00000000000..7b400806188 --- /dev/null +++ b/pkg/exemplars/exemplarspb/rpc_grpc.pb.go @@ -0,0 +1,136 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v3.20.1 +// source: exemplars/exemplarspb/rpc.proto + +package exemplarspb + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Exemplars_Exemplars_FullMethodName = "/thanos.Exemplars/Exemplars" +) + +// ExemplarsClient is the client API for Exemplars service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// / Exemplars represents API that is responsible for gathering exemplars and their states. +type ExemplarsClient interface { + // / Exemplars has info for all exemplars. + // / Returned exemplars are expected to include external labels. + Exemplars(ctx context.Context, in *ExemplarsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ExemplarsResponse], error) +} + +type exemplarsClient struct { + cc grpc.ClientConnInterface +} + +func NewExemplarsClient(cc grpc.ClientConnInterface) ExemplarsClient { + return &exemplarsClient{cc} +} + +func (c *exemplarsClient) Exemplars(ctx context.Context, in *ExemplarsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ExemplarsResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &Exemplars_ServiceDesc.Streams[0], Exemplars_Exemplars_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[ExemplarsRequest, ExemplarsResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Exemplars_ExemplarsClient = grpc.ServerStreamingClient[ExemplarsResponse] + +// ExemplarsServer is the server API for Exemplars service. +// All implementations must embed UnimplementedExemplarsServer +// for forward compatibility. +// +// / Exemplars represents API that is responsible for gathering exemplars and their states. +type ExemplarsServer interface { + // / Exemplars has info for all exemplars. + // / Returned exemplars are expected to include external labels. + Exemplars(*ExemplarsRequest, grpc.ServerStreamingServer[ExemplarsResponse]) error + mustEmbedUnimplementedExemplarsServer() +} + +// UnimplementedExemplarsServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedExemplarsServer struct{} + +func (UnimplementedExemplarsServer) Exemplars(*ExemplarsRequest, grpc.ServerStreamingServer[ExemplarsResponse]) error { + return status.Errorf(codes.Unimplemented, "method Exemplars not implemented") +} +func (UnimplementedExemplarsServer) mustEmbedUnimplementedExemplarsServer() {} +func (UnimplementedExemplarsServer) testEmbeddedByValue() {} + +// UnsafeExemplarsServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ExemplarsServer will +// result in compilation errors. +type UnsafeExemplarsServer interface { + mustEmbedUnimplementedExemplarsServer() +} + +func RegisterExemplarsServer(s grpc.ServiceRegistrar, srv ExemplarsServer) { + // If the following call pancis, it indicates UnimplementedExemplarsServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Exemplars_ServiceDesc, srv) +} + +func _Exemplars_Exemplars_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ExemplarsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ExemplarsServer).Exemplars(m, &grpc.GenericServerStream[ExemplarsRequest, ExemplarsResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Exemplars_ExemplarsServer = grpc.ServerStreamingServer[ExemplarsResponse] + +// Exemplars_ServiceDesc is the grpc.ServiceDesc for Exemplars service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Exemplars_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "thanos.Exemplars", + HandlerType: (*ExemplarsServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Exemplars", + Handler: _Exemplars_Exemplars_Handler, + ServerStreams: true, + }, + }, + Metadata: "exemplars/exemplarspb/rpc.proto", +} diff --git a/pkg/exemplars/exemplarspb/rpc_vtproto.pb.go b/pkg/exemplars/exemplarspb/rpc_vtproto.pb.go new file mode 100644 index 00000000000..d536e019d9c --- /dev/null +++ b/pkg/exemplars/exemplarspb/rpc_vtproto.pb.go @@ -0,0 +1,1092 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.1-0.20250313105119-ba97887b0a25 +// source: exemplars/exemplarspb/rpc.proto + +package exemplarspb + +import ( + binary "encoding/binary" + fmt "fmt" + io "io" + math "math" + + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" + storepb "github.com/thanos-io/thanos/pkg/store/storepb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *ExemplarsRequest) CloneVT() *ExemplarsRequest { + if m == nil { + return (*ExemplarsRequest)(nil) + } + r := new(ExemplarsRequest) + r.Query = m.Query + r.Start = m.Start + r.End = m.End + r.PartialResponseStrategy = m.PartialResponseStrategy + return r +} + +func (m *ExemplarsRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ExemplarsResponse) CloneVT() *ExemplarsResponse { + if m == nil { + return (*ExemplarsResponse)(nil) + } + r := new(ExemplarsResponse) + if m.Result != nil { + r.Result = m.Result.(interface { + CloneVT() isExemplarsResponse_Result + }).CloneVT() + } + return r +} + +func (m *ExemplarsResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ExemplarsResponse_Data) CloneVT() isExemplarsResponse_Result { + if m == nil { + return (*ExemplarsResponse_Data)(nil) + } + r := new(ExemplarsResponse_Data) + r.Data = m.Data.CloneVT() + return r +} + +func (m *ExemplarsResponse_Warning) CloneVT() isExemplarsResponse_Result { + if m == nil { + return (*ExemplarsResponse_Warning)(nil) + } + r := new(ExemplarsResponse_Warning) + r.Warning = m.Warning + return r +} + +func (m *ExemplarData) CloneVT() *ExemplarData { + if m == nil { + return (*ExemplarData)(nil) + } + r := new(ExemplarData) + r.SeriesLabels = m.SeriesLabels.CloneVT() + if rhs := m.Exemplars; rhs != nil { + tmpContainer := make([]*Exemplar, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Exemplars = tmpContainer + } + return r +} + +func (m *ExemplarData) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Exemplar) CloneVT() *Exemplar { + if m == nil { + return (*Exemplar)(nil) + } + r := new(Exemplar) + r.Labels = m.Labels.CloneVT() + r.Value = m.Value + r.Ts = m.Ts + return r +} + +func (m *Exemplar) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *ExemplarsRequest) EqualVT(that *ExemplarsRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Query != that.Query { + return false + } + if this.Start != that.Start { + return false + } + if this.End != that.End { + return false + } + if this.PartialResponseStrategy != that.PartialResponseStrategy { + return false + } + return true +} + +func (this *ExemplarsRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ExemplarsRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ExemplarsResponse) EqualVT(that *ExemplarsResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Result == nil && that.Result != nil { + return false + } else if this.Result != nil { + if that.Result == nil { + return false + } + if !this.Result.(interface { + EqualVT(isExemplarsResponse_Result) bool + }).EqualVT(that.Result) { + return false + } + } + return true +} + +func (this *ExemplarsResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ExemplarsResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ExemplarsResponse_Data) EqualVT(thatIface isExemplarsResponse_Result) bool { + that, ok := thatIface.(*ExemplarsResponse_Data) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Data, that.Data; p != q { + if p == nil { + p = &ExemplarData{} + } + if q == nil { + q = &ExemplarData{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *ExemplarsResponse_Warning) EqualVT(thatIface isExemplarsResponse_Result) bool { + that, ok := thatIface.(*ExemplarsResponse_Warning) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.Warning != that.Warning { + return false + } + return true +} + +func (this *ExemplarData) EqualVT(that *ExemplarData) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !this.SeriesLabels.EqualVT(that.SeriesLabels) { + return false + } + if len(this.Exemplars) != len(that.Exemplars) { + return false + } + for i, vx := range this.Exemplars { + vy := that.Exemplars[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Exemplar{} + } + if q == nil { + q = &Exemplar{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *ExemplarData) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ExemplarData) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Exemplar) EqualVT(that *Exemplar) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !this.Labels.EqualVT(that.Labels) { + return false + } + if this.Value != that.Value { + return false + } + if this.Ts != that.Ts { + return false + } + return true +} + +func (this *Exemplar) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Exemplar) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *ExemplarsRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExemplarsRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ExemplarsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.PartialResponseStrategy != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PartialResponseStrategy)) + i-- + dAtA[i] = 0x20 + } + if m.End != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.End)) + i-- + dAtA[i] = 0x18 + } + if m.Start != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) + i-- + dAtA[i] = 0x10 + } + if len(m.Query) > 0 { + i -= len(m.Query) + copy(dAtA[i:], m.Query) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Query))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ExemplarsResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExemplarsResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ExemplarsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if vtmsg, ok := m.Result.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *ExemplarsResponse_Data) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ExemplarsResponse_Data) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Data != nil { + size, err := m.Data.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *ExemplarsResponse_Warning) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ExemplarsResponse_Warning) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Warning) + copy(dAtA[i:], m.Warning) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Warning))) + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil +} +func (m *ExemplarData) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExemplarData) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ExemplarData) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Exemplars) > 0 { + for iNdEx := len(m.Exemplars) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Exemplars[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if m.SeriesLabels != nil { + size, err := m.SeriesLabels.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Exemplar) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Exemplar) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Exemplar) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.Ts != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Ts)) + i-- + dAtA[i] = 0x18 + } + if m.Value != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) + i-- + dAtA[i] = 0x11 + } + if m.Labels != nil { + size, err := m.Labels.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ExemplarsRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Query) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Start != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) + } + if m.End != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.End)) + } + if m.PartialResponseStrategy != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PartialResponseStrategy)) + } + return n +} + +func (m *ExemplarsResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Result.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + return n +} + +func (m *ExemplarsResponse_Data) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Data != nil { + l = m.Data.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ExemplarsResponse_Warning) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Warning) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return n +} +func (m *ExemplarData) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SeriesLabels != nil { + l = m.SeriesLabels.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Exemplars) > 0 { + for _, e := range m.Exemplars { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *Exemplar) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Labels != nil { + l = m.Labels.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Value != 0 { + n += 9 + } + if m.Ts != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Ts)) + } + return n +} + +func (m *ExemplarsRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExemplarsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExemplarsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Query = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) + } + m.Start = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Start |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) + } + m.End = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.End |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) + } + m.PartialResponseStrategy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PartialResponseStrategy |= storepb.PartialResponseStrategy(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExemplarsResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExemplarsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExemplarsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Result.(*ExemplarsResponse_Data); ok { + if err := oneof.Data.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &ExemplarData{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Result = &ExemplarsResponse_Data{Data: v} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Warning", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Result = &ExemplarsResponse_Warning{Warning: string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExemplarData) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExemplarData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExemplarData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SeriesLabels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SeriesLabels == nil { + m.SeriesLabels = &labelpb.LabelSet{} + } + if err := m.SeriesLabels.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Exemplars", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Exemplars = append(m.Exemplars, &Exemplar{}) + if err := m.Exemplars[len(m.Exemplars)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Exemplar) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Exemplar: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Exemplar: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = &labelpb.LabelSet{} + } + if err := m.Labels.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Value = float64(math.Float64frombits(v)) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ts", wireType) + } + m.Ts = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Ts |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pkg/exemplars/multitsdb.go b/pkg/exemplars/multitsdb.go index 985f0b6bfed..6080031d168 100644 --- a/pkg/exemplars/multitsdb.go +++ b/pkg/exemplars/multitsdb.go @@ -15,6 +15,8 @@ import ( // MultiTSDB implements exemplarspb.ExemplarsServer that allows to fetch exemplars a MultiTSDB instance. type MultiTSDB struct { + exemplarspb.UnimplementedExemplarsServer + tsdbExemplarsServers func() map[string]*TSDB } diff --git a/pkg/exemplars/prometheus.go b/pkg/exemplars/prometheus.go index 35f045b6240..f0fcc5877eb 100644 --- a/pkg/exemplars/prometheus.go +++ b/pkg/exemplars/prometheus.go @@ -7,8 +7,6 @@ import ( "context" "net/url" - "github.com/prometheus/prometheus/model/labels" - "github.com/thanos-io/thanos/pkg/exemplars/exemplarspb" "github.com/thanos-io/thanos/pkg/promclient" "github.com/thanos-io/thanos/pkg/store/labelpb" @@ -17,14 +15,16 @@ import ( // Prometheus implements exemplarspb.Exemplars gRPC that allows to fetch exemplars from Prometheus. type Prometheus struct { + exemplarspb.UnimplementedExemplarsServer + base *url.URL client *promclient.Client - extLabels func() labels.Labels + extLabels func() labelpb.Labels } // NewPrometheus creates new exemplars.Prometheus. -func NewPrometheus(base *url.URL, client *promclient.Client, extLabels func() labels.Labels) *Prometheus { +func NewPrometheus(base *url.URL, client *promclient.Client, extLabels func() labelpb.Labels) *Prometheus { return &Prometheus{ base: base, client: client, @@ -40,10 +40,9 @@ func (p *Prometheus) Exemplars(r *exemplarspb.ExemplarsRequest, s exemplarspb.Ex } // Prometheus does not add external labels, so we need to add on our own. - extLset := p.extLabels() + ext := p.extLabels() for _, e := range exemplars { - // Make sure the returned series labels are sorted. - e.SetSeriesLabels(labelpb.ExtendSortedLabels(e.SeriesLabels.PromLabels(), extLset)) + e.SeriesLabels = &labelpb.LabelSet{Labels: labelpb.ExtendSortedLabels(e.SeriesLabels.GetLabels(), ext)} var err error tracing.DoInSpan(s.Context(), "send_exemplars_response", func(_ context.Context) { diff --git a/pkg/exemplars/proxy.go b/pkg/exemplars/proxy.go index c7d8fb911ca..ff5d2339226 100644 --- a/pkg/exemplars/proxy.go +++ b/pkg/exemplars/proxy.go @@ -21,6 +21,7 @@ import ( "github.com/thanos-io/thanos/pkg/exemplars/exemplarspb" "github.com/thanos-io/thanos/pkg/extpromql" "github.com/thanos-io/thanos/pkg/store" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" "github.com/thanos-io/thanos/pkg/tracing" ) @@ -28,9 +29,11 @@ import ( // Proxy implements exemplarspb.Exemplars gRPC that fanouts requests to // given exemplarspb.Exemplars. type Proxy struct { + exemplarspb.UnimplementedExemplarsServer + logger log.Logger exemplars func() []*exemplarspb.ExemplarStore - selectorLabels labels.Labels + selectorLabels labelpb.Labels } // RegisterExemplarsServer register exemplars server. @@ -41,7 +44,7 @@ func RegisterExemplarsServer(exemplarsSrv exemplarspb.ExemplarsServer) func(*grp } // NewProxy return new exemplars.Proxy. -func NewProxy(logger log.Logger, exemplars func() []*exemplarspb.ExemplarStore, selectorLabels labels.Labels) *Proxy { +func NewProxy(logger log.Logger, exemplars func() []*exemplarspb.ExemplarStore, selectorLabels labelpb.Labels) *Proxy { return &Proxy{ logger: logger, exemplars: exemplars, @@ -159,7 +162,7 @@ func (s *Proxy) Exemplars(req *exemplarspb.ExemplarsRequest, srv exemplarspb.Exe return nil } -func containsLabelName(name string, sets []labels.Labels) bool { +func containsLabelName(name string, sets []labelpb.Labels) bool { for _, ls := range sets { if ls.Get(name) != "" { return true @@ -221,7 +224,7 @@ func (stream *exemplarsStream) receive(ctx context.Context) error { // matchesExternalLabels returns false if given matchers are not matching external labels. // If true, matchesExternalLabels also returns Prometheus matchers without those matching external labels. -func matchesExternalLabels(ms []*labels.Matcher, externalLabels labels.Labels) (bool, []*labels.Matcher) { +func matchesExternalLabels(ms []*labels.Matcher, externalLabels labelpb.Labels) (bool, []*labels.Matcher) { if externalLabels.IsEmpty() { return true, ms } diff --git a/pkg/exemplars/proxy_test.go b/pkg/exemplars/proxy_test.go index 0e0ca58f8e0..660d55027fc 100644 --- a/pkg/exemplars/proxy_test.go +++ b/pkg/exemplars/proxy_test.go @@ -15,7 +15,6 @@ import ( "github.com/efficientgo/core/testutil" "github.com/go-kit/log" "github.com/pkg/errors" - "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/promql/parser" "go.uber.org/atomic" "google.golang.org/grpc" @@ -116,7 +115,7 @@ func TestProxy(t *testing.T) { request *exemplarspb.ExemplarsRequest clients []*exemplarspb.ExemplarStore server *testExemplarServer - selectorLabels labels.Labels + selectorLabels labelpb.Labels wantResponses []*exemplarspb.ExemplarsResponse wantError error }{ @@ -130,20 +129,20 @@ func TestProxy(t *testing.T) { { ExemplarsClient: &testExemplarClient{ response: exemplarspb.NewExemplarsResponse(&exemplarspb.ExemplarData{ - SeriesLabels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(labels.FromMap(map[string]string{"__name__": "http_request_duration_bucket"}))}, + SeriesLabels: labelpb.LabelSetFromStrings("__name__", "http_request_duration_bucket"), Exemplars: []*exemplarspb.Exemplar{{Value: 1}}, }), }, - LabelSets: []labels.Labels{ - labels.FromMap(map[string]string{"cluster": "A"}), - labels.FromMap(map[string]string{"cluster": "B"}), + LabelSets: []labelpb.Labels{ + labelpb.FromStrings("cluster", "A"), + labelpb.FromStrings("cluster", "B"), }, }, }, server: &testExemplarServer{}, wantResponses: []*exemplarspb.ExemplarsResponse{ exemplarspb.NewExemplarsResponse(&exemplarspb.ExemplarData{ - SeriesLabels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(labels.FromMap(map[string]string{"__name__": "http_request_duration_bucket"}))}, + SeriesLabels: labelpb.LabelSetFromStrings("__name__", "http_request_duration_bucket"), Exemplars: []*exemplarspb.Exemplar{{Value: 1}}, }), }, @@ -158,20 +157,20 @@ func TestProxy(t *testing.T) { { ExemplarsClient: &testExemplarClient{ response: exemplarspb.NewExemplarsResponse(&exemplarspb.ExemplarData{ - SeriesLabels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(labels.FromMap(map[string]string{"__name__": "http_request_duration_bucket"}))}, + SeriesLabels: labelpb.LabelSetFromStrings("__name__", "http_request_duration_bucket"), Exemplars: []*exemplarspb.Exemplar{{Value: 1}}, }), }, - LabelSets: []labels.Labels{ - labels.FromMap(map[string]string{"cluster": "A"}), - labels.FromMap(map[string]string{"cluster": "B"}), + LabelSets: []labelpb.Labels{ + labelpb.FromStrings("cluster", "A"), + labelpb.FromStrings("cluster", "B"), }, }, }, server: &testExemplarServer{}, wantResponses: []*exemplarspb.ExemplarsResponse{ exemplarspb.NewExemplarsResponse(&exemplarspb.ExemplarData{ - SeriesLabels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(labels.FromMap(map[string]string{"__name__": "http_request_duration_bucket"}))}, + SeriesLabels: labelpb.LabelSetFromStrings("__name__", "http_request_duration_bucket"), Exemplars: []*exemplarspb.Exemplar{{Value: 1}}, }), }, @@ -187,7 +186,7 @@ func TestProxy(t *testing.T) { ExemplarsClient: &testExemplarClient{ response: exemplarspb.NewWarningExemplarsResponse(errors.New("warning from client")), }, - LabelSets: []labels.Labels{labels.FromMap(map[string]string{"cluster": "A"})}, + LabelSets: []labelpb.Labels{labelpb.FromStrings("cluster", "A")}, }, }, server: &testExemplarServer{}, @@ -206,14 +205,14 @@ func TestProxy(t *testing.T) { { ExemplarsClient: &testExemplarClient{ response: exemplarspb.NewExemplarsResponse(&exemplarspb.ExemplarData{ - SeriesLabels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(labels.FromMap(map[string]string{"__name__": "http_request_duration_bucket"}))}, + SeriesLabels: labelpb.LabelSetFromStrings("__name__", "http_request_duration_bucket"), Exemplars: []*exemplarspb.Exemplar{{Value: 1}}, }), }, - LabelSets: []labels.Labels{labels.FromMap(map[string]string{"cluster": "A"})}, + LabelSets: []labelpb.Labels{labelpb.FromStrings("cluster", "A")}, }, }, - selectorLabels: labels.FromMap(map[string]string{"query": "bar"}), + selectorLabels: labelpb.FromStrings("query", "bar"), server: &testExemplarServer{}, wantResponses: nil, }, @@ -228,18 +227,18 @@ func TestProxy(t *testing.T) { { ExemplarsClient: &testExemplarClient{ response: exemplarspb.NewExemplarsResponse(&exemplarspb.ExemplarData{ - SeriesLabels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(labels.FromMap(map[string]string{"__name__": "http_request_duration_bucket"}))}, + SeriesLabels: labelpb.LabelSetFromStrings("__name__", "http_request_duration_bucket"), Exemplars: []*exemplarspb.Exemplar{{Value: 1}}, }), }, - LabelSets: []labels.Labels{labels.FromMap(map[string]string{"cluster": "A"})}, + LabelSets: []labelpb.Labels{labelpb.FromStrings("cluster", "A")}, }, }, - selectorLabels: labels.FromMap(map[string]string{"query": "foo"}), + selectorLabels: labelpb.FromStrings("query", "foo"), server: &testExemplarServer{}, wantResponses: []*exemplarspb.ExemplarsResponse{ exemplarspb.NewExemplarsResponse(&exemplarspb.ExemplarData{ - SeriesLabels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(labels.FromMap(map[string]string{"__name__": "http_request_duration_bucket"}))}, + SeriesLabels: labelpb.LabelSetFromStrings("__name__", "http_request_duration_bucket"), Exemplars: []*exemplarspb.Exemplar{{Value: 1}}, }), }, @@ -254,17 +253,17 @@ func TestProxy(t *testing.T) { { ExemplarsClient: &testExemplarClient{ response: exemplarspb.NewExemplarsResponse(&exemplarspb.ExemplarData{ - SeriesLabels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(labels.FromMap(map[string]string{"__name__": "http_request_duration_bucket"}))}, + SeriesLabels: labelpb.LabelSetFromStrings("__name__", "http_request_duration_bucket"), Exemplars: []*exemplarspb.Exemplar{{Value: 1}}, }), }, - LabelSets: []labels.Labels{labels.FromMap(map[string]string{"cluster": "non-matching"}), labels.FromMap(map[string]string{"cluster": "A"})}, + LabelSets: []labelpb.Labels{labelpb.FromStrings("cluster", "non-matching"), labelpb.FromStrings("cluster", "A")}, }, }, server: &testExemplarServer{}, wantResponses: []*exemplarspb.ExemplarsResponse{ exemplarspb.NewExemplarsResponse(&exemplarspb.ExemplarData{ - SeriesLabels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(labels.FromMap(map[string]string{"__name__": "http_request_duration_bucket"}))}, + SeriesLabels: labelpb.LabelSetFromStrings("__name__", "http_request_duration_bucket"), Exemplars: []*exemplarspb.Exemplar{{Value: 1}}, }), }, @@ -279,26 +278,26 @@ func TestProxy(t *testing.T) { { ExemplarsClient: &testExemplarClient{ response: exemplarspb.NewExemplarsResponse(&exemplarspb.ExemplarData{ - SeriesLabels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(labels.FromMap(map[string]string{"foo": "bar"}))}, + SeriesLabels: labelpb.LabelSetFromStrings("foo", "bar"), Exemplars: []*exemplarspb.Exemplar{{Value: 1}}, }), }, - LabelSets: []labels.Labels{labels.FromMap(map[string]string{"cluster": "A"})}, + LabelSets: []labelpb.Labels{labelpb.FromStrings("cluster", "A")}, }, { ExemplarsClient: &testExemplarClient{ response: exemplarspb.NewExemplarsResponse(&exemplarspb.ExemplarData{ - SeriesLabels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(labels.FromMap(map[string]string{"foo": "baz"}))}, + SeriesLabels: labelpb.LabelSetFromStrings("foo", "baz"), Exemplars: []*exemplarspb.Exemplar{{Value: 2}}, }), }, - LabelSets: []labels.Labels{labels.FromMap(map[string]string{"cluster": "B"})}, + LabelSets: []labelpb.Labels{labelpb.FromStrings("cluster", "B")}, }, }, server: &testExemplarServer{}, wantResponses: []*exemplarspb.ExemplarsResponse{ exemplarspb.NewExemplarsResponse(&exemplarspb.ExemplarData{ - SeriesLabels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(labels.FromMap(map[string]string{"foo": "bar"}))}, + SeriesLabels: labelpb.LabelSetFromStrings("foo", "bar"), Exemplars: []*exemplarspb.Exemplar{{Value: 1}}, }), }, @@ -313,30 +312,30 @@ func TestProxy(t *testing.T) { { ExemplarsClient: &testExemplarClient{ response: exemplarspb.NewExemplarsResponse(&exemplarspb.ExemplarData{ - SeriesLabels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(labels.FromMap(map[string]string{"foo": "bar"}))}, + SeriesLabels: labelpb.LabelSetFromStrings("foo", "bar"), Exemplars: []*exemplarspb.Exemplar{{Value: 1}}, }), }, - LabelSets: []labels.Labels{labels.FromMap(map[string]string{"cluster": "A"})}, + LabelSets: []labelpb.Labels{labelpb.FromStrings("cluster", "A")}, }, { ExemplarsClient: &testExemplarClient{ response: exemplarspb.NewExemplarsResponse(&exemplarspb.ExemplarData{ - SeriesLabels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(labels.FromMap(map[string]string{"foo": "baz"}))}, + SeriesLabels: labelpb.LabelSetFromStrings("foo", "baz"), Exemplars: []*exemplarspb.Exemplar{{Value: 2}}, }), }, - LabelSets: []labels.Labels{labels.FromMap(map[string]string{"cluster": "B"})}, + LabelSets: []labelpb.Labels{labelpb.FromStrings("cluster", "B")}, }, }, server: &testExemplarServer{}, wantResponses: []*exemplarspb.ExemplarsResponse{ exemplarspb.NewExemplarsResponse(&exemplarspb.ExemplarData{ - SeriesLabels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(labels.FromMap(map[string]string{"foo": "bar"}))}, + SeriesLabels: labelpb.LabelSetFromStrings("foo", "bar"), Exemplars: []*exemplarspb.Exemplar{{Value: 1}}, }), exemplarspb.NewExemplarsResponse(&exemplarspb.ExemplarData{ - SeriesLabels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(labels.FromMap(map[string]string{"foo": "baz"}))}, + SeriesLabels: labelpb.LabelSetFromStrings("foo", "baz"), Exemplars: []*exemplarspb.Exemplar{{Value: 2}}, }), }, @@ -387,7 +386,7 @@ func TestProxyDataRace(t *testing.T) { ExemplarsClient: &testExemplarClient{ recvErr: errors.New("err"), }, - LabelSets: []labels.Labels{labels.FromMap(map[string]string{"cluster": "A"})}, + LabelSets: []labelpb.Labels{labelpb.FromStrings("cluster", "A")}, } size := 100 endpoints := make([]*exemplarspb.ExemplarStore, 0, size) @@ -395,7 +394,7 @@ func TestProxyDataRace(t *testing.T) { endpoints = append(endpoints, es) } return endpoints - }, labels.FromMap(map[string]string{"query": "foo"})) + }, labelpb.FromStrings("query", "foo")) req := &exemplarspb.ExemplarsRequest{ Query: `http_request_duration_bucket{query="foo"}`, PartialResponseStrategy: storepb.PartialResponseStrategy_WARN, diff --git a/pkg/exemplars/tsdb.go b/pkg/exemplars/tsdb.go index be824dd8f88..ec34b760403 100644 --- a/pkg/exemplars/tsdb.go +++ b/pkg/exemplars/tsdb.go @@ -20,26 +20,26 @@ import ( type TSDB struct { db storage.ExemplarQueryable - extLabels labels.Labels + extLabels labelpb.Labels mtx sync.RWMutex } // NewTSDB creates new exemplars.TSDB. -func NewTSDB(db storage.ExemplarQueryable, extLabels labels.Labels) *TSDB { +func NewTSDB(db storage.ExemplarQueryable, extLabels labelpb.Labels) *TSDB { return &TSDB{ db: db, extLabels: extLabels, } } -func (t *TSDB) SetExtLabels(extLabels labels.Labels) { +func (t *TSDB) SetExtLabels(extLabels labelpb.Labels) { t.mtx.Lock() defer t.mtx.Unlock() t.extLabels = extLabels } -func (t *TSDB) getExtLabels() labels.Labels { +func (t *TSDB) getExtLabels() labelpb.Labels { t.mtx.RLock() defer t.mtx.RUnlock() @@ -70,8 +70,8 @@ func (t *TSDB) Exemplars(matchers [][]*labels.Matcher, start, end int64, s exemp for _, e := range exemplars { exd := exemplarspb.ExemplarData{ - SeriesLabels: labelpb.ZLabelSet{ - Labels: labelpb.ZLabelsFromPromLabels(labelpb.ExtendSortedLabels(e.SeriesLabels, t.getExtLabels())), + SeriesLabels: &labelpb.LabelSet{ + Labels: labelpb.ExtendSortedLabels(labelpb.FromPromLabels(e.SeriesLabels), t.getExtLabels()), }, Exemplars: exemplarspb.ExemplarsFromPromExemplars(e.Exemplars), } @@ -84,7 +84,7 @@ func (t *TSDB) Exemplars(matchers [][]*labels.Matcher, start, end int64, s exemp // selectorsMatchesExternalLabels returns false if none of the selectors matches the external labels. // If true, it also returns an array of non-empty Prometheus matchers. -func selectorsMatchesExternalLabels(selectors [][]*labels.Matcher, externalLabels labels.Labels) (bool, [][]*labels.Matcher) { +func selectorsMatchesExternalLabels(selectors [][]*labels.Matcher, externalLabels labelpb.Labels) (bool, [][]*labels.Matcher) { matchedOnce := false var newSelectors [][]*labels.Matcher diff --git a/pkg/exemplars/tsdb_test.go b/pkg/exemplars/tsdb_test.go index ff945f6f26a..6f8028093aa 100644 --- a/pkg/exemplars/tsdb_test.go +++ b/pkg/exemplars/tsdb_test.go @@ -9,6 +9,7 @@ import ( "github.com/prometheus/prometheus/model/labels" "github.com/efficientgo/core/testutil" + "github.com/thanos-io/thanos/pkg/store/labelpb" ) func TestSelectorsMatchExternalLabels(t *testing.T) { @@ -16,7 +17,7 @@ func TestSelectorsMatchExternalLabels(t *testing.T) { tests := map[string]struct { selectors [][]*labels.Matcher - extLabels labels.Labels + extLabels labelpb.Labels shouldMatch bool expectedSelectors [][]*labels.Matcher }{ @@ -27,7 +28,7 @@ func TestSelectorsMatchExternalLabels(t *testing.T) { labels.MustNewMatcher(labels.MatchEqual, "receive", "true"), }, }, - extLabels: labels.FromStrings("receive", "true"), + extLabels: labelpb.FromStrings("receive", "true"), shouldMatch: true, expectedSelectors: [][]*labels.Matcher{ { @@ -41,7 +42,7 @@ func TestSelectorsMatchExternalLabels(t *testing.T) { labels.MustNewMatcher(labels.MatchEqual, "code", "200"), }, }, - extLabels: labels.FromStrings("receive", "true"), + extLabels: labelpb.FromStrings("receive", "true"), shouldMatch: true, expectedSelectors: [][]*labels.Matcher{ { @@ -60,7 +61,7 @@ func TestSelectorsMatchExternalLabels(t *testing.T) { labels.MustNewMatcher(labels.MatchRegexp, "receive", "true"), }, }, - extLabels: labels.FromStrings("receive", "true", "replica", "0"), + extLabels: labelpb.FromStrings("receive", "true", "replica", "0"), shouldMatch: true, expectedSelectors: [][]*labels.Matcher{ { @@ -79,7 +80,7 @@ func TestSelectorsMatchExternalLabels(t *testing.T) { labels.MustNewMatcher(labels.MatchEqual, "replica", "0"), }, }, - extLabels: labels.FromStrings("replica", "1"), + extLabels: labelpb.FromStrings("replica", "1"), shouldMatch: false, expectedSelectors: nil, }, diff --git a/pkg/info/info.go b/pkg/info/info.go index 0b5feaa113d..71a75e1453c 100644 --- a/pkg/info/info.go +++ b/pkg/info/info.go @@ -20,7 +20,7 @@ type InfoServer struct { component string - getLabelSet func() []labelpb.ZLabelSet + getLabelSet func() []*labelpb.LabelSet getStoreInfo func() (*infopb.StoreInfo, error) getExemplarsInfo func() *infopb.ExemplarsInfo getRulesInfo func() *infopb.RulesInfo @@ -38,7 +38,7 @@ func NewInfoServer( srv := &InfoServer{ component: component, // By default, do not return info for any API. - getLabelSet: func() []labelpb.ZLabelSet { return nil }, + getLabelSet: func() []*labelpb.LabelSet { return nil }, getStoreInfo: func() (*infopb.StoreInfo, error) { return nil, nil }, getExemplarsInfo: func() *infopb.ExemplarsInfo { return nil }, getRulesInfo: func() *infopb.RulesInfo { return nil }, @@ -60,10 +60,10 @@ type ServerOptionFunc func(*InfoServer) // WithLabelSetFunc determines the function that should be executed to obtain // the label set information. If no function is provided, the default empty // label set is returned. Only the first function from the list is considered. -func WithLabelSetFunc(getLabelSet ...func() []labelpb.ZLabelSet) ServerOptionFunc { +func WithLabelSetFunc(getLabelSet ...func() []*labelpb.LabelSet) ServerOptionFunc { if len(getLabelSet) == 0 { return func(s *InfoServer) { - s.getLabelSet = func() []labelpb.ZLabelSet { return []labelpb.ZLabelSet{} } + s.getLabelSet = func() []*labelpb.LabelSet { return []*labelpb.LabelSet{} } } } diff --git a/pkg/info/infopb/custom.pb.go b/pkg/info/infopb/custom.pb.go index 8d50ee2c4b9..e854bfc6a96 100644 --- a/pkg/info/infopb/custom.pb.go +++ b/pkg/info/infopb/custom.pb.go @@ -3,14 +3,12 @@ package infopb import ( "math" - "github.com/prometheus/prometheus/model/labels" - "github.com/thanos-io/thanos/pkg/store/labelpb" ) -func NewTSDBInfo(mint, maxt int64, lbls []labelpb.ZLabel) TSDBInfo { - return TSDBInfo{ - Labels: labelpb.ZLabelSet{ +func NewTSDBInfo(mint, maxt int64, lbls labelpb.Labels) *TSDBInfo { + return &TSDBInfo{ + Labels: &labelpb.LabelSet{ Labels: lbls, }, MinTime: mint, @@ -18,7 +16,7 @@ func NewTSDBInfo(mint, maxt int64, lbls []labelpb.ZLabel) TSDBInfo { } } -type TSDBInfos []TSDBInfo +type TSDBInfos []*TSDBInfo func (infos TSDBInfos) MaxT() int64 { var maxt int64 = math.MinInt64 @@ -30,11 +28,10 @@ func (infos TSDBInfos) MaxT() int64 { return maxt } -func (infos TSDBInfos) LabelSets() []labels.Labels { - lsets := make([]labels.Labels, 0, len(infos)) - for _, info := range infos { - lsets = append(lsets, labelpb.ZLabelsToPromLabels(info.Labels.Labels)) - +func (infos TSDBInfos) LabelSets() []labelpb.Labels { + lsets := make([]labelpb.Labels, len(infos)) + for i, info := range infos { + lsets[i] = info.GetLabels().GetLabels() } return lsets } diff --git a/pkg/info/infopb/rpc.pb.go b/pkg/info/infopb/rpc.pb.go index c88be63cfc1..acb125bc46c 100644 --- a/pkg/info/infopb/rpc.pb.go +++ b/pkg/info/infopb/rpc.pb.go @@ -1,72 +1,73 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.20.1 // source: info/infopb/rpc.proto package infopb import ( - context "context" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + reflect "reflect" + sync "sync" + + _ "github.com/srikrsna/protoc-gen-gotag/tagger" labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type InfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *InfoRequest) Reset() { *m = InfoRequest{} } -func (m *InfoRequest) String() string { return proto.CompactTextString(m) } -func (*InfoRequest) ProtoMessage() {} -func (*InfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a1214ec45d2bf952, []int{0} -} -func (m *InfoRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InfoRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +func (x *InfoRequest) Reset() { + *x = InfoRequest{} + mi := &file_info_infopb_rpc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *InfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_InfoRequest.Merge(m, src) -} -func (m *InfoRequest) XXX_Size() int { - return m.Size() + +func (x *InfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *InfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_InfoRequest.DiscardUnknown(m) + +func (*InfoRequest) ProtoMessage() {} + +func (x *InfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_info_infopb_rpc_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_InfoRequest proto.InternalMessageInfo +// Deprecated: Use InfoRequest.ProtoReflect.Descriptor instead. +func (*InfoRequest) Descriptor() ([]byte, []int) { + return file_info_infopb_rpc_proto_rawDescGZIP(), []int{0} +} type InfoResponse struct { - LabelSets []labelpb.ZLabelSet `protobuf:"bytes,1,rep,name=label_sets,json=labelSets,proto3" json:"label_sets"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LabelSets []*labelpb.LabelSet `protobuf:"bytes,1,rep,name=label_sets,json=labelSets,proto3" json:"label_sets"` ComponentType string `protobuf:"bytes,2,opt,name=ComponentType,proto3" json:"ComponentType,omitempty"` // StoreInfo holds the metadata related to Store API if exposed by the component otherwise it will be null. Store *StoreInfo `protobuf:"bytes,3,opt,name=store,proto3" json:"store,omitempty"` @@ -82,2018 +83,581 @@ type InfoResponse struct { Query *QueryAPIInfo `protobuf:"bytes,8,opt,name=query,proto3" json:"query,omitempty"` } -func (m *InfoResponse) Reset() { *m = InfoResponse{} } -func (m *InfoResponse) String() string { return proto.CompactTextString(m) } -func (*InfoResponse) ProtoMessage() {} -func (*InfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a1214ec45d2bf952, []int{1} -} -func (m *InfoResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InfoResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *InfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_InfoResponse.Merge(m, src) -} -func (m *InfoResponse) XXX_Size() int { - return m.Size() +func (x *InfoResponse) Reset() { + *x = InfoResponse{} + mi := &file_info_infopb_rpc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *InfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_InfoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_InfoResponse proto.InternalMessageInfo -// StoreInfo holds the metadata related to Store API exposed by the component. -type StoreInfo struct { - MinTime int64 `protobuf:"varint,1,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` - MaxTime int64 `protobuf:"varint,2,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` - SupportsSharding bool `protobuf:"varint,3,opt,name=supports_sharding,json=supportsSharding,proto3" json:"supports_sharding,omitempty"` - // replica_aware means this store supports without_replica_labels of StoreAPI.Series. - SupportsWithoutReplicaLabels bool `protobuf:"varint,5,opt,name=supports_without_replica_labels,json=supportsWithoutReplicaLabels,proto3" json:"supports_without_replica_labels,omitempty"` - // TSDBInfos holds metadata for all TSDBs exposed by the store. - TsdbInfos []TSDBInfo `protobuf:"bytes,6,rep,name=tsdb_infos,json=tsdbInfos,proto3" json:"tsdb_infos"` +func (x *InfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *StoreInfo) Reset() { *m = StoreInfo{} } -func (m *StoreInfo) String() string { return proto.CompactTextString(m) } -func (*StoreInfo) ProtoMessage() {} -func (*StoreInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_a1214ec45d2bf952, []int{2} -} -func (m *StoreInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StoreInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StoreInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (*InfoResponse) ProtoMessage() {} + +func (x *InfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_info_infopb_rpc_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *StoreInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_StoreInfo.Merge(m, src) -} -func (m *StoreInfo) XXX_Size() int { - return m.Size() -} -func (m *StoreInfo) XXX_DiscardUnknown() { - xxx_messageInfo_StoreInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_StoreInfo proto.InternalMessageInfo -// RulesInfo holds the metadata related to Rules API exposed by the component. -type RulesInfo struct { +// Deprecated: Use InfoResponse.ProtoReflect.Descriptor instead. +func (*InfoResponse) Descriptor() ([]byte, []int) { + return file_info_infopb_rpc_proto_rawDescGZIP(), []int{1} } -func (m *RulesInfo) Reset() { *m = RulesInfo{} } -func (m *RulesInfo) String() string { return proto.CompactTextString(m) } -func (*RulesInfo) ProtoMessage() {} -func (*RulesInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_a1214ec45d2bf952, []int{3} -} -func (m *RulesInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RulesInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RulesInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *InfoResponse) GetLabelSets() []*labelpb.LabelSet { + if x != nil { + return x.LabelSets } + return nil } -func (m *RulesInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_RulesInfo.Merge(m, src) -} -func (m *RulesInfo) XXX_Size() int { - return m.Size() -} -func (m *RulesInfo) XXX_DiscardUnknown() { - xxx_messageInfo_RulesInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_RulesInfo proto.InternalMessageInfo -// MetricMetadataInfo holds the metadata related to Metadata API exposed by the component. -type MetricMetadataInfo struct { +func (x *InfoResponse) GetComponentType() string { + if x != nil { + return x.ComponentType + } + return "" } -func (m *MetricMetadataInfo) Reset() { *m = MetricMetadataInfo{} } -func (m *MetricMetadataInfo) String() string { return proto.CompactTextString(m) } -func (*MetricMetadataInfo) ProtoMessage() {} -func (*MetricMetadataInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_a1214ec45d2bf952, []int{4} -} -func (m *MetricMetadataInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MetricMetadataInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MetricMetadataInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *InfoResponse) GetStore() *StoreInfo { + if x != nil { + return x.Store } -} -func (m *MetricMetadataInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricMetadataInfo.Merge(m, src) -} -func (m *MetricMetadataInfo) XXX_Size() int { - return m.Size() -} -func (m *MetricMetadataInfo) XXX_DiscardUnknown() { - xxx_messageInfo_MetricMetadataInfo.DiscardUnknown(m) + return nil } -var xxx_messageInfo_MetricMetadataInfo proto.InternalMessageInfo - -// TargetsInfo holds the metadata related to Targets API exposed by the component. -type TargetsInfo struct { +func (x *InfoResponse) GetRules() *RulesInfo { + if x != nil { + return x.Rules + } + return nil } -func (m *TargetsInfo) Reset() { *m = TargetsInfo{} } -func (m *TargetsInfo) String() string { return proto.CompactTextString(m) } -func (*TargetsInfo) ProtoMessage() {} -func (*TargetsInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_a1214ec45d2bf952, []int{5} -} -func (m *TargetsInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TargetsInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TargetsInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *InfoResponse) GetMetricMetadata() *MetricMetadataInfo { + if x != nil { + return x.MetricMetadata } + return nil } -func (m *TargetsInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TargetsInfo.Merge(m, src) -} -func (m *TargetsInfo) XXX_Size() int { - return m.Size() -} -func (m *TargetsInfo) XXX_DiscardUnknown() { - xxx_messageInfo_TargetsInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_TargetsInfo proto.InternalMessageInfo -// ExemplarsInfo holds the metadata related to Exemplars API exposed by the component. -type ExemplarsInfo struct { - MinTime int64 `protobuf:"varint,1,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` - MaxTime int64 `protobuf:"varint,2,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` +func (x *InfoResponse) GetTargets() *TargetsInfo { + if x != nil { + return x.Targets + } + return nil } -func (m *ExemplarsInfo) Reset() { *m = ExemplarsInfo{} } -func (m *ExemplarsInfo) String() string { return proto.CompactTextString(m) } -func (*ExemplarsInfo) ProtoMessage() {} -func (*ExemplarsInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_a1214ec45d2bf952, []int{6} -} -func (m *ExemplarsInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ExemplarsInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ExemplarsInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *InfoResponse) GetExemplars() *ExemplarsInfo { + if x != nil { + return x.Exemplars } + return nil } -func (m *ExemplarsInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExemplarsInfo.Merge(m, src) -} -func (m *ExemplarsInfo) XXX_Size() int { - return m.Size() -} -func (m *ExemplarsInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ExemplarsInfo.DiscardUnknown(m) + +func (x *InfoResponse) GetQuery() *QueryAPIInfo { + if x != nil { + return x.Query + } + return nil } -var xxx_messageInfo_ExemplarsInfo proto.InternalMessageInfo +// StoreInfo holds the metadata related to Store API exposed by the component. +type StoreInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -// QueryInfo holds the metadata related to Query API exposed by the component. -type QueryAPIInfo struct { + MinTime int64 `protobuf:"varint,1,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` + MaxTime int64 `protobuf:"varint,2,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` + SupportsSharding bool `protobuf:"varint,3,opt,name=supports_sharding,json=supportsSharding,proto3" json:"supports_sharding,omitempty"` + // replica_aware means this store supports without_replica_labels of StoreAPI.Series. + SupportsWithoutReplicaLabels bool `protobuf:"varint,5,opt,name=supports_without_replica_labels,json=supportsWithoutReplicaLabels,proto3" json:"supports_without_replica_labels,omitempty"` + // TSDBInfos holds metadata for all TSDBs exposed by the store. + TsdbInfos []*TSDBInfo `protobuf:"bytes,6,rep,name=tsdb_infos,json=tsdbInfos,proto3" json:"tsdb_infos"` } -func (m *QueryAPIInfo) Reset() { *m = QueryAPIInfo{} } -func (m *QueryAPIInfo) String() string { return proto.CompactTextString(m) } -func (*QueryAPIInfo) ProtoMessage() {} -func (*QueryAPIInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_a1214ec45d2bf952, []int{7} -} -func (m *QueryAPIInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAPIInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAPIInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAPIInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAPIInfo.Merge(m, src) -} -func (m *QueryAPIInfo) XXX_Size() int { - return m.Size() +func (x *StoreInfo) Reset() { + *x = StoreInfo{} + mi := &file_info_infopb_rpc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *QueryAPIInfo) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAPIInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAPIInfo proto.InternalMessageInfo -type TSDBInfo struct { - Labels labelpb.ZLabelSet `protobuf:"bytes,1,opt,name=labels,proto3" json:"labels"` - MinTime int64 `protobuf:"varint,2,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` - MaxTime int64 `protobuf:"varint,3,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` +func (x *StoreInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TSDBInfo) Reset() { *m = TSDBInfo{} } -func (m *TSDBInfo) String() string { return proto.CompactTextString(m) } -func (*TSDBInfo) ProtoMessage() {} -func (*TSDBInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_a1214ec45d2bf952, []int{8} -} -func (m *TSDBInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TSDBInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TSDBInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (*StoreInfo) ProtoMessage() {} + +func (x *StoreInfo) ProtoReflect() protoreflect.Message { + mi := &file_info_infopb_rpc_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *TSDBInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TSDBInfo.Merge(m, src) -} -func (m *TSDBInfo) XXX_Size() int { - return m.Size() -} -func (m *TSDBInfo) XXX_DiscardUnknown() { - xxx_messageInfo_TSDBInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_TSDBInfo proto.InternalMessageInfo - -func init() { - proto.RegisterType((*InfoRequest)(nil), "thanos.info.InfoRequest") - proto.RegisterType((*InfoResponse)(nil), "thanos.info.InfoResponse") - proto.RegisterType((*StoreInfo)(nil), "thanos.info.StoreInfo") - proto.RegisterType((*RulesInfo)(nil), "thanos.info.RulesInfo") - proto.RegisterType((*MetricMetadataInfo)(nil), "thanos.info.MetricMetadataInfo") - proto.RegisterType((*TargetsInfo)(nil), "thanos.info.TargetsInfo") - proto.RegisterType((*ExemplarsInfo)(nil), "thanos.info.ExemplarsInfo") - proto.RegisterType((*QueryAPIInfo)(nil), "thanos.info.QueryAPIInfo") - proto.RegisterType((*TSDBInfo)(nil), "thanos.info.TSDBInfo") -} - -func init() { proto.RegisterFile("info/infopb/rpc.proto", fileDescriptor_a1214ec45d2bf952) } - -var fileDescriptor_a1214ec45d2bf952 = []byte{ - // 589 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xdf, 0x8a, 0xda, 0x40, - 0x14, 0xc6, 0x8d, 0x7f, 0xe3, 0x71, 0xdd, 0xee, 0x0e, 0xbb, 0x25, 0x4a, 0x89, 0x12, 0xf6, 0x42, - 0x68, 0x31, 0x60, 0xa1, 0x94, 0xf6, 0xaa, 0x6e, 0x85, 0x6e, 0xe9, 0x42, 0x1b, 0x85, 0xc2, 0xde, - 0x84, 0xa8, 0xb3, 0x1a, 0x48, 0x32, 0x63, 0x66, 0xa4, 0xfa, 0x16, 0x7d, 0x95, 0xbe, 0x85, 0x97, - 0x7b, 0xd9, 0xab, 0xd2, 0xea, 0x43, 0xf4, 0xb6, 0xcc, 0x4c, 0x62, 0x0d, 0xdd, 0xbd, 0xe9, 0x8d, - 0x66, 0xe6, 0xfb, 0x9d, 0xc9, 0x39, 0xdf, 0x39, 0x13, 0x38, 0xf7, 0xa3, 0x5b, 0x62, 0x8b, 0x1f, - 0x3a, 0xb6, 0x63, 0x3a, 0xe9, 0xd2, 0x98, 0x70, 0x82, 0x6a, 0x7c, 0xee, 0x45, 0x84, 0x75, 0x85, - 0xd0, 0x6c, 0x30, 0x4e, 0x62, 0x6c, 0x07, 0xde, 0x18, 0x07, 0x74, 0x6c, 0xf3, 0x35, 0xc5, 0x4c, - 0x71, 0xcd, 0xb3, 0x19, 0x99, 0x11, 0xf9, 0x68, 0x8b, 0x27, 0xb5, 0x6b, 0xd5, 0xa1, 0x76, 0x15, - 0xdd, 0x12, 0x07, 0x2f, 0x96, 0x98, 0x71, 0xeb, 0x5b, 0x01, 0x8e, 0xd4, 0x9a, 0x51, 0x12, 0x31, - 0x8c, 0x5e, 0x00, 0xc8, 0xc3, 0x5c, 0x86, 0x39, 0x33, 0xb4, 0x76, 0xa1, 0x53, 0xeb, 0x9d, 0x76, - 0x93, 0x57, 0xde, 0x7c, 0x10, 0xd2, 0x10, 0xf3, 0x7e, 0x71, 0xf3, 0xa3, 0x95, 0x73, 0xaa, 0x41, - 0xb2, 0x66, 0xe8, 0x02, 0xea, 0x97, 0x24, 0xa4, 0x24, 0xc2, 0x11, 0x1f, 0xad, 0x29, 0x36, 0xf2, - 0x6d, 0xad, 0x53, 0x75, 0xb2, 0x9b, 0xe8, 0x19, 0x94, 0x64, 0xc2, 0x46, 0xa1, 0xad, 0x75, 0x6a, - 0xbd, 0xc7, 0xdd, 0x83, 0x5a, 0xba, 0x43, 0xa1, 0xc8, 0x64, 0x14, 0x24, 0xe8, 0x78, 0x19, 0x60, - 0x66, 0x14, 0xef, 0xa1, 0x1d, 0xa1, 0x28, 0x5a, 0x42, 0xe8, 0x1d, 0x3c, 0x0a, 0x31, 0x8f, 0xfd, - 0x89, 0x1b, 0x62, 0xee, 0x4d, 0x3d, 0xee, 0x19, 0x25, 0x19, 0xd7, 0xca, 0xc4, 0x5d, 0x4b, 0xe6, - 0x3a, 0x41, 0xe4, 0x01, 0xc7, 0x61, 0x66, 0x0f, 0xf5, 0xa0, 0xc2, 0xbd, 0x78, 0x26, 0x0c, 0x28, - 0xcb, 0x13, 0x8c, 0xcc, 0x09, 0x23, 0xa5, 0xc9, 0xd0, 0x14, 0x44, 0x2f, 0xa1, 0x8a, 0x57, 0x38, - 0xa4, 0x81, 0x17, 0x33, 0xa3, 0x22, 0xa3, 0x9a, 0x99, 0xa8, 0x41, 0xaa, 0xca, 0xb8, 0xbf, 0x30, - 0xb2, 0xa1, 0xb4, 0x58, 0xe2, 0x78, 0x6d, 0xe8, 0x32, 0xaa, 0x91, 0x89, 0xfa, 0x24, 0x94, 0x37, - 0x1f, 0xaf, 0x54, 0xa1, 0x92, 0xb3, 0x7e, 0x6b, 0x50, 0xdd, 0x7b, 0x85, 0x1a, 0xa0, 0x87, 0x7e, - 0xe4, 0x72, 0x3f, 0xc4, 0x86, 0xd6, 0xd6, 0x3a, 0x05, 0xa7, 0x12, 0xfa, 0xd1, 0xc8, 0x0f, 0xb1, - 0x94, 0xbc, 0x95, 0x92, 0xf2, 0x89, 0xe4, 0xad, 0xa4, 0xf4, 0x14, 0x4e, 0xd9, 0x92, 0x52, 0x12, - 0x73, 0xe6, 0xb2, 0xb9, 0x17, 0x4f, 0xfd, 0x68, 0x26, 0x9b, 0xa2, 0x3b, 0x27, 0xa9, 0x30, 0x4c, - 0xf6, 0xd1, 0x00, 0x5a, 0x7b, 0xf8, 0x8b, 0xcf, 0xe7, 0x64, 0xc9, 0xdd, 0x18, 0xd3, 0xc0, 0x9f, - 0x78, 0xae, 0x9c, 0x00, 0x26, 0x9d, 0xd6, 0x9d, 0x27, 0x29, 0xf6, 0x59, 0x51, 0x8e, 0x82, 0xe4, - 0xd4, 0x30, 0xf4, 0x0a, 0x80, 0xb3, 0xe9, 0xd8, 0x15, 0x85, 0x09, 0x67, 0xc5, 0x68, 0x9d, 0x67, - 0x9d, 0x1d, 0xbe, 0xed, 0x8b, 0xa2, 0xd2, 0xf1, 0x12, 0xb8, 0x58, 0xb3, 0xf7, 0x45, 0xbd, 0x78, - 0x52, 0xb2, 0x6a, 0x50, 0xdd, 0xb7, 0xdd, 0x3a, 0x03, 0xf4, 0x6f, 0x2f, 0xc5, 0x7c, 0x1f, 0xf4, - 0xc7, 0x1a, 0x40, 0x3d, 0x63, 0xfc, 0xff, 0xd9, 0x65, 0x1d, 0xc3, 0xd1, 0x61, 0x27, 0xac, 0x05, - 0xe8, 0x69, 0xae, 0xc8, 0x86, 0x72, 0x62, 0x82, 0x26, 0x1b, 0xf8, 0xe0, 0x6d, 0x49, 0xb0, 0x4c, - 0x0a, 0xf9, 0x87, 0x53, 0x28, 0x64, 0x52, 0xe8, 0x5d, 0x42, 0x51, 0xbe, 0xee, 0x75, 0xf2, 0x9f, - 0x9d, 0xc9, 0x83, 0x3b, 0xdd, 0x6c, 0xdc, 0xa3, 0xa8, 0xdb, 0xdd, 0xbf, 0xd8, 0xfc, 0x32, 0x73, - 0x9b, 0xad, 0xa9, 0xdd, 0x6d, 0x4d, 0xed, 0xe7, 0xd6, 0xd4, 0xbe, 0xee, 0xcc, 0xdc, 0xdd, 0xce, - 0xcc, 0x7d, 0xdf, 0x99, 0xb9, 0x9b, 0xb2, 0xfa, 0xd6, 0x8c, 0xcb, 0xf2, 0x53, 0xf1, 0xfc, 0x4f, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xf1, 0x5f, 0x0a, 0x2f, 0x81, 0x04, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// InfoClient is the client API for Info service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type InfoClient interface { - // Info returns the metadata (Eg. LabelSets, Min/Max time) about all the APIs the component supports. - Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) -} - -type infoClient struct { - cc *grpc.ClientConn -} - -func NewInfoClient(cc *grpc.ClientConn) InfoClient { - return &infoClient{cc} -} - -func (c *infoClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) { - out := new(InfoResponse) - err := c.cc.Invoke(ctx, "/thanos.info.Info/Info", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// InfoServer is the server API for Info service. -type InfoServer interface { - // Info returns the metadata (Eg. LabelSets, Min/Max time) about all the APIs the component supports. - Info(context.Context, *InfoRequest) (*InfoResponse, error) + return mi.MessageOf(x) } -// UnimplementedInfoServer can be embedded to have forward compatible implementations. -type UnimplementedInfoServer struct { +// Deprecated: Use StoreInfo.ProtoReflect.Descriptor instead. +func (*StoreInfo) Descriptor() ([]byte, []int) { + return file_info_infopb_rpc_proto_rawDescGZIP(), []int{2} } -func (*UnimplementedInfoServer) Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") +func (x *StoreInfo) GetMinTime() int64 { + if x != nil { + return x.MinTime + } + return 0 } -func RegisterInfoServer(s *grpc.Server, srv InfoServer) { - s.RegisterService(&_Info_serviceDesc, srv) +func (x *StoreInfo) GetMaxTime() int64 { + if x != nil { + return x.MaxTime + } + return 0 } -func _Info_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(InfoServer).Info(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/thanos.info.Info/Info", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InfoServer).Info(ctx, req.(*InfoRequest)) +func (x *StoreInfo) GetSupportsSharding() bool { + if x != nil { + return x.SupportsSharding } - return interceptor(ctx, in, info, handler) + return false } -var _Info_serviceDesc = grpc.ServiceDesc{ - ServiceName: "thanos.info.Info", - HandlerType: (*InfoServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Info", - Handler: _Info_Info_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "info/infopb/rpc.proto", +func (x *StoreInfo) GetSupportsWithoutReplicaLabels() bool { + if x != nil { + return x.SupportsWithoutReplicaLabels + } + return false } -func (m *InfoRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *StoreInfo) GetTsdbInfos() []*TSDBInfo { + if x != nil { + return x.TsdbInfos } - return dAtA[:n], nil + return nil } -func (m *InfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// RulesInfo holds the metadata related to Rules API exposed by the component. +type RulesInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *InfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +func (x *RulesInfo) Reset() { + *x = RulesInfo{} + mi := &file_info_infopb_rpc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *InfoResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *InfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Query != nil { - { - size, err := m.Query.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.Exemplars != nil { - { - size, err := m.Exemplars.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if m.Targets != nil { - { - size, err := m.Targets.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.MetricMetadata != nil { - { - size, err := m.MetricMetadata.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.Rules != nil { - { - size, err := m.Rules.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Store != nil { - { - size, err := m.Store.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.ComponentType) > 0 { - i -= len(m.ComponentType) - copy(dAtA[i:], m.ComponentType) - i = encodeVarintRpc(dAtA, i, uint64(len(m.ComponentType))) - i-- - dAtA[i] = 0x12 - } - if len(m.LabelSets) > 0 { - for iNdEx := len(m.LabelSets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.LabelSets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil +func (x *RulesInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *StoreInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StoreInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StoreInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TsdbInfos) > 0 { - for iNdEx := len(m.TsdbInfos) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TsdbInfos[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if m.SupportsWithoutReplicaLabels { - i-- - if m.SupportsWithoutReplicaLabels { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if m.SupportsSharding { - i-- - if m.SupportsSharding { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if m.MaxTime != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MaxTime)) - i-- - dAtA[i] = 0x10 - } - if m.MinTime != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MinTime)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} +func (*RulesInfo) ProtoMessage() {} -func (m *RulesInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *RulesInfo) ProtoReflect() protoreflect.Message { + mi := &file_info_infopb_rpc_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *RulesInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use RulesInfo.ProtoReflect.Descriptor instead. +func (*RulesInfo) Descriptor() ([]byte, []int) { + return file_info_infopb_rpc_proto_rawDescGZIP(), []int{3} } -func (m *RulesInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +// MetricMetadataInfo holds the metadata related to Metadata API exposed by the component. +type MetricMetadataInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *MetricMetadataInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *MetricMetadataInfo) Reset() { + *x = MetricMetadataInfo{} + mi := &file_info_infopb_rpc_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *MetricMetadataInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *MetricMetadataInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MetricMetadataInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} +func (*MetricMetadataInfo) ProtoMessage() {} -func (m *TargetsInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *MetricMetadataInfo) ProtoReflect() protoreflect.Message { + mi := &file_info_infopb_rpc_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *TargetsInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use MetricMetadataInfo.ProtoReflect.Descriptor instead. +func (*MetricMetadataInfo) Descriptor() ([]byte, []int) { + return file_info_infopb_rpc_proto_rawDescGZIP(), []int{4} } -func (m *TargetsInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +// TargetsInfo holds the metadata related to Targets API exposed by the component. +type TargetsInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *ExemplarsInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *TargetsInfo) Reset() { + *x = TargetsInfo{} + mi := &file_info_infopb_rpc_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ExemplarsInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *TargetsInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ExemplarsInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxTime != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MaxTime)) - i-- - dAtA[i] = 0x10 - } - if m.MinTime != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MinTime)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} +func (*TargetsInfo) ProtoMessage() {} -func (m *QueryAPIInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *TargetsInfo) ProtoReflect() protoreflect.Message { + mi := &file_info_infopb_rpc_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *QueryAPIInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use TargetsInfo.ProtoReflect.Descriptor instead. +func (*TargetsInfo) Descriptor() ([]byte, []int) { + return file_info_infopb_rpc_proto_rawDescGZIP(), []int{5} } -func (m *QueryAPIInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} +// ExemplarsInfo holds the metadata related to Exemplars API exposed by the component. +type ExemplarsInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *TSDBInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil + MinTime int64 `protobuf:"varint,1,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` + MaxTime int64 `protobuf:"varint,2,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` } -func (m *TSDBInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *ExemplarsInfo) Reset() { + *x = ExemplarsInfo{} + mi := &file_info_infopb_rpc_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *TSDBInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxTime != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MaxTime)) - i-- - dAtA[i] = 0x18 - } - if m.MinTime != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MinTime)) - i-- - dAtA[i] = 0x10 - } - { - size, err := m.Labels.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintRpc(dAtA []byte, offset int, v uint64) int { - offset -= sovRpc(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *InfoRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n +func (x *ExemplarsInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *InfoResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.LabelSets) > 0 { - for _, e := range m.LabelSets { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) +func (*ExemplarsInfo) ProtoMessage() {} + +func (x *ExemplarsInfo) ProtoReflect() protoreflect.Message { + mi := &file_info_infopb_rpc_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - l = len(m.ComponentType) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.Store != nil { - l = m.Store.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Rules != nil { - l = m.Rules.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.MetricMetadata != nil { - l = m.MetricMetadata.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Targets != nil { - l = m.Targets.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Exemplars != nil { - l = m.Exemplars.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Query != nil { - l = m.Query.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n + return mi.MessageOf(x) } -func (m *StoreInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MinTime != 0 { - n += 1 + sovRpc(uint64(m.MinTime)) - } - if m.MaxTime != 0 { - n += 1 + sovRpc(uint64(m.MaxTime)) - } - if m.SupportsSharding { - n += 2 - } - if m.SupportsWithoutReplicaLabels { - n += 2 - } - if len(m.TsdbInfos) > 0 { - for _, e := range m.TsdbInfos { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n +// Deprecated: Use ExemplarsInfo.ProtoReflect.Descriptor instead. +func (*ExemplarsInfo) Descriptor() ([]byte, []int) { + return file_info_infopb_rpc_proto_rawDescGZIP(), []int{6} } -func (m *RulesInfo) Size() (n int) { - if m == nil { - return 0 +func (x *ExemplarsInfo) GetMinTime() int64 { + if x != nil { + return x.MinTime } - var l int - _ = l - return n + return 0 } -func (m *MetricMetadataInfo) Size() (n int) { - if m == nil { - return 0 +func (x *ExemplarsInfo) GetMaxTime() int64 { + if x != nil { + return x.MaxTime } - var l int - _ = l - return n + return 0 } -func (m *TargetsInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n +// QueryInfo holds the metadata related to Query API exposed by the component. +type QueryAPIInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *ExemplarsInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MinTime != 0 { - n += 1 + sovRpc(uint64(m.MinTime)) - } - if m.MaxTime != 0 { - n += 1 + sovRpc(uint64(m.MaxTime)) - } - return n +func (x *QueryAPIInfo) Reset() { + *x = QueryAPIInfo{} + mi := &file_info_infopb_rpc_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *QueryAPIInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n +func (x *QueryAPIInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TSDBInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Labels.Size() - n += 1 + l + sovRpc(uint64(l)) - if m.MinTime != 0 { - n += 1 + sovRpc(uint64(m.MinTime)) - } - if m.MaxTime != 0 { - n += 1 + sovRpc(uint64(m.MaxTime)) - } - return n -} - -func sovRpc(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRpc(x uint64) (n int) { - return sovRpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *InfoRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: InfoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +func (*QueryAPIInfo) ProtoMessage() {} - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *InfoResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } +func (x *QueryAPIInfo) ProtoReflect() protoreflect.Message { + mi := &file_info_infopb_rpc_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: InfoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LabelSets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LabelSets = append(m.LabelSets, labelpb.ZLabelSet{}) - if err := m.LabelSets[len(m.LabelSets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ComponentType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ComponentType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Store", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Store == nil { - m.Store = &StoreInfo{} - } - if err := m.Store.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Rules == nil { - m.Rules = &RulesInfo{} - } - if err := m.Rules.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MetricMetadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MetricMetadata == nil { - m.MetricMetadata = &MetricMetadataInfo{} - } - if err := m.MetricMetadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Targets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Targets == nil { - m.Targets = &TargetsInfo{} - } - if err := m.Targets.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Exemplars", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Exemplars == nil { - m.Exemplars = &ExemplarsInfo{} - } - if err := m.Exemplars.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Query == nil { - m.Query = &QueryAPIInfo{} - } - if err := m.Query.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF + return ms } - return nil + return mi.MessageOf(x) } -func (m *StoreInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StoreInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StoreInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinTime", wireType) - } - m.MinTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxTime", wireType) - } - m.MaxTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SupportsSharding", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.SupportsSharding = bool(v != 0) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SupportsWithoutReplicaLabels", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.SupportsWithoutReplicaLabels = bool(v != 0) - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TsdbInfos", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TsdbInfos = append(m.TsdbInfos, TSDBInfo{}) - if err := m.TsdbInfos[len(m.TsdbInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +// Deprecated: Use QueryAPIInfo.ProtoReflect.Descriptor instead. +func (*QueryAPIInfo) Descriptor() ([]byte, []int) { + return file_info_infopb_rpc_proto_rawDescGZIP(), []int{7} } -func (m *RulesInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RulesInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RulesInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MetricMetadataInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MetricMetadataInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MetricMetadataInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +type TSDBInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil + Labels *labelpb.LabelSet `protobuf:"bytes,1,opt,name=labels,proto3" json:"labels"` + MinTime int64 `protobuf:"varint,2,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` + MaxTime int64 `protobuf:"varint,3,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` } -func (m *TargetsInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TargetsInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TargetsInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +func (x *TSDBInfo) Reset() { + *x = TSDBInfo{} + mi := &file_info_infopb_rpc_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ExemplarsInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ExemplarsInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ExemplarsInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinTime", wireType) - } - m.MinTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxTime", wireType) - } - m.MaxTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +func (x *TSDBInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *QueryAPIInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAPIInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAPIInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + +func (*TSDBInfo) ProtoMessage() {} + +func (x *TSDBInfo) ProtoReflect() protoreflect.Message { + mi := &file_info_infopb_rpc_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } + return mi.MessageOf(x) +} - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +// Deprecated: Use TSDBInfo.ProtoReflect.Descriptor instead. +func (*TSDBInfo) Descriptor() ([]byte, []int) { + return file_info_infopb_rpc_proto_rawDescGZIP(), []int{8} } -func (m *TSDBInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TSDBInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TSDBInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Labels.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinTime", wireType) - } - m.MinTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxTime", wireType) - } - m.MaxTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *TSDBInfo) GetLabels() *labelpb.LabelSet { + if x != nil { + return x.Labels } return nil } -func skipRpc(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthRpc - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRpc - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRpc - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF + +func (x *TSDBInfo) GetMinTime() int64 { + if x != nil { + return x.MinTime + } + return 0 +} + +func (x *TSDBInfo) GetMaxTime() int64 { + if x != nil { + return x.MaxTime + } + return 0 +} + +var File_info_infopb_rpc_proto protoreflect.FileDescriptor + +var file_info_infopb_rpc_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x70, 0x62, 0x2f, 0x72, 0x70, + 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, + 0x69, 0x6e, 0x66, 0x6f, 0x1a, 0x19, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x70, 0x62, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x13, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2f, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x0d, 0x0a, 0x0b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0xc2, 0x03, 0x0a, 0x0c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x73, 0x65, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, + 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x74, 0x42, 0x16, 0x9a, 0x84, 0x9e, 0x03, + 0x11, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x73, 0x65, 0x74, + 0x73, 0x22, 0x52, 0x09, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x74, 0x73, 0x12, 0x24, 0x0a, + 0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, + 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x52, + 0x75, 0x6c, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, + 0x48, 0x0a, 0x0f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, + 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0e, 0x6d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, 0x07, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x68, 0x61, + 0x6e, 0x6f, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x38, 0x0a, + 0x09, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x45, + 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x65, 0x78, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, + 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x50, 0x49, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x89, 0x02, 0x0a, 0x09, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x11, + 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x64, 0x69, 0x6e, + 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, + 0x73, 0x53, 0x68, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x45, 0x0a, 0x1f, 0x73, 0x75, 0x70, + 0x70, 0x6f, 0x72, 0x74, 0x73, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x5f, 0x72, 0x65, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x1c, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x57, 0x69, 0x74, 0x68, + 0x6f, 0x75, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x12, 0x4c, 0x0a, 0x0a, 0x74, 0x73, 0x64, 0x62, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x69, 0x6e, + 0x66, 0x6f, 0x2e, 0x54, 0x53, 0x44, 0x42, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x16, 0x9a, 0x84, 0x9e, + 0x03, 0x11, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x74, 0x73, 0x64, 0x62, 0x5f, 0x69, 0x6e, 0x66, + 0x6f, 0x73, 0x22, 0x52, 0x09, 0x74, 0x73, 0x64, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x4a, 0x04, + 0x08, 0x04, 0x10, 0x05, 0x22, 0x0b, 0x0a, 0x09, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x49, 0x6e, 0x66, + 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x0d, 0x0a, 0x0b, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x45, 0x0a, 0x0d, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x69, 0x6e, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x0e, 0x0a, + 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x50, 0x49, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x7e, 0x0a, + 0x08, 0x54, 0x53, 0x44, 0x42, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3c, 0x0a, 0x06, 0x6c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x68, 0x61, 0x6e, + 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x74, 0x42, 0x12, 0x9a, 0x84, 0x9e, + 0x03, 0x0d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x52, + 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x69, 0x6e, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x32, 0x43, 0x0a, + 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3b, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x2e, + 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, + 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, + 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRpc = fmt.Errorf("proto: unexpected end of group") + file_info_infopb_rpc_proto_rawDescOnce sync.Once + file_info_infopb_rpc_proto_rawDescData = file_info_infopb_rpc_proto_rawDesc ) + +func file_info_infopb_rpc_proto_rawDescGZIP() []byte { + file_info_infopb_rpc_proto_rawDescOnce.Do(func() { + file_info_infopb_rpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_info_infopb_rpc_proto_rawDescData) + }) + return file_info_infopb_rpc_proto_rawDescData +} + +var file_info_infopb_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_info_infopb_rpc_proto_goTypes = []any{ + (*InfoRequest)(nil), // 0: thanos.info.InfoRequest + (*InfoResponse)(nil), // 1: thanos.info.InfoResponse + (*StoreInfo)(nil), // 2: thanos.info.StoreInfo + (*RulesInfo)(nil), // 3: thanos.info.RulesInfo + (*MetricMetadataInfo)(nil), // 4: thanos.info.MetricMetadataInfo + (*TargetsInfo)(nil), // 5: thanos.info.TargetsInfo + (*ExemplarsInfo)(nil), // 6: thanos.info.ExemplarsInfo + (*QueryAPIInfo)(nil), // 7: thanos.info.QueryAPIInfo + (*TSDBInfo)(nil), // 8: thanos.info.TSDBInfo + (*labelpb.LabelSet)(nil), // 9: thanos.LabelSet +} +var file_info_infopb_rpc_proto_depIdxs = []int32{ + 9, // 0: thanos.info.InfoResponse.label_sets:type_name -> thanos.LabelSet + 2, // 1: thanos.info.InfoResponse.store:type_name -> thanos.info.StoreInfo + 3, // 2: thanos.info.InfoResponse.rules:type_name -> thanos.info.RulesInfo + 4, // 3: thanos.info.InfoResponse.metric_metadata:type_name -> thanos.info.MetricMetadataInfo + 5, // 4: thanos.info.InfoResponse.targets:type_name -> thanos.info.TargetsInfo + 6, // 5: thanos.info.InfoResponse.exemplars:type_name -> thanos.info.ExemplarsInfo + 7, // 6: thanos.info.InfoResponse.query:type_name -> thanos.info.QueryAPIInfo + 8, // 7: thanos.info.StoreInfo.tsdb_infos:type_name -> thanos.info.TSDBInfo + 9, // 8: thanos.info.TSDBInfo.labels:type_name -> thanos.LabelSet + 0, // 9: thanos.info.Info.Info:input_type -> thanos.info.InfoRequest + 1, // 10: thanos.info.Info.Info:output_type -> thanos.info.InfoResponse + 10, // [10:11] is the sub-list for method output_type + 9, // [9:10] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_info_infopb_rpc_proto_init() } +func file_info_infopb_rpc_proto_init() { + if File_info_infopb_rpc_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_info_infopb_rpc_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_info_infopb_rpc_proto_goTypes, + DependencyIndexes: file_info_infopb_rpc_proto_depIdxs, + MessageInfos: file_info_infopb_rpc_proto_msgTypes, + }.Build() + File_info_infopb_rpc_proto = out.File + file_info_infopb_rpc_proto_rawDesc = nil + file_info_infopb_rpc_proto_goTypes = nil + file_info_infopb_rpc_proto_depIdxs = nil +} diff --git a/pkg/info/infopb/rpc.proto b/pkg/info/infopb/rpc.proto index 9f0db3709da..5ecdca63e68 100644 --- a/pkg/info/infopb/rpc.proto +++ b/pkg/info/infopb/rpc.proto @@ -5,20 +5,9 @@ syntax = "proto3"; package thanos.info; import "store/labelpb/types.proto"; -import "gogoproto/gogo.proto"; +import "tagger/tagger.proto"; -option go_package = "infopb"; - -option (gogoproto.sizer_all) = true; -option (gogoproto.marshaler_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; +option go_package = "github.com/thanos-io/thanos/pkg/info/infopb"; // Info represents the API that is responsible for gathering metadata about the all APIs supported by the component. service Info { @@ -29,7 +18,7 @@ service Info { message InfoRequest {} message InfoResponse { - repeated ZLabelSet label_sets = 1 [(gogoproto.nullable) = false]; + repeated LabelSet label_sets = 1 [(tagger.tags) = "json:\"label_sets\""]; string ComponentType = 2; // StoreInfo holds the metadata related to Store API if exposed by the component otherwise it will be null. @@ -63,7 +52,7 @@ message StoreInfo { bool supports_without_replica_labels = 5; // TSDBInfos holds metadata for all TSDBs exposed by the store. - repeated TSDBInfo tsdb_infos = 6 [(gogoproto.nullable) = false]; + repeated TSDBInfo tsdb_infos = 6 [(tagger.tags) = "json:\"tsdb_infos\""]; } // RulesInfo holds the metadata related to Rules API exposed by the component. @@ -89,7 +78,7 @@ message QueryAPIInfo { } message TSDBInfo { - ZLabelSet labels = 1 [(gogoproto.nullable) = false]; + LabelSet labels = 1 [(tagger.tags) = "json:\"labels\""]; int64 min_time = 2; int64 max_time = 3; diff --git a/pkg/info/infopb/rpc_grpc.pb.go b/pkg/info/infopb/rpc_grpc.pb.go new file mode 100644 index 00000000000..02bb66e075e --- /dev/null +++ b/pkg/info/infopb/rpc_grpc.pb.go @@ -0,0 +1,131 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v3.20.1 +// source: info/infopb/rpc.proto + +package infopb + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Info_Info_FullMethodName = "/thanos.info.Info/Info" +) + +// InfoClient is the client API for Info service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Info represents the API that is responsible for gathering metadata about the all APIs supported by the component. +type InfoClient interface { + // Info returns the metadata (Eg. LabelSets, Min/Max time) about all the APIs the component supports. + Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) +} + +type infoClient struct { + cc grpc.ClientConnInterface +} + +func NewInfoClient(cc grpc.ClientConnInterface) InfoClient { + return &infoClient{cc} +} + +func (c *infoClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(InfoResponse) + err := c.cc.Invoke(ctx, Info_Info_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// InfoServer is the server API for Info service. +// All implementations must embed UnimplementedInfoServer +// for forward compatibility. +// +// Info represents the API that is responsible for gathering metadata about the all APIs supported by the component. +type InfoServer interface { + // Info returns the metadata (Eg. LabelSets, Min/Max time) about all the APIs the component supports. + Info(context.Context, *InfoRequest) (*InfoResponse, error) + mustEmbedUnimplementedInfoServer() +} + +// UnimplementedInfoServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedInfoServer struct{} + +func (UnimplementedInfoServer) Info(context.Context, *InfoRequest) (*InfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") +} +func (UnimplementedInfoServer) mustEmbedUnimplementedInfoServer() {} +func (UnimplementedInfoServer) testEmbeddedByValue() {} + +// UnsafeInfoServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to InfoServer will +// result in compilation errors. +type UnsafeInfoServer interface { + mustEmbedUnimplementedInfoServer() +} + +func RegisterInfoServer(s grpc.ServiceRegistrar, srv InfoServer) { + // If the following call pancis, it indicates UnimplementedInfoServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Info_ServiceDesc, srv) +} + +func _Info_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfoServer).Info(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Info_Info_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfoServer).Info(ctx, req.(*InfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Info_ServiceDesc is the grpc.ServiceDesc for Info service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Info_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "thanos.info.Info", + HandlerType: (*InfoServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Info", + Handler: _Info_Info_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "info/infopb/rpc.proto", +} diff --git a/pkg/info/infopb/rpc_vtproto.pb.go b/pkg/info/infopb/rpc_vtproto.pb.go new file mode 100644 index 00000000000..7aa6a2b981d --- /dev/null +++ b/pkg/info/infopb/rpc_vtproto.pb.go @@ -0,0 +1,1974 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.1-0.20250313105119-ba97887b0a25 +// source: info/infopb/rpc.proto + +package infopb + +import ( + fmt "fmt" + io "io" + + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *InfoRequest) CloneVT() *InfoRequest { + if m == nil { + return (*InfoRequest)(nil) + } + r := new(InfoRequest) + return r +} + +func (m *InfoRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *InfoResponse) CloneVT() *InfoResponse { + if m == nil { + return (*InfoResponse)(nil) + } + r := new(InfoResponse) + r.ComponentType = m.ComponentType + r.Store = m.Store.CloneVT() + r.Rules = m.Rules.CloneVT() + r.MetricMetadata = m.MetricMetadata.CloneVT() + r.Targets = m.Targets.CloneVT() + r.Exemplars = m.Exemplars.CloneVT() + r.Query = m.Query.CloneVT() + if rhs := m.LabelSets; rhs != nil { + tmpContainer := make([]*labelpb.LabelSet, len(rhs)) + for k, v := range rhs { + if vtpb, ok := interface{}(v).(interface{ CloneVT() *labelpb.LabelSet }); ok { + tmpContainer[k] = vtpb.CloneVT() + } else { + tmpContainer[k] = proto.Clone(v).(*labelpb.LabelSet) + } + } + r.LabelSets = tmpContainer + } + return r +} + +func (m *InfoResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *StoreInfo) CloneVT() *StoreInfo { + if m == nil { + return (*StoreInfo)(nil) + } + r := new(StoreInfo) + r.MinTime = m.MinTime + r.MaxTime = m.MaxTime + r.SupportsSharding = m.SupportsSharding + r.SupportsWithoutReplicaLabels = m.SupportsWithoutReplicaLabels + if rhs := m.TsdbInfos; rhs != nil { + tmpContainer := make([]*TSDBInfo, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.TsdbInfos = tmpContainer + } + return r +} + +func (m *StoreInfo) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *RulesInfo) CloneVT() *RulesInfo { + if m == nil { + return (*RulesInfo)(nil) + } + r := new(RulesInfo) + return r +} + +func (m *RulesInfo) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *MetricMetadataInfo) CloneVT() *MetricMetadataInfo { + if m == nil { + return (*MetricMetadataInfo)(nil) + } + r := new(MetricMetadataInfo) + return r +} + +func (m *MetricMetadataInfo) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *TargetsInfo) CloneVT() *TargetsInfo { + if m == nil { + return (*TargetsInfo)(nil) + } + r := new(TargetsInfo) + return r +} + +func (m *TargetsInfo) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ExemplarsInfo) CloneVT() *ExemplarsInfo { + if m == nil { + return (*ExemplarsInfo)(nil) + } + r := new(ExemplarsInfo) + r.MinTime = m.MinTime + r.MaxTime = m.MaxTime + return r +} + +func (m *ExemplarsInfo) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *QueryAPIInfo) CloneVT() *QueryAPIInfo { + if m == nil { + return (*QueryAPIInfo)(nil) + } + r := new(QueryAPIInfo) + return r +} + +func (m *QueryAPIInfo) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *TSDBInfo) CloneVT() *TSDBInfo { + if m == nil { + return (*TSDBInfo)(nil) + } + r := new(TSDBInfo) + r.MinTime = m.MinTime + r.MaxTime = m.MaxTime + if rhs := m.Labels; rhs != nil { + if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *labelpb.LabelSet }); ok { + r.Labels = vtpb.CloneVT() + } else { + r.Labels = proto.Clone(rhs).(*labelpb.LabelSet) + } + } + return r +} + +func (m *TSDBInfo) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *InfoRequest) EqualVT(that *InfoRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + return true +} + +func (this *InfoRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*InfoRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *InfoResponse) EqualVT(that *InfoResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.LabelSets) != len(that.LabelSets) { + return false + } + for i, vx := range this.LabelSets { + vy := that.LabelSets[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &labelpb.LabelSet{} + } + if q == nil { + q = &labelpb.LabelSet{} + } + if equal, ok := interface{}(p).(interface{ EqualVT(*labelpb.LabelSet) bool }); ok { + if !equal.EqualVT(q) { + return false + } + } else if !proto.Equal(p, q) { + return false + } + } + } + if this.ComponentType != that.ComponentType { + return false + } + if !this.Store.EqualVT(that.Store) { + return false + } + if !this.Rules.EqualVT(that.Rules) { + return false + } + if !this.MetricMetadata.EqualVT(that.MetricMetadata) { + return false + } + if !this.Targets.EqualVT(that.Targets) { + return false + } + if !this.Exemplars.EqualVT(that.Exemplars) { + return false + } + if !this.Query.EqualVT(that.Query) { + return false + } + return true +} + +func (this *InfoResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*InfoResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *StoreInfo) EqualVT(that *StoreInfo) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.MinTime != that.MinTime { + return false + } + if this.MaxTime != that.MaxTime { + return false + } + if this.SupportsSharding != that.SupportsSharding { + return false + } + if this.SupportsWithoutReplicaLabels != that.SupportsWithoutReplicaLabels { + return false + } + if len(this.TsdbInfos) != len(that.TsdbInfos) { + return false + } + for i, vx := range this.TsdbInfos { + vy := that.TsdbInfos[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &TSDBInfo{} + } + if q == nil { + q = &TSDBInfo{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *StoreInfo) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*StoreInfo) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *RulesInfo) EqualVT(that *RulesInfo) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + return true +} + +func (this *RulesInfo) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*RulesInfo) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *MetricMetadataInfo) EqualVT(that *MetricMetadataInfo) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + return true +} + +func (this *MetricMetadataInfo) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*MetricMetadataInfo) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *TargetsInfo) EqualVT(that *TargetsInfo) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + return true +} + +func (this *TargetsInfo) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*TargetsInfo) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ExemplarsInfo) EqualVT(that *ExemplarsInfo) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.MinTime != that.MinTime { + return false + } + if this.MaxTime != that.MaxTime { + return false + } + return true +} + +func (this *ExemplarsInfo) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ExemplarsInfo) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *QueryAPIInfo) EqualVT(that *QueryAPIInfo) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + return true +} + +func (this *QueryAPIInfo) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*QueryAPIInfo) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *TSDBInfo) EqualVT(that *TSDBInfo) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if equal, ok := interface{}(this.Labels).(interface{ EqualVT(*labelpb.LabelSet) bool }); ok { + if !equal.EqualVT(that.Labels) { + return false + } + } else if !proto.Equal(this.Labels, that.Labels) { + return false + } + if this.MinTime != that.MinTime { + return false + } + if this.MaxTime != that.MaxTime { + return false + } + return true +} + +func (this *TSDBInfo) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*TSDBInfo) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *InfoRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InfoRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *InfoRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *InfoResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InfoResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *InfoResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.Query != nil { + size, err := m.Query.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } + if m.Exemplars != nil { + size, err := m.Exemplars.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + if m.Targets != nil { + size, err := m.Targets.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + if m.MetricMetadata != nil { + size, err := m.MetricMetadata.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + if m.Rules != nil { + size, err := m.Rules.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if m.Store != nil { + size, err := m.Store.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if len(m.ComponentType) > 0 { + i -= len(m.ComponentType) + copy(dAtA[i:], m.ComponentType) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ComponentType))) + i-- + dAtA[i] = 0x12 + } + if len(m.LabelSets) > 0 { + for iNdEx := len(m.LabelSets) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.LabelSets[iNdEx]).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.LabelSets[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *StoreInfo) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StoreInfo) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StoreInfo) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TsdbInfos) > 0 { + for iNdEx := len(m.TsdbInfos) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.TsdbInfos[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + } + if m.SupportsWithoutReplicaLabels { + i-- + if m.SupportsWithoutReplicaLabels { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.SupportsSharding { + i-- + if m.SupportsSharding { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.MaxTime != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MaxTime)) + i-- + dAtA[i] = 0x10 + } + if m.MinTime != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MinTime)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *RulesInfo) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RulesInfo) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RulesInfo) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MetricMetadataInfo) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MetricMetadataInfo) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MetricMetadataInfo) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *TargetsInfo) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TargetsInfo) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *TargetsInfo) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ExemplarsInfo) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExemplarsInfo) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ExemplarsInfo) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxTime != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MaxTime)) + i-- + dAtA[i] = 0x10 + } + if m.MinTime != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MinTime)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryAPIInfo) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAPIInfo) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *QueryAPIInfo) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *TSDBInfo) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TSDBInfo) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *TSDBInfo) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxTime != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MaxTime)) + i-- + dAtA[i] = 0x18 + } + if m.MinTime != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MinTime)) + i-- + dAtA[i] = 0x10 + } + if m.Labels != nil { + if vtmsg, ok := interface{}(m.Labels).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Labels) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *InfoRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *InfoResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.LabelSets) > 0 { + for _, e := range m.LabelSets { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + l = len(m.ComponentType) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Store != nil { + l = m.Store.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Rules != nil { + l = m.Rules.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.MetricMetadata != nil { + l = m.MetricMetadata.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Targets != nil { + l = m.Targets.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Exemplars != nil { + l = m.Exemplars.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Query != nil { + l = m.Query.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *StoreInfo) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MinTime != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MinTime)) + } + if m.MaxTime != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MaxTime)) + } + if m.SupportsSharding { + n += 2 + } + if m.SupportsWithoutReplicaLabels { + n += 2 + } + if len(m.TsdbInfos) > 0 { + for _, e := range m.TsdbInfos { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *RulesInfo) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MetricMetadataInfo) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *TargetsInfo) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ExemplarsInfo) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MinTime != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MinTime)) + } + if m.MaxTime != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MaxTime)) + } + return n +} + +func (m *QueryAPIInfo) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *TSDBInfo) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Labels != nil { + if size, ok := interface{}(m.Labels).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Labels) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.MinTime != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MinTime)) + } + if m.MaxTime != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MaxTime)) + } + return n +} + +func (m *InfoRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InfoResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LabelSets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LabelSets = append(m.LabelSets, &labelpb.LabelSet{}) + if unmarshal, ok := interface{}(m.LabelSets[len(m.LabelSets)-1]).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.LabelSets[len(m.LabelSets)-1]); err != nil { + return err + } + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ComponentType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ComponentType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Store", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Store == nil { + m.Store = &StoreInfo{} + } + if err := m.Store.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Rules == nil { + m.Rules = &RulesInfo{} + } + if err := m.Rules.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MetricMetadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MetricMetadata == nil { + m.MetricMetadata = &MetricMetadataInfo{} + } + if err := m.MetricMetadata.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Targets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Targets == nil { + m.Targets = &TargetsInfo{} + } + if err := m.Targets.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Exemplars", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Exemplars == nil { + m.Exemplars = &ExemplarsInfo{} + } + if err := m.Exemplars.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Query == nil { + m.Query = &QueryAPIInfo{} + } + if err := m.Query.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StoreInfo) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StoreInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StoreInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinTime", wireType) + } + m.MinTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxTime", wireType) + } + m.MaxTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SupportsSharding", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SupportsSharding = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SupportsWithoutReplicaLabels", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SupportsWithoutReplicaLabels = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TsdbInfos", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TsdbInfos = append(m.TsdbInfos, &TSDBInfo{}) + if err := m.TsdbInfos[len(m.TsdbInfos)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RulesInfo) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RulesInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RulesInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MetricMetadataInfo) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MetricMetadataInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MetricMetadataInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TargetsInfo) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TargetsInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TargetsInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExemplarsInfo) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExemplarsInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExemplarsInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinTime", wireType) + } + m.MinTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxTime", wireType) + } + m.MaxTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAPIInfo) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAPIInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAPIInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TSDBInfo) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TSDBInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TSDBInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = &labelpb.LabelSet{} + } + if unmarshal, ok := interface{}(m.Labels).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Labels); err != nil { + return err + } + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinTime", wireType) + } + m.MinTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxTime", wireType) + } + m.MaxTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pkg/metadata/metadata.go b/pkg/metadata/metadata.go index 8067ee224c1..207c704d6d7 100644 --- a/pkg/metadata/metadata.go +++ b/pkg/metadata/metadata.go @@ -19,7 +19,7 @@ var _ UnaryClient = &GRPCClient{} // UnaryClient is a gRPC metadatapb.Metadata client which expands streaming metadata API. Useful for consumers that does not // support streaming. type UnaryClient interface { - MetricMetadata(ctx context.Context, req *metadatapb.MetricMetadataRequest) (map[string][]metadatapb.Meta, annotations.Annotations, error) + MetricMetadata(ctx context.Context, req *metadatapb.MetricMetadataRequest) (map[string][]*metadatapb.Meta, annotations.Annotations, error) } // GRPCClient allows to retrieve metadata from local gRPC streaming server implementation. @@ -34,7 +34,7 @@ func NewGRPCClient(ts metadatapb.MetadataServer) *GRPCClient { } } -func (rr *GRPCClient) MetricMetadata(ctx context.Context, req *metadatapb.MetricMetadataRequest) (map[string][]metadatapb.Meta, annotations.Annotations, error) { +func (rr *GRPCClient) MetricMetadata(ctx context.Context, req *metadatapb.MetricMetadataRequest) (map[string][]*metadatapb.Meta, annotations.Annotations, error) { span, ctx := tracing.StartSpan(ctx, "metadata_grpc_request") defer span.Finish() @@ -42,14 +42,14 @@ func (rr *GRPCClient) MetricMetadata(ctx context.Context, req *metadatapb.Metric if req.Limit >= 0 { if req.Metric != "" { - srv.metadataMap = make(map[string][]metadatapb.Meta, 1) + srv.metadataMap = make(map[string][]*metadatapb.Meta, 1) } else if req.Limit <= 100 { - srv.metadataMap = make(map[string][]metadatapb.Meta, req.Limit) + srv.metadataMap = make(map[string][]*metadatapb.Meta, req.Limit) } else { - srv.metadataMap = make(map[string][]metadatapb.Meta) + srv.metadataMap = make(map[string][]*metadatapb.Meta) } } else { - srv.metadataMap = make(map[string][]metadatapb.Meta) + srv.metadataMap = make(map[string][]*metadatapb.Meta) } if err := rr.proxy.MetricMetadata(req, srv); err != nil { @@ -68,7 +68,7 @@ type metadataServer struct { limit int warnings annotations.Annotations - metadataMap map[string][]metadatapb.Meta + metadataMap map[string][]*metadatapb.Meta mu sync.Mutex } @@ -102,7 +102,7 @@ func (srv *metadataServer) Send(res *metadatapb.MetricMetadataResponse) error { Outer: for _, meta := range v.Metas { for _, m := range metadata { - if meta == m { + if meta.EqualVT(m) { continue Outer } } diff --git a/pkg/metadata/metadatapb/custom.go b/pkg/metadata/metadatapb/custom.go index 697277aaa35..39e692de462 100644 --- a/pkg/metadata/metadatapb/custom.go +++ b/pkg/metadata/metadatapb/custom.go @@ -3,10 +3,6 @@ package metadatapb -import ( - "unsafe" -) - func NewMetricMetadataResponse(metadata *MetricMetadata) *MetricMetadataResponse { return &MetricMetadataResponse{ Result: &MetricMetadataResponse_Metadata{ @@ -23,6 +19,10 @@ func NewWarningMetadataResponse(warning error) *MetricMetadataResponse { } } -func FromMetadataMap(m map[string][]Meta) *MetricMetadata { - return &MetricMetadata{Metadata: *(*map[string]MetricMetadataEntry)(unsafe.Pointer(&m))} +func FromMetadataMap(m map[string][]*Meta) *MetricMetadata { + md := make(map[string]*MetricMetadataEntry, len(m)) + for k, v := range m { + md[k] = &MetricMetadataEntry{Metas: v} + } + return &MetricMetadata{Metadata: md} } diff --git a/pkg/metadata/metadatapb/rpc.pb.go b/pkg/metadata/metadatapb/rpc.pb.go index e7b51b665a9..34c300b66fc 100644 --- a/pkg/metadata/metadatapb/rpc.pb.go +++ b/pkg/metadata/metadatapb/rpc.pb.go @@ -1,129 +1,134 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.20.1 // source: metadata/metadatapb/rpc.proto package metadatapb import ( - context "context" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" + reflect "reflect" + sync "sync" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/srikrsna/protoc-gen-gotag/tagger" storepb "github.com/thanos-io/thanos/pkg/store/storepb" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type MetricMetadataRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Metric string `protobuf:"bytes,1,opt,name=metric,proto3" json:"metric,omitempty"` Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` PartialResponseStrategy storepb.PartialResponseStrategy `protobuf:"varint,3,opt,name=partial_response_strategy,json=partialResponseStrategy,proto3,enum=thanos.PartialResponseStrategy" json:"partial_response_strategy,omitempty"` } -func (m *MetricMetadataRequest) Reset() { *m = MetricMetadataRequest{} } -func (m *MetricMetadataRequest) String() string { return proto.CompactTextString(m) } -func (*MetricMetadataRequest) ProtoMessage() {} -func (*MetricMetadataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_1d9ae5661e0dc3fc, []int{0} +func (x *MetricMetadataRequest) Reset() { + *x = MetricMetadataRequest{} + mi := &file_metadata_metadatapb_rpc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *MetricMetadataRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *MetricMetadataRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MetricMetadataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MetricMetadataRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*MetricMetadataRequest) ProtoMessage() {} + +func (x *MetricMetadataRequest) ProtoReflect() protoreflect.Message { + mi := &file_metadata_metadatapb_rpc_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *MetricMetadataRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricMetadataRequest.Merge(m, src) + +// Deprecated: Use MetricMetadataRequest.ProtoReflect.Descriptor instead. +func (*MetricMetadataRequest) Descriptor() ([]byte, []int) { + return file_metadata_metadatapb_rpc_proto_rawDescGZIP(), []int{0} } -func (m *MetricMetadataRequest) XXX_Size() int { - return m.Size() + +func (x *MetricMetadataRequest) GetMetric() string { + if x != nil { + return x.Metric + } + return "" } -func (m *MetricMetadataRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MetricMetadataRequest.DiscardUnknown(m) + +func (x *MetricMetadataRequest) GetLimit() int32 { + if x != nil { + return x.Limit + } + return 0 } -var xxx_messageInfo_MetricMetadataRequest proto.InternalMessageInfo +func (x *MetricMetadataRequest) GetPartialResponseStrategy() storepb.PartialResponseStrategy { + if x != nil { + return x.PartialResponseStrategy + } + return storepb.PartialResponseStrategy(0) +} type MetricMetadataResponse struct { - // Types that are valid to be assigned to Result: + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Result: + // // *MetricMetadataResponse_Metadata // *MetricMetadataResponse_Warning Result isMetricMetadataResponse_Result `protobuf_oneof:"result"` } -func (m *MetricMetadataResponse) Reset() { *m = MetricMetadataResponse{} } -func (m *MetricMetadataResponse) String() string { return proto.CompactTextString(m) } -func (*MetricMetadataResponse) ProtoMessage() {} -func (*MetricMetadataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1d9ae5661e0dc3fc, []int{1} -} -func (m *MetricMetadataResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MetricMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MetricMetadataResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MetricMetadataResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricMetadataResponse.Merge(m, src) +func (x *MetricMetadataResponse) Reset() { + *x = MetricMetadataResponse{} + mi := &file_metadata_metadatapb_rpc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *MetricMetadataResponse) XXX_Size() int { - return m.Size() -} -func (m *MetricMetadataResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MetricMetadataResponse.DiscardUnknown(m) + +func (x *MetricMetadataResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_MetricMetadataResponse proto.InternalMessageInfo +func (*MetricMetadataResponse) ProtoMessage() {} -type isMetricMetadataResponse_Result interface { - isMetricMetadataResponse_Result() - MarshalTo([]byte) (int, error) - Size() int +func (x *MetricMetadataResponse) ProtoReflect() protoreflect.Message { + mi := &file_metadata_metadatapb_rpc_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -type MetricMetadataResponse_Metadata struct { - Metadata *MetricMetadata `protobuf:"bytes,1,opt,name=metadata,proto3,oneof" json:"metadata,omitempty"` -} -type MetricMetadataResponse_Warning struct { - Warning string `protobuf:"bytes,2,opt,name=warning,proto3,oneof" json:"warning,omitempty"` +// Deprecated: Use MetricMetadataResponse.ProtoReflect.Descriptor instead. +func (*MetricMetadataResponse) Descriptor() ([]byte, []int) { + return file_metadata_metadatapb_rpc_proto_rawDescGZIP(), []int{1} } -func (*MetricMetadataResponse_Metadata) isMetricMetadataResponse_Result() {} -func (*MetricMetadataResponse_Warning) isMetricMetadataResponse_Result() {} - func (m *MetricMetadataResponse) GetResult() isMetricMetadataResponse_Result { if m != nil { return m.Result @@ -131,1379 +136,315 @@ func (m *MetricMetadataResponse) GetResult() isMetricMetadataResponse_Result { return nil } -func (m *MetricMetadataResponse) GetMetadata() *MetricMetadata { - if x, ok := m.GetResult().(*MetricMetadataResponse_Metadata); ok { +func (x *MetricMetadataResponse) GetMetadata() *MetricMetadata { + if x, ok := x.GetResult().(*MetricMetadataResponse_Metadata); ok { return x.Metadata } return nil } -func (m *MetricMetadataResponse) GetWarning() string { - if x, ok := m.GetResult().(*MetricMetadataResponse_Warning); ok { +func (x *MetricMetadataResponse) GetWarning() string { + if x, ok := x.GetResult().(*MetricMetadataResponse_Warning); ok { return x.Warning } return "" } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*MetricMetadataResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*MetricMetadataResponse_Metadata)(nil), - (*MetricMetadataResponse_Warning)(nil), - } -} - -type MetricMetadata struct { - Metadata map[string]MetricMetadataEntry `protobuf:"bytes,1,rep,name=metadata,proto3" json:"metadata" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *MetricMetadata) Reset() { *m = MetricMetadata{} } -func (m *MetricMetadata) String() string { return proto.CompactTextString(m) } -func (*MetricMetadata) ProtoMessage() {} -func (*MetricMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_1d9ae5661e0dc3fc, []int{2} -} -func (m *MetricMetadata) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MetricMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MetricMetadata.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MetricMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricMetadata.Merge(m, src) -} -func (m *MetricMetadata) XXX_Size() int { - return m.Size() -} -func (m *MetricMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_MetricMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_MetricMetadata proto.InternalMessageInfo - -type MetricMetadataEntry struct { - Metas []Meta `protobuf:"bytes,2,rep,name=metas,proto3" json:"metas"` -} - -func (m *MetricMetadataEntry) Reset() { *m = MetricMetadataEntry{} } -func (m *MetricMetadataEntry) String() string { return proto.CompactTextString(m) } -func (*MetricMetadataEntry) ProtoMessage() {} -func (*MetricMetadataEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_1d9ae5661e0dc3fc, []int{3} -} -func (m *MetricMetadataEntry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MetricMetadataEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MetricMetadataEntry.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MetricMetadataEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricMetadataEntry.Merge(m, src) -} -func (m *MetricMetadataEntry) XXX_Size() int { - return m.Size() -} -func (m *MetricMetadataEntry) XXX_DiscardUnknown() { - xxx_messageInfo_MetricMetadataEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_MetricMetadataEntry proto.InternalMessageInfo - -type Meta struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type"` - Help string `protobuf:"bytes,2,opt,name=help,proto3" json:"help"` - Unit string `protobuf:"bytes,3,opt,name=unit,proto3" json:"unit"` -} - -func (m *Meta) Reset() { *m = Meta{} } -func (m *Meta) String() string { return proto.CompactTextString(m) } -func (*Meta) ProtoMessage() {} -func (*Meta) Descriptor() ([]byte, []int) { - return fileDescriptor_1d9ae5661e0dc3fc, []int{4} -} -func (m *Meta) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Meta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Meta.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Meta) XXX_Merge(src proto.Message) { - xxx_messageInfo_Meta.Merge(m, src) -} -func (m *Meta) XXX_Size() int { - return m.Size() -} -func (m *Meta) XXX_DiscardUnknown() { - xxx_messageInfo_Meta.DiscardUnknown(m) -} - -var xxx_messageInfo_Meta proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MetricMetadataRequest)(nil), "thanos.MetricMetadataRequest") - proto.RegisterType((*MetricMetadataResponse)(nil), "thanos.MetricMetadataResponse") - proto.RegisterType((*MetricMetadata)(nil), "thanos.MetricMetadata") - proto.RegisterMapType((map[string]MetricMetadataEntry)(nil), "thanos.MetricMetadata.MetadataEntry") - proto.RegisterType((*MetricMetadataEntry)(nil), "thanos.MetricMetadataEntry") - proto.RegisterType((*Meta)(nil), "thanos.Meta") -} - -func init() { proto.RegisterFile("metadata/metadatapb/rpc.proto", fileDescriptor_1d9ae5661e0dc3fc) } - -var fileDescriptor_1d9ae5661e0dc3fc = []byte{ - // 465 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xcd, 0x6e, 0x13, 0x31, - 0x10, 0x5e, 0xe7, 0x8f, 0x74, 0x02, 0x15, 0x32, 0x25, 0xa4, 0x0b, 0xdd, 0x44, 0x2b, 0x0e, 0x7b, - 0xca, 0xc2, 0xc2, 0x01, 0x71, 0x41, 0x8a, 0x04, 0xea, 0xa5, 0x12, 0x98, 0x0b, 0x02, 0xa1, 0xe2, - 0x14, 0x2b, 0x5d, 0xb1, 0xd9, 0x35, 0xf6, 0x04, 0x94, 0xb7, 0xe0, 0x19, 0x78, 0x04, 0x9e, 0x22, - 0xc7, 0x1e, 0x39, 0x55, 0x90, 0xdc, 0x78, 0x0a, 0x64, 0x7b, 0xb7, 0x34, 0xb0, 0x5c, 0x46, 0x33, - 0xf3, 0x7d, 0x9e, 0xf9, 0x3c, 0x1e, 0xc3, 0xc1, 0x5c, 0x20, 0x7f, 0xcf, 0x91, 0xc7, 0x95, 0x23, - 0xa7, 0xb1, 0x92, 0x27, 0x63, 0xa9, 0x0a, 0x2c, 0x68, 0x07, 0x4f, 0x79, 0x5e, 0x68, 0x7f, 0x5f, - 0x63, 0xa1, 0x44, 0x6c, 0xad, 0x9c, 0xc6, 0xb8, 0x94, 0x42, 0x3b, 0x8a, 0xbf, 0x37, 0x2b, 0x66, - 0x85, 0x75, 0x63, 0xe3, 0xb9, 0x6c, 0xf8, 0x95, 0xc0, 0xcd, 0x23, 0x81, 0x2a, 0x3d, 0x39, 0x2a, - 0xeb, 0x32, 0xf1, 0x71, 0x21, 0x34, 0xd2, 0x3e, 0x74, 0xe6, 0x16, 0x18, 0x90, 0x11, 0x89, 0x76, - 0x58, 0x19, 0xd1, 0x3d, 0x68, 0x67, 0xe9, 0x3c, 0xc5, 0x41, 0x63, 0x44, 0xa2, 0x36, 0x73, 0x01, - 0x7d, 0x03, 0xfb, 0x92, 0x2b, 0x4c, 0x79, 0x76, 0xac, 0x84, 0x96, 0x45, 0xae, 0xc5, 0xb1, 0x46, - 0xc5, 0x51, 0xcc, 0x96, 0x83, 0xe6, 0x88, 0x44, 0xbb, 0xc9, 0x70, 0xec, 0x44, 0x8e, 0x9f, 0x3b, - 0x22, 0x2b, 0x79, 0x2f, 0x4b, 0x1a, 0xbb, 0x25, 0xeb, 0x81, 0x10, 0xa1, 0xff, 0xb7, 0x46, 0xc7, - 0xa0, 0x0f, 0xa1, 0x5b, 0xcd, 0xc3, 0xca, 0xec, 0x25, 0xfd, 0xaa, 0xcb, 0xf6, 0x89, 0x43, 0x8f, - 0x5d, 0x30, 0xa9, 0x0f, 0x57, 0x3e, 0x73, 0x95, 0xa7, 0xf9, 0xcc, 0x5e, 0x62, 0xe7, 0xd0, 0x63, - 0x55, 0x62, 0xd2, 0x85, 0x8e, 0x12, 0x7a, 0x91, 0x61, 0xf8, 0x8d, 0xc0, 0xee, 0x76, 0x11, 0xfa, - 0x6c, 0xab, 0x5d, 0x33, 0xea, 0x25, 0x77, 0xeb, 0xdb, 0x8d, 0x2b, 0xe7, 0x69, 0x8e, 0x6a, 0x39, - 0x69, 0xad, 0xce, 0x87, 0x97, 0x04, 0xf8, 0xaf, 0xe0, 0xda, 0x16, 0x81, 0x5e, 0x87, 0xe6, 0x07, - 0xb1, 0x2c, 0x27, 0x6d, 0x5c, 0x7a, 0x1f, 0xda, 0x9f, 0x78, 0xb6, 0x10, 0x56, 0x61, 0x2f, 0xb9, - 0x5d, 0xdf, 0xc7, 0x9e, 0x66, 0x8e, 0xf9, 0xb8, 0xf1, 0x88, 0x84, 0x4f, 0xe0, 0x46, 0x0d, 0x83, - 0x46, 0xd0, 0x36, 0xcd, 0xf5, 0xa0, 0x61, 0x55, 0x5f, 0xbd, 0x54, 0x8d, 0x97, 0xea, 0x1c, 0x21, - 0x7c, 0x07, 0x2d, 0x93, 0xa4, 0x77, 0xa0, 0x65, 0xb6, 0xc7, 0x49, 0x9a, 0x74, 0x7f, 0x9d, 0x0f, - 0x6d, 0xcc, 0xac, 0x35, 0xe8, 0xa9, 0xc8, 0xa4, 0x1b, 0x9f, 0x43, 0x4d, 0xcc, 0xac, 0x35, 0xe8, - 0x22, 0x4f, 0xd1, 0xbe, 0x7b, 0x89, 0x9a, 0x98, 0x59, 0x9b, 0xbc, 0x85, 0xee, 0xc5, 0x40, 0x5f, - 0xfc, 0x33, 0xe2, 0x83, 0xfa, 0x8b, 0x96, 0x5b, 0xe9, 0x07, 0xff, 0x83, 0xdd, 0x42, 0xdc, 0x23, - 0x93, 0x68, 0xf5, 0x33, 0xf0, 0x56, 0xeb, 0x80, 0x9c, 0xad, 0x03, 0xf2, 0x63, 0x1d, 0x90, 0x2f, - 0x9b, 0xc0, 0x3b, 0xdb, 0x04, 0xde, 0xf7, 0x4d, 0xe0, 0xbd, 0x86, 0x3f, 0xdf, 0x67, 0xda, 0xb1, - 0x5f, 0xe0, 0xc1, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfa, 0x76, 0xe8, 0xa7, 0x5c, 0x03, 0x00, - 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MetadataClient is the client API for Metadata service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MetadataClient interface { - MetricMetadata(ctx context.Context, in *MetricMetadataRequest, opts ...grpc.CallOption) (Metadata_MetricMetadataClient, error) -} - -type metadataClient struct { - cc *grpc.ClientConn -} - -func NewMetadataClient(cc *grpc.ClientConn) MetadataClient { - return &metadataClient{cc} -} - -func (c *metadataClient) MetricMetadata(ctx context.Context, in *MetricMetadataRequest, opts ...grpc.CallOption) (Metadata_MetricMetadataClient, error) { - stream, err := c.cc.NewStream(ctx, &_Metadata_serviceDesc.Streams[0], "/thanos.Metadata/MetricMetadata", opts...) - if err != nil { - return nil, err - } - x := &metadataMetricMetadataClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Metadata_MetricMetadataClient interface { - Recv() (*MetricMetadataResponse, error) - grpc.ClientStream -} - -type metadataMetricMetadataClient struct { - grpc.ClientStream -} - -func (x *metadataMetricMetadataClient) Recv() (*MetricMetadataResponse, error) { - m := new(MetricMetadataResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil +type isMetricMetadataResponse_Result interface { + isMetricMetadataResponse_Result() } -// MetadataServer is the server API for Metadata service. -type MetadataServer interface { - MetricMetadata(*MetricMetadataRequest, Metadata_MetricMetadataServer) error +type MetricMetadataResponse_Metadata struct { + // / A collection of metric metadata entries. + Metadata *MetricMetadata `protobuf:"bytes,1,opt,name=metadata,proto3,oneof"` } -// UnimplementedMetadataServer can be embedded to have forward compatible implementations. -type UnimplementedMetadataServer struct { +type MetricMetadataResponse_Warning struct { + // / warning is considered an information piece in place of series for warning purposes. + // / It is used to warn metadata API users about suspicious cases or partial response (if enabled). + Warning string `protobuf:"bytes,2,opt,name=warning,proto3,oneof"` } -func (*UnimplementedMetadataServer) MetricMetadata(req *MetricMetadataRequest, srv Metadata_MetricMetadataServer) error { - return status.Errorf(codes.Unimplemented, "method MetricMetadata not implemented") -} +func (*MetricMetadataResponse_Metadata) isMetricMetadataResponse_Result() {} -func RegisterMetadataServer(s *grpc.Server, srv MetadataServer) { - s.RegisterService(&_Metadata_serviceDesc, srv) -} +func (*MetricMetadataResponse_Warning) isMetricMetadataResponse_Result() {} -func _Metadata_MetricMetadata_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(MetricMetadataRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(MetadataServer).MetricMetadata(m, &metadataMetricMetadataServer{stream}) -} +type MetricMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -type Metadata_MetricMetadataServer interface { - Send(*MetricMetadataResponse) error - grpc.ServerStream + Metadata map[string]*MetricMetadataEntry `protobuf:"bytes,1,rep,name=metadata,proto3" json:"metadata" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -type metadataMetricMetadataServer struct { - grpc.ServerStream +func (x *MetricMetadata) Reset() { + *x = MetricMetadata{} + mi := &file_metadata_metadatapb_rpc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (x *metadataMetricMetadataServer) Send(m *MetricMetadataResponse) error { - return x.ServerStream.SendMsg(m) +func (x *MetricMetadata) String() string { + return protoimpl.X.MessageStringOf(x) } -var _Metadata_serviceDesc = grpc.ServiceDesc{ - ServiceName: "thanos.Metadata", - HandlerType: (*MetadataServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "MetricMetadata", - Handler: _Metadata_MetricMetadata_Handler, - ServerStreams: true, - }, - }, - Metadata: "metadata/metadatapb/rpc.proto", -} +func (*MetricMetadata) ProtoMessage() {} -func (m *MetricMetadataRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *MetricMetadata) ProtoReflect() protoreflect.Message { + mi := &file_metadata_metadatapb_rpc_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return dAtA[:n], nil -} - -func (m *MetricMetadataRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return mi.MessageOf(x) } -func (m *MetricMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) - i-- - dAtA[i] = 0x18 - } - if m.Limit != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Limit)) - i-- - dAtA[i] = 0x10 - } - if len(m.Metric) > 0 { - i -= len(m.Metric) - copy(dAtA[i:], m.Metric) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Metric))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +// Deprecated: Use MetricMetadata.ProtoReflect.Descriptor instead. +func (*MetricMetadata) Descriptor() ([]byte, []int) { + return file_metadata_metadatapb_rpc_proto_rawDescGZIP(), []int{2} } -func (m *MetricMetadataResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *MetricMetadata) GetMetadata() map[string]*MetricMetadataEntry { + if x != nil { + return x.Metadata } - return dAtA[:n], nil -} - -func (m *MetricMetadataResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return nil } -func (m *MetricMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Result != nil { - { - size := m.Result.Size() - i -= size - if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} +type MetricMetadataEntry struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *MetricMetadataResponse_Metadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + Metas []*Meta `protobuf:"bytes,2,rep,name=metas,proto3" json:"metas"` } -func (m *MetricMetadataResponse_Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Metadata != nil { - { - size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *MetricMetadataResponse_Warning) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *MetricMetadataEntry) Reset() { + *x = MetricMetadataEntry{} + mi := &file_metadata_metadatapb_rpc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *MetricMetadataResponse_Warning) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.Warning) - copy(dAtA[i:], m.Warning) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Warning))) - i-- - dAtA[i] = 0x12 - return len(dAtA) - i, nil -} -func (m *MetricMetadata) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *MetricMetadataEntry) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MetricMetadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} +func (*MetricMetadataEntry) ProtoMessage() {} -func (m *MetricMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Metadata) > 0 { - for k := range m.Metadata { - v := m.Metadata[k] - baseI := i - { - size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintRpc(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintRpc(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa +func (x *MetricMetadataEntry) ProtoReflect() protoreflect.Message { + mi := &file_metadata_metadatapb_rpc_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - return len(dAtA) - i, nil -} - -func (m *MetricMetadataEntry) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *MetricMetadataEntry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use MetricMetadataEntry.ProtoReflect.Descriptor instead. +func (*MetricMetadataEntry) Descriptor() ([]byte, []int) { + return file_metadata_metadatapb_rpc_proto_rawDescGZIP(), []int{3} } -func (m *MetricMetadataEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Metas) > 0 { - for iNdEx := len(m.Metas) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Metas[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } +func (x *MetricMetadataEntry) GetMetas() []*Meta { + if x != nil { + return x.Metas } - return len(dAtA) - i, nil + return nil } -func (m *Meta) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} +type Meta struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Meta) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type"` + Help string `protobuf:"bytes,2,opt,name=help,proto3" json:"help"` + Unit string `protobuf:"bytes,3,opt,name=unit,proto3" json:"unit"` } -func (m *Meta) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Unit) > 0 { - i -= len(m.Unit) - copy(dAtA[i:], m.Unit) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Unit))) - i-- - dAtA[i] = 0x1a - } - if len(m.Help) > 0 { - i -= len(m.Help) - copy(dAtA[i:], m.Help) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Help))) - i-- - dAtA[i] = 0x12 - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +func (x *Meta) Reset() { + *x = Meta{} + mi := &file_metadata_metadatapb_rpc_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func encodeVarintRpc(dAtA []byte, offset int, v uint64) int { - offset -= sovRpc(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MetricMetadataRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Metric) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.Limit != 0 { - n += 1 + sovRpc(uint64(m.Limit)) - } - if m.PartialResponseStrategy != 0 { - n += 1 + sovRpc(uint64(m.PartialResponseStrategy)) - } - return n +func (x *Meta) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MetricMetadataResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Result != nil { - n += m.Result.Size() - } - return n -} +func (*Meta) ProtoMessage() {} -func (m *MetricMetadataResponse_Metadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Metadata != nil { - l = m.Metadata.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *MetricMetadataResponse_Warning) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Warning) - n += 1 + l + sovRpc(uint64(l)) - return n -} -func (m *MetricMetadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Metadata) > 0 { - for k, v := range m.Metadata { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovRpc(uint64(len(k))) + 1 + l + sovRpc(uint64(l)) - n += mapEntrySize + 1 + sovRpc(uint64(mapEntrySize)) +func (x *Meta) ProtoReflect() protoreflect.Message { + mi := &file_metadata_metadatapb_rpc_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - return n + return mi.MessageOf(x) } -func (m *MetricMetadataEntry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Metas) > 0 { - for _, e := range m.Metas { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n +// Deprecated: Use Meta.ProtoReflect.Descriptor instead. +func (*Meta) Descriptor() ([]byte, []int) { + return file_metadata_metadatapb_rpc_proto_rawDescGZIP(), []int{4} } -func (m *Meta) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Type) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Help) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) +func (x *Meta) GetType() string { + if x != nil { + return x.Type } - l = len(m.Unit) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func sovRpc(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRpc(x uint64) (n int) { - return sovRpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + return "" } -func (m *MetricMetadataRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MetricMetadataRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MetricMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metric", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Metric = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) - } - m.Limit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Limit |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) - } - m.PartialResponseStrategy = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PartialResponseStrategy |= storepb.PartialResponseStrategy(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *Meta) GetHelp() string { + if x != nil { + return x.Help } - return nil + return "" } -func (m *MetricMetadataResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MetricMetadataResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MetricMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &MetricMetadata{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Result = &MetricMetadataResponse_Metadata{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Warning", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Result = &MetricMetadataResponse_Warning{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *Meta) GetUnit() string { + if x != nil { + return x.Unit } - return nil + return "" } -func (m *MetricMetadata) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MetricMetadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MetricMetadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Metadata == nil { - m.Metadata = make(map[string]MetricMetadataEntry) - } - var mapkey string - mapvalue := &MetricMetadataEntry{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthRpc - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthRpc - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthRpc - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthRpc - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &MetricMetadataEntry{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Metadata[mapkey] = *mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +var File_metadata_metadatapb_rpc_proto protoreflect.FileDescriptor + +var file_metadata_metadatapb_rpc_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x70, 0x62, 0x2f, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x06, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x1a, 0x19, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x13, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2f, 0x74, 0x61, 0x67, 0x67, 0x65, + 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2, 0x01, 0x0a, 0x15, 0x4d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x5b, 0x0a, 0x19, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x50, 0x61, 0x72, 0x74, + 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x72, 0x61, 0x74, + 0x65, 0x67, 0x79, 0x52, 0x17, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x22, 0x74, 0x0a, 0x16, + 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, + 0x73, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x48, 0x00, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x07, + 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, + 0x07, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x22, 0xc2, 0x01, 0x0a, 0x0e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x56, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, + 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x14, 0x9a, + 0x84, 0x9e, 0x03, 0x0f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x22, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x58, 0x0a, + 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x4c, 0x0a, 0x13, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x35, + 0x0a, 0x05, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, + 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x11, 0x9a, 0x84, 0x9e, + 0x03, 0x0c, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x22, 0x52, 0x05, + 0x6d, 0x65, 0x74, 0x61, 0x73, 0x22, 0x78, 0x0a, 0x04, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x24, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0x9a, 0x84, 0x9e, + 0x03, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x10, 0x9a, 0x84, 0x9e, 0x03, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x68, 0x65, + 0x6c, 0x70, 0x22, 0x52, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x12, 0x24, 0x0a, 0x04, 0x75, 0x6e, 0x69, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0x9a, 0x84, 0x9e, 0x03, 0x0b, 0x6a, 0x73, + 0x6f, 0x6e, 0x3a, 0x22, 0x75, 0x6e, 0x69, 0x74, 0x22, 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x32, + 0x5d, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x51, 0x0a, 0x0e, 0x4d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x2e, + 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x74, + 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, 0x35, + 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x68, 0x61, + 0x6e, 0x6f, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2f, 0x70, 0x6b, + 0x67, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -func (m *MetricMetadataEntry) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MetricMetadataEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MetricMetadataEntry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metas", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Metas = append(m.Metas, Meta{}) - if err := m.Metas[len(m.Metas)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Meta) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Meta: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Meta: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Help", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Help = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Unit", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Unit = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +var ( + file_metadata_metadatapb_rpc_proto_rawDescOnce sync.Once + file_metadata_metadatapb_rpc_proto_rawDescData = file_metadata_metadatapb_rpc_proto_rawDesc +) - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRpc(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthRpc - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRpc - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRpc - } - if depth == 0 { - return iNdEx, nil - } +func file_metadata_metadatapb_rpc_proto_rawDescGZIP() []byte { + file_metadata_metadatapb_rpc_proto_rawDescOnce.Do(func() { + file_metadata_metadatapb_rpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_metadata_metadatapb_rpc_proto_rawDescData) + }) + return file_metadata_metadatapb_rpc_proto_rawDescData +} + +var file_metadata_metadatapb_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_metadata_metadatapb_rpc_proto_goTypes = []any{ + (*MetricMetadataRequest)(nil), // 0: thanos.MetricMetadataRequest + (*MetricMetadataResponse)(nil), // 1: thanos.MetricMetadataResponse + (*MetricMetadata)(nil), // 2: thanos.MetricMetadata + (*MetricMetadataEntry)(nil), // 3: thanos.MetricMetadataEntry + (*Meta)(nil), // 4: thanos.Meta + nil, // 5: thanos.MetricMetadata.MetadataEntry + (storepb.PartialResponseStrategy)(0), // 6: thanos.PartialResponseStrategy +} +var file_metadata_metadatapb_rpc_proto_depIdxs = []int32{ + 6, // 0: thanos.MetricMetadataRequest.partial_response_strategy:type_name -> thanos.PartialResponseStrategy + 2, // 1: thanos.MetricMetadataResponse.metadata:type_name -> thanos.MetricMetadata + 5, // 2: thanos.MetricMetadata.metadata:type_name -> thanos.MetricMetadata.MetadataEntry + 4, // 3: thanos.MetricMetadataEntry.metas:type_name -> thanos.Meta + 3, // 4: thanos.MetricMetadata.MetadataEntry.value:type_name -> thanos.MetricMetadataEntry + 0, // 5: thanos.Metadata.MetricMetadata:input_type -> thanos.MetricMetadataRequest + 1, // 6: thanos.Metadata.MetricMetadata:output_type -> thanos.MetricMetadataResponse + 6, // [6:7] is the sub-list for method output_type + 5, // [5:6] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_metadata_metadatapb_rpc_proto_init() } +func file_metadata_metadatapb_rpc_proto_init() { + if File_metadata_metadatapb_rpc_proto != nil { + return + } + file_metadata_metadatapb_rpc_proto_msgTypes[1].OneofWrappers = []any{ + (*MetricMetadataResponse_Metadata)(nil), + (*MetricMetadataResponse_Warning)(nil), } - return 0, io.ErrUnexpectedEOF + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_metadata_metadatapb_rpc_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_metadata_metadatapb_rpc_proto_goTypes, + DependencyIndexes: file_metadata_metadatapb_rpc_proto_depIdxs, + MessageInfos: file_metadata_metadatapb_rpc_proto_msgTypes, + }.Build() + File_metadata_metadatapb_rpc_proto = out.File + file_metadata_metadatapb_rpc_proto_rawDesc = nil + file_metadata_metadatapb_rpc_proto_goTypes = nil + file_metadata_metadatapb_rpc_proto_depIdxs = nil } - -var ( - ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRpc = fmt.Errorf("proto: unexpected end of group") -) diff --git a/pkg/metadata/metadatapb/rpc.proto b/pkg/metadata/metadatapb/rpc.proto index 96ff3506341..847993a5be2 100644 --- a/pkg/metadata/metadatapb/rpc.proto +++ b/pkg/metadata/metadatapb/rpc.proto @@ -5,20 +5,9 @@ syntax = "proto3"; package thanos; import "store/storepb/types.proto"; -import "gogoproto/gogo.proto"; +import "tagger/tagger.proto"; -option go_package = "metadatapb"; - -option (gogoproto.sizer_all) = true; -option (gogoproto.marshaler_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; +option go_package = "github.com/thanos-io/thanos/pkg/metadata/metadatapb"; service Metadata { rpc MetricMetadata(MetricMetadataRequest) returns (stream MetricMetadataResponse); @@ -42,15 +31,15 @@ message MetricMetadataResponse { } message MetricMetadata { - map metadata = 1 [(gogoproto.nullable) = false]; + map metadata = 1 [(tagger.tags) = "json:\"metadata\""]; } message MetricMetadataEntry { - repeated Meta metas = 2 [(gogoproto.nullable) = false]; + repeated Meta metas = 2 [(tagger.tags) = "json:\"metas\""]; } message Meta { - string type = 1 [(gogoproto.jsontag) = "type"]; - string help = 2 [(gogoproto.jsontag) = "help"]; - string unit = 3 [(gogoproto.jsontag) = "unit"]; + string type = 1 [(tagger.tags) = "json:\"type\""]; + string help = 2 [(tagger.tags) = "json:\"help\""]; + string unit = 3 [(tagger.tags) = "json:\"unit\""]; } diff --git a/pkg/metadata/metadatapb/rpc_grpc.pb.go b/pkg/metadata/metadatapb/rpc_grpc.pb.go new file mode 100644 index 00000000000..de376e2b8a8 --- /dev/null +++ b/pkg/metadata/metadatapb/rpc_grpc.pb.go @@ -0,0 +1,128 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v3.20.1 +// source: metadata/metadatapb/rpc.proto + +package metadatapb + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Metadata_MetricMetadata_FullMethodName = "/thanos.Metadata/MetricMetadata" +) + +// MetadataClient is the client API for Metadata service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MetadataClient interface { + MetricMetadata(ctx context.Context, in *MetricMetadataRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[MetricMetadataResponse], error) +} + +type metadataClient struct { + cc grpc.ClientConnInterface +} + +func NewMetadataClient(cc grpc.ClientConnInterface) MetadataClient { + return &metadataClient{cc} +} + +func (c *metadataClient) MetricMetadata(ctx context.Context, in *MetricMetadataRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[MetricMetadataResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &Metadata_ServiceDesc.Streams[0], Metadata_MetricMetadata_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[MetricMetadataRequest, MetricMetadataResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Metadata_MetricMetadataClient = grpc.ServerStreamingClient[MetricMetadataResponse] + +// MetadataServer is the server API for Metadata service. +// All implementations must embed UnimplementedMetadataServer +// for forward compatibility. +type MetadataServer interface { + MetricMetadata(*MetricMetadataRequest, grpc.ServerStreamingServer[MetricMetadataResponse]) error + mustEmbedUnimplementedMetadataServer() +} + +// UnimplementedMetadataServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMetadataServer struct{} + +func (UnimplementedMetadataServer) MetricMetadata(*MetricMetadataRequest, grpc.ServerStreamingServer[MetricMetadataResponse]) error { + return status.Errorf(codes.Unimplemented, "method MetricMetadata not implemented") +} +func (UnimplementedMetadataServer) mustEmbedUnimplementedMetadataServer() {} +func (UnimplementedMetadataServer) testEmbeddedByValue() {} + +// UnsafeMetadataServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MetadataServer will +// result in compilation errors. +type UnsafeMetadataServer interface { + mustEmbedUnimplementedMetadataServer() +} + +func RegisterMetadataServer(s grpc.ServiceRegistrar, srv MetadataServer) { + // If the following call pancis, it indicates UnimplementedMetadataServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Metadata_ServiceDesc, srv) +} + +func _Metadata_MetricMetadata_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(MetricMetadataRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(MetadataServer).MetricMetadata(m, &grpc.GenericServerStream[MetricMetadataRequest, MetricMetadataResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Metadata_MetricMetadataServer = grpc.ServerStreamingServer[MetricMetadataResponse] + +// Metadata_ServiceDesc is the grpc.ServiceDesc for Metadata service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Metadata_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "thanos.Metadata", + HandlerType: (*MetadataServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "MetricMetadata", + Handler: _Metadata_MetricMetadata_Handler, + ServerStreams: true, + }, + }, + Metadata: "metadata/metadatapb/rpc.proto", +} diff --git a/pkg/metadata/metadatapb/rpc_vtproto.pb.go b/pkg/metadata/metadatapb/rpc_vtproto.pb.go new file mode 100644 index 00000000000..8c3bb2cc564 --- /dev/null +++ b/pkg/metadata/metadatapb/rpc_vtproto.pb.go @@ -0,0 +1,1343 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.1-0.20250313105119-ba97887b0a25 +// source: metadata/metadatapb/rpc.proto + +package metadatapb + +import ( + fmt "fmt" + io "io" + + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + storepb "github.com/thanos-io/thanos/pkg/store/storepb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *MetricMetadataRequest) CloneVT() *MetricMetadataRequest { + if m == nil { + return (*MetricMetadataRequest)(nil) + } + r := new(MetricMetadataRequest) + r.Metric = m.Metric + r.Limit = m.Limit + r.PartialResponseStrategy = m.PartialResponseStrategy + return r +} + +func (m *MetricMetadataRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *MetricMetadataResponse) CloneVT() *MetricMetadataResponse { + if m == nil { + return (*MetricMetadataResponse)(nil) + } + r := new(MetricMetadataResponse) + if m.Result != nil { + r.Result = m.Result.(interface { + CloneVT() isMetricMetadataResponse_Result + }).CloneVT() + } + return r +} + +func (m *MetricMetadataResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *MetricMetadataResponse_Metadata) CloneVT() isMetricMetadataResponse_Result { + if m == nil { + return (*MetricMetadataResponse_Metadata)(nil) + } + r := new(MetricMetadataResponse_Metadata) + r.Metadata = m.Metadata.CloneVT() + return r +} + +func (m *MetricMetadataResponse_Warning) CloneVT() isMetricMetadataResponse_Result { + if m == nil { + return (*MetricMetadataResponse_Warning)(nil) + } + r := new(MetricMetadataResponse_Warning) + r.Warning = m.Warning + return r +} + +func (m *MetricMetadata) CloneVT() *MetricMetadata { + if m == nil { + return (*MetricMetadata)(nil) + } + r := new(MetricMetadata) + if rhs := m.Metadata; rhs != nil { + tmpContainer := make(map[string]*MetricMetadataEntry, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Metadata = tmpContainer + } + return r +} + +func (m *MetricMetadata) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *MetricMetadataEntry) CloneVT() *MetricMetadataEntry { + if m == nil { + return (*MetricMetadataEntry)(nil) + } + r := new(MetricMetadataEntry) + if rhs := m.Metas; rhs != nil { + tmpContainer := make([]*Meta, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Metas = tmpContainer + } + return r +} + +func (m *MetricMetadataEntry) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Meta) CloneVT() *Meta { + if m == nil { + return (*Meta)(nil) + } + r := new(Meta) + r.Type = m.Type + r.Help = m.Help + r.Unit = m.Unit + return r +} + +func (m *Meta) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *MetricMetadataRequest) EqualVT(that *MetricMetadataRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Metric != that.Metric { + return false + } + if this.Limit != that.Limit { + return false + } + if this.PartialResponseStrategy != that.PartialResponseStrategy { + return false + } + return true +} + +func (this *MetricMetadataRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*MetricMetadataRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *MetricMetadataResponse) EqualVT(that *MetricMetadataResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Result == nil && that.Result != nil { + return false + } else if this.Result != nil { + if that.Result == nil { + return false + } + if !this.Result.(interface { + EqualVT(isMetricMetadataResponse_Result) bool + }).EqualVT(that.Result) { + return false + } + } + return true +} + +func (this *MetricMetadataResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*MetricMetadataResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *MetricMetadataResponse_Metadata) EqualVT(thatIface isMetricMetadataResponse_Result) bool { + that, ok := thatIface.(*MetricMetadataResponse_Metadata) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Metadata, that.Metadata; p != q { + if p == nil { + p = &MetricMetadata{} + } + if q == nil { + q = &MetricMetadata{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *MetricMetadataResponse_Warning) EqualVT(thatIface isMetricMetadataResponse_Result) bool { + that, ok := thatIface.(*MetricMetadataResponse_Warning) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.Warning != that.Warning { + return false + } + return true +} + +func (this *MetricMetadata) EqualVT(that *MetricMetadata) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Metadata) != len(that.Metadata) { + return false + } + for i, vx := range this.Metadata { + vy, ok := that.Metadata[i] + if !ok { + return false + } + if p, q := vx, vy; p != q { + if p == nil { + p = &MetricMetadataEntry{} + } + if q == nil { + q = &MetricMetadataEntry{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *MetricMetadata) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*MetricMetadata) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *MetricMetadataEntry) EqualVT(that *MetricMetadataEntry) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Metas) != len(that.Metas) { + return false + } + for i, vx := range this.Metas { + vy := that.Metas[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Meta{} + } + if q == nil { + q = &Meta{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *MetricMetadataEntry) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*MetricMetadataEntry) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Meta) EqualVT(that *Meta) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Type != that.Type { + return false + } + if this.Help != that.Help { + return false + } + if this.Unit != that.Unit { + return false + } + return true +} + +func (this *Meta) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Meta) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *MetricMetadataRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MetricMetadataRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MetricMetadataRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.PartialResponseStrategy != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PartialResponseStrategy)) + i-- + dAtA[i] = 0x18 + } + if m.Limit != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x10 + } + if len(m.Metric) > 0 { + i -= len(m.Metric) + copy(dAtA[i:], m.Metric) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Metric))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MetricMetadataResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MetricMetadataResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MetricMetadataResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if vtmsg, ok := m.Result.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *MetricMetadataResponse_Metadata) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MetricMetadataResponse_Metadata) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Metadata != nil { + size, err := m.Metadata.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *MetricMetadataResponse_Warning) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MetricMetadataResponse_Warning) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Warning) + copy(dAtA[i:], m.Warning) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Warning))) + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil +} +func (m *MetricMetadata) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MetricMetadata) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MetricMetadata) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Metadata) > 0 { + for k := range m.Metadata { + v := m.Metadata[k] + baseI := i + size, err := v.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MetricMetadataEntry) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MetricMetadataEntry) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MetricMetadataEntry) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Metas) > 0 { + for iNdEx := len(m.Metas) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Metas[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + return len(dAtA) - i, nil +} + +func (m *Meta) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Meta) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Meta) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Unit) > 0 { + i -= len(m.Unit) + copy(dAtA[i:], m.Unit) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Unit))) + i-- + dAtA[i] = 0x1a + } + if len(m.Help) > 0 { + i -= len(m.Help) + copy(dAtA[i:], m.Help) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Help))) + i-- + dAtA[i] = 0x12 + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MetricMetadataRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Metric) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Limit != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Limit)) + } + if m.PartialResponseStrategy != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PartialResponseStrategy)) + } + return n +} + +func (m *MetricMetadataResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Result.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + return n +} + +func (m *MetricMetadataResponse_Metadata) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *MetricMetadataResponse_Warning) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Warning) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return n +} +func (m *MetricMetadata) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + l = 0 + if v != nil { + l = v.SizeVT() + } + l += 1 + protohelpers.SizeOfVarint(uint64(l)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + return n +} + +func (m *MetricMetadataEntry) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Metas) > 0 { + for _, e := range m.Metas { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *Meta) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Help) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Unit) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *MetricMetadataRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MetricMetadataRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MetricMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metric", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metric = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) + } + m.PartialResponseStrategy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PartialResponseStrategy |= storepb.PartialResponseStrategy(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MetricMetadataResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MetricMetadataResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MetricMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Result.(*MetricMetadataResponse_Metadata); ok { + if err := oneof.Metadata.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &MetricMetadata{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Result = &MetricMetadataResponse_Metadata{Metadata: v} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Warning", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Result = &MetricMetadataResponse_Warning{Warning: string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MetricMetadata) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MetricMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MetricMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]*MetricMetadataEntry) + } + var mapkey string + var mapvalue *MetricMetadataEntry + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return protohelpers.ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &MetricMetadataEntry{} + if err := mapvalue.UnmarshalVT(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MetricMetadataEntry) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MetricMetadataEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MetricMetadataEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metas", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metas = append(m.Metas, &Meta{}) + if err := m.Metas[len(m.Metas)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Meta) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Meta: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Meta: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Help", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Help = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Unit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Unit = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pkg/metadata/prometheus.go b/pkg/metadata/prometheus.go index 5640cca8e8e..b22f31038db 100644 --- a/pkg/metadata/prometheus.go +++ b/pkg/metadata/prometheus.go @@ -14,6 +14,8 @@ import ( // Prometheus implements metadatapb.Metadata gRPC service that allows to fetch metric metadata from Prometheus HTTP /api/v1/metadata endpoint. type Prometheus struct { + metadatapb.UnimplementedMetadataServer + base *url.URL client *promclient.Client } diff --git a/pkg/metadata/prometheus_test.go b/pkg/metadata/prometheus_test.go index be056968885..e4424eb8e20 100644 --- a/pkg/metadata/prometheus_test.go +++ b/pkg/metadata/prometheus_test.go @@ -73,27 +73,27 @@ scrape_configs: name string metric string limit int32 - expectedFunc func(map[string][]metadatapb.Meta) bool + expectedFunc func(map[string][]*metadatapb.Meta) bool }{ { name: "all metadata return", limit: -1, // We just check two metrics here. - expectedFunc: func(m map[string][]metadatapb.Meta) bool { + expectedFunc: func(m map[string][]*metadatapb.Meta) bool { return len(m["prometheus_build_info"]) > 0 && len(m["prometheus_engine_query_duration_seconds"]) > 0 }, }, { name: "no metadata return", limit: 0, - expectedFunc: func(m map[string][]metadatapb.Meta) bool { + expectedFunc: func(m map[string][]*metadatapb.Meta) bool { return len(m) == 0 }, }, { name: "only 1 metadata return", limit: 1, - expectedFunc: func(m map[string][]metadatapb.Meta) bool { + expectedFunc: func(m map[string][]*metadatapb.Meta) bool { return len(m) == 1 }, }, @@ -101,7 +101,7 @@ scrape_configs: name: "only prometheus_build_info metadata return", metric: "prometheus_build_info", limit: 1, - expectedFunc: func(m map[string][]metadatapb.Meta) bool { + expectedFunc: func(m map[string][]*metadatapb.Meta) bool { return len(m) == 1 && len(m["prometheus_build_info"]) > 0 }, }, diff --git a/pkg/metadata/proxy.go b/pkg/metadata/proxy.go index 46fb6568bfc..1ecf8cc88af 100644 --- a/pkg/metadata/proxy.go +++ b/pkg/metadata/proxy.go @@ -22,6 +22,8 @@ import ( // Proxy implements metadatapb.Metadata gRPC that fanouts requests to given metadatapb.Metadata and deduplication on the way. type Proxy struct { + metadatapb.UnimplementedMetadataServer + logger log.Logger metadata func() []metadatapb.MetadataClient } diff --git a/pkg/promclient/promclient.go b/pkg/promclient/promclient.go index dcb4d80b3bd..63edde3aaf6 100644 --- a/pkg/promclient/promclient.go +++ b/pkg/promclient/promclient.go @@ -39,6 +39,7 @@ import ( "github.com/thanos-io/thanos/pkg/metadata/metadatapb" "github.com/thanos-io/thanos/pkg/rules/rulespb" "github.com/thanos-io/thanos/pkg/runutil" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" "github.com/thanos-io/thanos/pkg/targets/targetspb" "github.com/thanos-io/thanos/pkg/tracing" @@ -180,7 +181,7 @@ func IsDirAccessible(dir string) error { // ExternalLabels returns sorted external labels from /api/v1/status/config Prometheus endpoint. // Note that configuration can be hot reloadable on Prometheus, so this config might change in runtime. -func (c *Client) ExternalLabels(ctx context.Context, base *url.URL) (labels.Labels, error) { +func (c *Client) ExternalLabels(ctx context.Context, base *url.URL) (labelpb.Labels, error) { u := *base u.Path = path.Join(u.Path, "/api/v1/status/config") @@ -189,7 +190,7 @@ func (c *Client) ExternalLabels(ctx context.Context, base *url.URL) (labels.Labe body, _, err := c.req2xx(ctx, &u, http.MethodGet, nil) if err != nil { - return labels.EmptyLabels(), err + return nil, err } var d struct { Data struct { @@ -197,7 +198,7 @@ func (c *Client) ExternalLabels(ctx context.Context, base *url.URL) (labels.Labe } `json:"data"` } if err := json.Unmarshal(body, &d); err != nil { - return labels.EmptyLabels(), errors.Wrapf(err, "unmarshal response: %v", string(body)) + return nil, errors.Wrapf(err, "unmarshal response: %v", string(body)) } var cfg struct { GlobalConfig struct { @@ -205,10 +206,10 @@ func (c *Client) ExternalLabels(ctx context.Context, base *url.URL) (labels.Labe } `yaml:"global"` } if err := yaml.Unmarshal([]byte(d.Data.YAML), &cfg); err != nil { - return labels.EmptyLabels(), errors.Wrapf(err, "parse Prometheus config: %v", d.Data.YAML) + return nil, errors.Wrapf(err, "parse Prometheus config: %v", d.Data.YAML) } - return labels.FromMap(cfg.GlobalConfig.ExternalLabels), nil + return labelpb.FromMap(cfg.GlobalConfig.ExternalLabels), nil } type Flags struct { @@ -890,7 +891,7 @@ func (c *Client) AlertsInGRPC(ctx context.Context, base *url.URL) ([]*rulespb.Al } // MetricMetadataInGRPC returns the metadata from Prometheus metric metadata API. It uses gRPC errors. -func (c *Client) MetricMetadataInGRPC(ctx context.Context, base *url.URL, metric string, limit int) (map[string][]metadatapb.Meta, error) { +func (c *Client) MetricMetadataInGRPC(ctx context.Context, base *url.URL, metric string, limit int) (map[string][]*metadatapb.Meta, error) { u := *base u.Path = path.Join(u.Path, "/api/v1/metadata") q := u.Query() @@ -906,7 +907,7 @@ func (c *Client) MetricMetadataInGRPC(ctx context.Context, base *url.URL, metric u.RawQuery = q.Encode() var v struct { - Data map[string][]metadatapb.Meta `json:"data"` + Data map[string][]*metadatapb.Meta `json:"data"` } return v.Data, c.get2xxResultWithGRPCErrors(ctx, "/prom_metric_metadata HTTP[client]", &u, &v) } diff --git a/pkg/promclient/promclient_e2e_test.go b/pkg/promclient/promclient_e2e_test.go index 409f1e51488..63f28e1500d 100644 --- a/pkg/promclient/promclient_e2e_test.go +++ b/pkg/promclient/promclient_e2e_test.go @@ -59,7 +59,7 @@ func TestExternalLabels_e2e(t *testing.T) { ext, err := NewDefaultClient().ExternalLabels(context.Background(), u) testutil.Ok(t, err) - testutil.Equals(t, 2, ext.Len()) + testutil.Equals(t, 2, len(ext)) testutil.Equals(t, "eu-west", ext.Get("region")) testutil.Equals(t, "1", ext.Get("az")) }) diff --git a/pkg/promclient/promclient_test.go b/pkg/promclient/promclient_test.go index 00173d3302b..cbe57b5172d 100644 --- a/pkg/promclient/promclient_test.go +++ b/pkg/promclient/promclient_test.go @@ -58,7 +58,7 @@ func TestExternalLabels(t *testing.T) { } testutil.Ok(t, err) - testutil.Equals(t, len(tc.labels), ext.Len()) + testutil.Equals(t, len(tc.labels), len(ext)) for k, v := range tc.labels { testutil.Equals(t, v, ext.Get(k)) } diff --git a/pkg/query/endpointset.go b/pkg/query/endpointset.go index 02c9f096b4d..31fed12ccc0 100644 --- a/pkg/query/endpointset.go +++ b/pkg/query/endpointset.go @@ -142,7 +142,7 @@ type EndpointStatus struct { Name string `json:"name"` LastCheck time.Time `json:"lastCheck"` LastError *stringError `json:"lastError"` - LabelSets []labels.Labels `json:"labelSets"` + LabelSets []labelpb.Labels `json:"labelSets"` ComponentType component.Component `json:"-"` MinTime int64 `json:"minTime"` MaxTime int64 `json:"maxTime"` @@ -426,7 +426,7 @@ func (e *EndpointSet) Update(ctx context.Context) { e.endpointsMtx.Lock() defer e.endpointsMtx.Unlock() for addr, er := range newRefs { - extLset := labelpb.PromLabelSetsToString(er.LabelSets()) + extLset := labelpb.LabelSetsToString(er.LabelSets()) level.Info(e.logger).Log("msg", fmt.Sprintf("adding new %v with %+v", er.ComponentType(), er.apisPresent()), "group_key", er.groupKey, "replica_key", er.replicaKey, "address", addr, "extLset", extLset) @@ -434,7 +434,7 @@ func (e *EndpointSet) Update(ctx context.Context) { } for addr, er := range staleRefs { level.Info(er.logger).Log("msg", unhealthyEndpointMessage, "address", er.addr, - "extLset", labelpb.PromLabelSetsToString(er.LabelSets()), + "extLset", labelpb.LabelSetsToString(er.LabelSets()), "group_key", er.groupKey, "replica_key", er.replicaKey) er.Close() delete(e.endpoints, addr) @@ -456,7 +456,7 @@ func (e *EndpointSet) Update(ctx context.Context) { continue } - extLset := labelpb.PromLabelSetsToString(er.LabelSets()) + extLset := labelpb.LabelSetsToString(er.LabelSets()) // All producers that expose StoreAPI should have unique external labels. Check all which connect to our Querier. if er.HasStoreAPI() && (er.ComponentType() == component.Sidecar || er.ComponentType() == component.Rule) && @@ -615,9 +615,13 @@ func (e *EndpointSet) GetExemplarsStores() []*exemplarspb.ExemplarStore { exemplarStores := make([]*exemplarspb.ExemplarStore, 0, len(endpoints)) for _, er := range endpoints { if er.HasExemplarsAPI() { + lsets := make([]labelpb.Labels, 0, len(er.metadata.LabelSets)) + for _, ls := range er.metadata.LabelSets { + lsets = append(lsets, ls.GetLabels()) + } exemplarStores = append(exemplarStores, &exemplarspb.ExemplarStore{ ExemplarsClient: exemplarspb.NewExemplarsClient(er.cc), - LabelSets: labelpb.ZLabelSetsToPromLabelSets(er.metadata.LabelSets...), + LabelSets: lsets, }) } } @@ -817,24 +821,25 @@ func (er *endpointRef) HasExemplarsAPI() bool { return er.metadata != nil && er.metadata.Exemplars != nil } -func (er *endpointRef) LabelSets() []labels.Labels { +func (er *endpointRef) LabelSets() []labelpb.Labels { er.mtx.RLock() defer er.mtx.RUnlock() return er.status.LabelSets } -func (er *endpointRef) labelSets() []labels.Labels { +func (er *endpointRef) labelSets() []labelpb.Labels { if er.metadata == nil { - return make([]labels.Labels, 0) + return nil } - labelSet := make([]labels.Labels, 0, len(er.metadata.LabelSets)) - for _, ls := range labelpb.ZLabelSetsToPromLabelSets(er.metadata.LabelSets...) { - if ls.Len() == 0 { + labelSet := make([]labelpb.Labels, 0, len(er.metadata.LabelSets)) + for _, ls := range er.metadata.LabelSets { + lbls := ls.GetLabels() + if len(lbls) == 0 { continue } - labelSet = append(labelSet, ls.Copy()) + labelSet = append(labelSet, labelpb.Labels(lbls).Copy()) } return labelSet } @@ -846,7 +851,7 @@ func (er *endpointRef) TimeRange() (mint, maxt int64) { return er.timeRange() } -func (er *endpointRef) TSDBInfos() []infopb.TSDBInfo { +func (er *endpointRef) TSDBInfos() []*infopb.TSDBInfo { er.mtx.RLock() defer er.mtx.RUnlock() @@ -921,7 +926,7 @@ func (er *endpointRef) String() string { mint, maxt := er.TimeRange() return fmt.Sprintf( "Addr: %s LabelSets: %v MinTime: %d MaxTime: %d", - er.addr, labelpb.PromLabelSetsToString(er.LabelSets()), mint, maxt, + er.addr, labelpb.LabelSetsToString(er.LabelSets()), mint, maxt, ) } diff --git a/pkg/query/endpointset_test.go b/pkg/query/endpointset_test.go index 04a4033a0d2..7cc1fe2ceab 100644 --- a/pkg/query/endpointset_test.go +++ b/pkg/query/endpointset_test.go @@ -22,7 +22,6 @@ import ( "google.golang.org/grpc/credentials/insecure" promtestutil "github.com/prometheus/client_golang/prometheus/testutil" - "github.com/prometheus/prometheus/model/labels" "github.com/thanos-io/thanos/pkg/component" "github.com/thanos-io/thanos/pkg/info/infopb" @@ -84,6 +83,8 @@ var ( ) type mockedEndpoint struct { + infopb.UnimplementedInfoServer + infoDelay time.Duration info infopb.InfoResponse err error @@ -117,7 +118,7 @@ type APIs struct { type testEndpointMeta struct { *infopb.InfoResponse - extlsetFn func(addr string) []labelpb.ZLabelSet + extlsetFn func(addr string) []*labelpb.LabelSet infoDelay time.Duration err error } @@ -269,10 +270,8 @@ func TestEndpointSetUpdate(t *testing.T) { endpoints: []testEndpointMeta{ { InfoResponse: sidecarInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return labelpb.ZLabelSetsFromPromLabels( - labels.FromStrings("addr", addr, "a", "b"), - ) + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{labelpb.LabelSetFromStrings("addr", addr, "a", "b")} }, }, }, @@ -296,10 +295,8 @@ func TestEndpointSetUpdate(t *testing.T) { { err: fmt.Errorf("endpoint unavailable"), InfoResponse: sidecarInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return labelpb.ZLabelSetsFromPromLabels( - labels.FromStrings("addr", addr, "a", "b"), - ) + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{labelpb.LabelSetFromStrings("addr", addr, "a", "b")} }, }, }, @@ -313,10 +310,8 @@ func TestEndpointSetUpdate(t *testing.T) { { infoDelay: 5 * time.Second, InfoResponse: sidecarInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return labelpb.ZLabelSetsFromPromLabels( - labels.FromStrings("addr", addr, "a", "b"), - ) + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{labelpb.LabelSetFromStrings("addr", addr, "a", "b")} }, }, }, @@ -329,10 +324,8 @@ func TestEndpointSetUpdate(t *testing.T) { endpoints: []testEndpointMeta{ { InfoResponse: sidecarInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return labelpb.ZLabelSetsFromPromLabels( - labels.FromStrings("addr", addr, "a", "b"), - ) + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{labelpb.LabelSetFromStrings("addr", addr, "a", "b")} }, }, }, @@ -356,15 +349,13 @@ func TestEndpointSetUpdate(t *testing.T) { { InfoResponse: sidecarInfo, // Simulate very long external labels. - extlsetFn: func(addr string) []labelpb.ZLabelSet { + extlsetFn: func(addr string) []*labelpb.LabelSet { sLabel := []string{} for i := 0; i < 1000; i++ { sLabel = append(sLabel, "lbl") sLabel = append(sLabel, "val") } - return labelpb.ZLabelSetsFromPromLabels( - labels.FromStrings(sLabel...), - ) + return []*labelpb.LabelSet{labelpb.LabelSetFromStrings(sLabel...)} }, }, }, @@ -407,10 +398,8 @@ func TestEndpointSetUpdate_DuplicateSpecs(t *testing.T) { endpoints, err := startTestEndpoints([]testEndpointMeta{ { InfoResponse: sidecarInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return labelpb.ZLabelSetsFromPromLabels( - labels.FromStrings("addr", addr, "a", "b"), - ) + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{labelpb.LabelSetFromStrings("addr", addr, "a", "b")} }, }, }) @@ -433,10 +422,8 @@ func TestEndpointSetUpdate_EndpointGoingAway(t *testing.T) { endpoints, err := startTestEndpoints([]testEndpointMeta{ { InfoResponse: sidecarInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return labelpb.ZLabelSetsFromPromLabels( - labels.FromStrings("addr", addr, "a", "b"), - ) + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{labelpb.LabelSetFromStrings("addr", addr, "a", "b")} }, }, }) @@ -465,7 +452,7 @@ func TestEndpointSetUpdate_EndpointComingOnline(t *testing.T) { { err: fmt.Errorf("endpoint unavailable"), InfoResponse: sidecarInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { + extlsetFn: func(addr string) []*labelpb.LabelSet { return nil }, }, @@ -499,7 +486,7 @@ func TestEndpointSetUpdate_StrictEndpointMetadata(t *testing.T) { { err: fmt.Errorf("endpoint unavailable"), InfoResponse: info, - extlsetFn: func(addr string) []labelpb.ZLabelSet { + extlsetFn: func(addr string) []*labelpb.LabelSet { return nil }, }, @@ -547,10 +534,8 @@ func TestEndpointSetUpdate_PruneInactiveEndpoints(t *testing.T) { endpoints: []testEndpointMeta{ { InfoResponse: sidecarInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return labelpb.ZLabelSetsFromPromLabels( - labels.FromStrings("addr", addr, "a", "b"), - ) + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{labelpb.LabelSetFromStrings("addr", addr, "a", "b")} }, }, }, @@ -562,10 +547,8 @@ func TestEndpointSetUpdate_PruneInactiveEndpoints(t *testing.T) { endpoints: []testEndpointMeta{ { InfoResponse: sidecarInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return labelpb.ZLabelSetsFromPromLabels( - labels.FromStrings("addr", addr, "a", "b"), - ) + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{labelpb.LabelSetFromStrings("addr", addr, "a", "b")} }, }, }, @@ -639,52 +622,28 @@ func TestEndpointSetUpdate_AvailabilityScenarios(t *testing.T) { endpoints, err := startTestEndpoints([]testEndpointMeta{ { InfoResponse: sidecarInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "addr", Value: addr}, - }, - }, - { - Labels: []labelpb.ZLabel{ - {Name: "a", Value: "b"}, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("addr", addr), + labelpb.LabelSetFromStrings("a", "b"), } }, }, { InfoResponse: sidecarInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "addr", Value: addr}, - }, - }, - { - Labels: []labelpb.ZLabel{ - {Name: "a", Value: "b"}, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("addr", addr), + labelpb.LabelSetFromStrings("a", "b"), } }, }, { InfoResponse: queryInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "addr", Value: addr}, - }, - }, - { - Labels: []labelpb.ZLabel{ - {Name: "a", Value: "b"}, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("addr", addr), + labelpb.LabelSetFromStrings("a", "b"), } }, }, @@ -771,79 +730,46 @@ func TestEndpointSetUpdate_AvailabilityScenarios(t *testing.T) { endpoint2, err := startTestEndpoints([]testEndpointMeta{ { InfoResponse: queryInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "l1", Value: "v2"}, - {Name: "l2", Value: "v3"}, - }, - }, - { - Labels: []labelpb.ZLabel{ - {Name: "l3", Value: "v4"}, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("l1", "v2", "l2", "v3"), + labelpb.LabelSetFromStrings("l3", "v4"), } }, }, { // Duplicated Querier, in previous versions it would be deduplicated. Now it should be not. InfoResponse: queryInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "l1", Value: "v2"}, - {Name: "l2", Value: "v3"}, - }, - }, - { - Labels: []labelpb.ZLabel{ - {Name: "l3", Value: "v4"}, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("l1", "v2", "l2", "v3"), + labelpb.LabelSetFromStrings("l3", "v4"), } }, }, { InfoResponse: sidecarInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "l1", Value: "v2"}, - {Name: "l2", Value: "v3"}, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("l1", "v2", "l2", "v3"), } }, }, { // Duplicated Sidecar, in previous versions it would be deduplicated. Now it should be not. InfoResponse: sidecarInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "l1", Value: "v2"}, - {Name: "l2", Value: "v3"}, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("l1", "v2", "l2", "v3"), } }, }, { // Querier that duplicates with sidecar, in previous versions it would be deduplicated. Now it should be not. InfoResponse: queryInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "l1", Value: "v2"}, - {Name: "l2", Value: "v3"}, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("l1", "v2", "l2", "v3"), } }, }, @@ -851,136 +777,81 @@ func TestEndpointSetUpdate_AvailabilityScenarios(t *testing.T) { // Ruler that duplicates with sidecar, in previous versions it would be deduplicated. Now it should be not. // Warning should be produced. InfoResponse: ruleInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "l1", Value: "v2"}, - {Name: "l2", Value: "v3"}, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("l1", "v2", "l2", "v3"), } }, }, { // Duplicated Rule, in previous versions it would be deduplicated. Now it should be not. Warning should be produced. InfoResponse: ruleInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "l1", Value: "v2"}, - {Name: "l2", Value: "v3"}, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("l1", "v2", "l2", "v3"), } }, }, // Two pre v0.8.0 store gateway nodes, they don't have ext labels set. { InfoResponse: storeGWInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{} + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{} }, }, { InfoResponse: storeGWInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{} + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{} }, }, // Regression tests against https://github.com/thanos-io/thanos/issues/1632: From v0.8.0 stores advertise labels. // If the object storage handled by store gateway has only one sidecar we used to hitting issue. { InfoResponse: storeGWInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "l1", Value: "v2"}, - {Name: "l2", Value: "v3"}, - }, - }, - { - Labels: []labelpb.ZLabel{ - {Name: "l3", Value: "v4"}, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("l1", "v2", "l2", "v3"), + labelpb.LabelSetFromStrings("l3", "v4"), } }, }, // Stores v0.8.1 has compatibility labels. Check if they are correctly removed. { InfoResponse: storeGWInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "l1", Value: "v2"}, - {Name: "l2", Value: "v3"}, - }, - }, - { - Labels: []labelpb.ZLabel{ - {Name: "l3", Value: "v4"}, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("l1", "v2", "l2", "v3"), + labelpb.LabelSetFromStrings("l3", "v4"), } }, }, // Duplicated store, in previous versions it would be deduplicated. Now it should be not. { InfoResponse: storeGWInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "l1", Value: "v2"}, - {Name: "l2", Value: "v3"}, - }, - }, - { - Labels: []labelpb.ZLabel{ - {Name: "l3", Value: "v4"}, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("l1", "v2", "l2", "v3"), + labelpb.LabelSetFromStrings("l3", "v4"), } }, }, { InfoResponse: receiveInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "l1", Value: "v2"}, - {Name: "l2", Value: "v3"}, - }, - }, - { - Labels: []labelpb.ZLabel{ - {Name: "l3", Value: "v4"}, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("l1", "v2", "l2", "v3"), + labelpb.LabelSetFromStrings("l3", "v4"), } }, }, // Duplicate receiver { InfoResponse: receiveInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "l1", Value: "v2"}, - {Name: "l2", Value: "v3"}, - }, - }, - { - Labels: []labelpb.ZLabel{ - {Name: "l3", Value: "v4"}, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("l1", "v2", "l2", "v3"), + labelpb.LabelSetFromStrings("l3", "v4"), } }, }, @@ -1035,31 +906,17 @@ func TestEndpointSet_Update_NoneAvailable(t *testing.T) { endpoints, err := startTestEndpoints([]testEndpointMeta{ { InfoResponse: sidecarInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - { - Name: "addr", - Value: addr, - }, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("addr", addr), } }, }, { InfoResponse: sidecarInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - { - Name: "addr", - Value: addr, - }, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("addr", addr), } }, }, @@ -1109,16 +966,9 @@ func TestEndpoint_Update_QuerierStrict(t *testing.T) { MetricMetadata: &infopb.MetricMetadataInfo{}, Targets: &infopb.TargetsInfo{}, }, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - { - Name: "addr", - Value: addr, - }, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("addr", addr), } }, }, @@ -1134,16 +984,9 @@ func TestEndpoint_Update_QuerierStrict(t *testing.T) { MetricMetadata: &infopb.MetricMetadataInfo{}, Targets: &infopb.TargetsInfo{}, }, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - { - Name: "addr", - Value: addr, - }, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("addr", addr), } }, }, @@ -1160,16 +1003,9 @@ func TestEndpoint_Update_QuerierStrict(t *testing.T) { MetricMetadata: &infopb.MetricMetadataInfo{}, Targets: &infopb.TargetsInfo{}, }, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - { - Name: "addr", - Value: addr, - }, - }, - }, + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("addr", addr), } }, infoDelay: 2 * time.Second, @@ -1240,32 +1076,32 @@ func TestEndpointSet_APIs_Discovery(t *testing.T) { endpoints, err := startTestEndpoints([]testEndpointMeta{ { InfoResponse: sidecarInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{} + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{} }, }, { InfoResponse: ruleInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{} + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{} }, }, { InfoResponse: receiveInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{} + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{} }, }, { InfoResponse: storeGWInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{} + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{} }, }, { InfoResponse: queryInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return []labelpb.ZLabelSet{} + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{} }, }, }) @@ -1459,10 +1295,8 @@ func makeInfoResponses(n int) []testEndpointMeta { for i := 0; i < n; i++ { responses = append(responses, testEndpointMeta{ InfoResponse: sidecarInfo, - extlsetFn: func(addr string) []labelpb.ZLabelSet { - return labelpb.ZLabelSetsFromPromLabels( - labels.FromStrings("addr", addr, "a", "b"), - ) + extlsetFn: func(addr string) []*labelpb.LabelSet { + return []*labelpb.LabelSet{labelpb.LabelSetFromStrings("addr", addr, "a", "b")} }, }) } diff --git a/pkg/query/iter.go b/pkg/query/iter.go index 7bee002df20..018fd31d8a3 100644 --- a/pkg/query/iter.go +++ b/pkg/query/iter.go @@ -6,18 +6,19 @@ package query import ( "github.com/pkg/errors" "github.com/prometheus/prometheus/model/histogram" - "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/util/annotations" "github.com/thanos-io/thanos/pkg/compact/downsample" "github.com/thanos-io/thanos/pkg/dedup" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" ) -// promSeriesSet implements the SeriesSet interface of the Prometheus storage -// package on top of our storepb SeriesSet. Overlapping chunks will be naively deduplicated (random selection). +// promSeriesSet converts a storepb.SeriesSet (chunk-level) into a +// dedup.SeriesSet (sample-level) by decoding chunks into iterators. +// Overlapping chunks will be naively deduplicated (random selection). type promSeriesSet struct { set storepb.SeriesSet @@ -27,8 +28,8 @@ type promSeriesSet struct { warns annotations.Annotations } -// NewPromSeriesSet constructs a promSeriesSet. -func NewPromSeriesSet(seriesSet storepb.SeriesSet, mint, maxt int64, aggrs []storepb.Aggr, warns annotations.Annotations) storage.SeriesSet { +// NewPromSeriesSet constructs a promSeriesSet that implements dedup.SeriesSet. +func NewPromSeriesSet(seriesSet storepb.SeriesSet, mint, maxt int64, aggrs []storepb.Aggr, warns annotations.Annotations) dedup.SeriesSet { return &promSeriesSet{ set: seriesSet, mint: mint, @@ -42,7 +43,7 @@ func (s *promSeriesSet) Next() bool { return s.set.Next() } -func (s *promSeriesSet) At() storage.Series { +func (s *promSeriesSet) At() dedup.Series { if s.set.Err() != nil { return nil } @@ -82,20 +83,20 @@ func (*storeSeriesSet) Err() error { return nil } -func (s *storeSeriesSet) At() (labels.Labels, []storepb.AggrChunk) { +func (s *storeSeriesSet) At() (labelpb.Labels, []*storepb.AggrChunk) { return s.series[s.i].PromLabels(), s.series[s.i].Chunks } -// chunkSeries implements storage.Series for a series on storepb types. +// chunkSeries implements dedup.Series for a series on storepb types. type chunkSeries struct { - lset labels.Labels - chunks []storepb.AggrChunk + lset labelpb.Labels + chunks []*storepb.AggrChunk mint, maxt int64 aggrs []storepb.Aggr } // newChunkSeries allows to iterate over samples for each sorted and non-overlapped chunks. -func newChunkSeries(lset labels.Labels, chunks []storepb.AggrChunk, mint, maxt int64, aggrs []storepb.Aggr) *chunkSeries { +func newChunkSeries(lset labelpb.Labels, chunks []*storepb.AggrChunk, mint, maxt int64, aggrs []storepb.Aggr) *chunkSeries { return &chunkSeries{ lset: lset, chunks: chunks, @@ -105,7 +106,7 @@ func newChunkSeries(lset labels.Labels, chunks []storepb.AggrChunk, mint, maxt i } } -func (s *chunkSeries) Labels() labels.Labels { +func (s *chunkSeries) Labels() labelpb.Labels { return s.lset } diff --git a/pkg/query/querier.go b/pkg/query/querier.go index 64bab65a022..9aab3868fe0 100644 --- a/pkg/query/querier.go +++ b/pkg/query/querier.go @@ -16,12 +16,14 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" + "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/util/annotations" "github.com/thanos-io/thanos/pkg/dedup" "github.com/thanos-io/thanos/pkg/extprom" "github.com/thanos-io/thanos/pkg/gate" "github.com/thanos-io/thanos/pkg/store" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" "github.com/thanos-io/thanos/pkg/tenancy" "github.com/thanos-io/thanos/pkg/tracing" @@ -422,13 +424,13 @@ func (q *querier) selectFn(ctx context.Context, hints *storage.SelectHints, ms . warns := annotations.New().Merge(resp.warnings) if !q.isDedupEnabled() { - return NewPromSeriesSet( + return newPromSeriesSetAdapter(NewPromSeriesSet( newStoreSeriesSet(resp.seriesSet), q.mint, q.maxt, aggrs, warns, - ), resp.seriesSetStats, nil + )), resp.seriesSetStats, nil } // TODO(bwplotka): Move to deduplication on chunk level inside promSeriesSet, similar to what we have in dedup.NewDedupChunkMerger(). @@ -442,7 +444,42 @@ func (q *querier) selectFn(ctx context.Context, hints *storage.SelectHints, ms . warns, ) f := hints.Func - return dedup.NewSeriesSet(set, f, q.deduplicationFunc), resp.seriesSetStats, nil + return newPromSeriesSetAdapter(dedup.NewSeriesSet(set, f, q.deduplicationFunc)), resp.seriesSetStats, nil +} + +// promSeriesSetAdapter bridges dedup.SeriesSet to storage.SeriesSet at the +// PromQL boundary, converting labelpb.Labels to labels.Labels. +type promSeriesSetAdapter struct { + set dedup.SeriesSet +} + +func newPromSeriesSetAdapter(set dedup.SeriesSet) storage.SeriesSet { + return &promSeriesSetAdapter{set: set} +} + +func (a *promSeriesSetAdapter) Next() bool { return a.set.Next() } +func (a *promSeriesSetAdapter) Err() error { return a.set.Err() } +func (a *promSeriesSetAdapter) Warnings() annotations.Annotations { return a.set.Warnings() } + +func (a *promSeriesSetAdapter) At() storage.Series { + s := a.set.At() + if s == nil { + return nil + } + return &promSeriesAdapter{s: s} +} + +// promSeriesAdapter bridges dedup.Series to storage.Series. +type promSeriesAdapter struct { + s dedup.Series +} + +func (a *promSeriesAdapter) Labels() labels.Labels { + return labelpb.ToPromLabels(a.s.Labels()) +} + +func (a *promSeriesAdapter) Iterator(it chunkenc.Iterator) chunkenc.Iterator { + return a.s.Iterator(it) } // LabelValues returns all potential values for a label name. diff --git a/pkg/query/querier_test.go b/pkg/query/querier_test.go index 8c77ee93c50..be7eacb1741 100644 --- a/pkg/query/querier_test.go +++ b/pkg/query/querier_test.go @@ -856,7 +856,7 @@ func newProxyStore(storeAPIs ...storepb.StoreServer) *store.ProxyStore { nil, func() []store.Client { return cls }, component.Query, - nil, + labelpb.EmptyLabels(), 0, store.EagerRetrieval, ) @@ -1257,7 +1257,7 @@ func storeSeriesResponse(t testing.TB, lset labels.Labels, smplChunks ...[]sampl var s storepb.Series for _, l := range lset { - s.Labels = append(s.Labels, labelpb.ZLabel{Name: l.Name, Value: l.Value}) + s.Labels = append(s.Labels, &labelpb.Label{Name: l.Name, Value: l.Value}) } for _, smpls := range smplChunks { @@ -1269,7 +1269,7 @@ func storeSeriesResponse(t testing.TB, lset labels.Labels, smplChunks ...[]sampl a.Append(smpl.t, smpl.v) } - ch := storepb.AggrChunk{ + ch := &storepb.AggrChunk{ MinTime: smpls[0].t, MaxTime: smpls[len(smpls)-1].t, Raw: &storepb.Chunk{Type: storepb.Chunk_XOR, Data: c.Bytes()}, diff --git a/pkg/query/query_bench_test.go b/pkg/query/query_bench_test.go index 71a26960fca..1a244d70a2f 100644 --- a/pkg/query/query_bench_test.go +++ b/pkg/query/query_bench_test.go @@ -67,12 +67,12 @@ func benchQuerySelect(t testutil.TB, totalSamples, totalSeries int, dedup bool) SamplesPerSeries: samplesPerSeriesPerReplica, Series: seriesPerReplica, Random: random, - PrependLabels: labels.FromStrings("a_replica", fmt.Sprintf("%d", j)), // a_ prefix so we keep sorted order. + PrependLabels: labelpb.FromStrings("a_replica", fmt.Sprintf("%d", j)), // a_ prefix so we keep sorted order. }) testutil.Ok(t, head.Close()) for i := 0; i < len(created); i++ { if !dedup || j == 0 { - lset := labelpb.ZLabelsToPromLabels(created[i].Labels).Copy() + lset := labelpb.ToPromLabels(created[i].Labels).Copy() if dedup { lset = lset[1:] } diff --git a/pkg/query/query_test.go b/pkg/query/query_test.go index cc19f43ab6d..eca7743347e 100644 --- a/pkg/query/query_test.go +++ b/pkg/query/query_test.go @@ -18,6 +18,7 @@ import ( "github.com/thanos-io/thanos/pkg/component" "github.com/thanos-io/thanos/pkg/store" storecache "github.com/thanos-io/thanos/pkg/store/cache" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" storetestutil "github.com/thanos-io/thanos/pkg/store/storepb/testutil" "github.com/thanos-io/thanos/pkg/testutil/custom" @@ -66,7 +67,7 @@ func TestQuerier_Proxy(t *testing.T) { logger, nil, store.NewProxyStore(logger, nil, func() []store.Client { return sc.get() }, - component.Debug, nil, 5*time.Minute, store.EagerRetrieval, store.WithMatcherCache(cache)), + component.Debug, labelpb.EmptyLabels(), 5*time.Minute, store.EagerRetrieval, store.WithMatcherCache(cache)), 1000000, 5*time.Minute, ) @@ -108,14 +109,14 @@ func TestQuerier_Proxy(t *testing.T) { // selectStore allows wrapping another storeEndpoints with additional time and matcher selection. type selectStore struct { - matchers []storepb.LabelMatcher + matchers []*storepb.LabelMatcher storepb.StoreServer mint, maxt int64 } // selectedStore wraps given store with selectStore. -func selectedStore(wrapped storepb.StoreServer, matchers []storepb.LabelMatcher, mint, maxt int64) *selectStore { +func selectedStore(wrapped storepb.StoreServer, matchers []*storepb.LabelMatcher, mint, maxt int64) *selectStore { return &selectStore{ StoreServer: wrapped, matchers: matchers, @@ -132,10 +133,10 @@ func (s *selectStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesS r.MaxTime = s.maxt } - matchers := make([]storepb.LabelMatcher, 0, len(r.Matchers)) + matchers := make([]*storepb.LabelMatcher, 0, len(r.Matchers)) matchers = append(matchers, r.Matchers...) - req := *r + req := r.CloneVT() req.Matchers = matchers - return s.StoreServer.Series(&req, srv) + return s.StoreServer.Series(req, srv) } diff --git a/pkg/query/remote_engine.go b/pkg/query/remote_engine.go index 77a74c9a6fa..dc1faabb96b 100644 --- a/pkg/query/remote_engine.go +++ b/pkg/query/remote_engine.go @@ -58,7 +58,7 @@ func NewClient(queryClient querypb.QueryClient, address string, tsdbInfos infopb func (c Client) GetAddress() string { return c.address } -func (c Client) LabelSets() []labels.Labels { +func (c Client) LabelSets() []labelpb.Labels { return c.tsdbInfos.LabelSets() } @@ -119,15 +119,15 @@ func (r *remoteEngine) MinT() int64 { hashBuf = make([]byte, 0, 128) highestMintByLabelSet = make(map[uint64]int64) ) - for _, lset := range r.adjustedInfos() { - key, _ := labelpb.ZLabelsToPromLabels(lset.Labels.Labels).HashWithoutLabels(hashBuf) + for _, info := range r.adjustedInfos() { + key, _ := labelpb.HashWithoutLabels(info.GetLabels().GetLabels(), hashBuf) lsetMinT, ok := highestMintByLabelSet[key] if !ok { - highestMintByLabelSet[key] = lset.MinTime + highestMintByLabelSet[key] = info.MinTime continue } - if lset.MinTime > lsetMinT { - highestMintByLabelSet[key] = lset.MinTime + if info.MinTime > lsetMinT { + highestMintByLabelSet[key] = info.MinTime } } var mint int64 = math.MaxInt64 @@ -151,7 +151,11 @@ func (r *remoteEngine) MaxT() int64 { func (r *remoteEngine) LabelSets() []labels.Labels { r.labelSetsOnce.Do(func() { - r.labelSets = r.adjustedInfos().LabelSets() + pbLabelSets := r.adjustedInfos().LabelSets() + r.labelSets = make([]labels.Labels, len(pbLabelSets)) + for i, ls := range pbLabelSets { + r.labelSets[i] = labelpb.ToPromLabels(ls) + } }) return r.labelSets } @@ -170,22 +174,21 @@ func (r *remoteEngine) adjustedInfos() infopb.TSDBInfos { // Strip replica labels from the result. infos := make(infopb.TSDBInfos, 0, len(r.client.tsdbInfos)) - var builder labels.ScratchBuilder for _, info := range r.client.tsdbInfos { - builder.Reset() - for _, lbl := range info.Labels.Labels { + filtered := make(labelpb.Labels, 0, len(info.GetLabels().GetLabels())) + for _, lbl := range info.GetLabels().GetLabels() { if _, ok := replicaLabelSet[lbl.Name]; ok { continue } if _, ok := partitionLabelsSet[lbl.Name]; !ok && len(partitionLabelsSet) > 0 { continue } - builder.Add(lbl.Name, lbl.Value) + filtered = append(filtered, &labelpb.Label{Name: lbl.Name, Value: lbl.Value}) } infos = append(infos, infopb.NewTSDBInfo( info.MinTime, info.MaxTime, - labelpb.ZLabelsFromPromLabels(builder.Labels())), + filtered), ) } return infos @@ -303,7 +306,7 @@ func (r *remoteQuery) Exec(ctx context.Context) *promql.Result { result = make(promql.Vector, 0) warnings annotations.Annotations builder = labels.NewScratchBuilder(8) - qryStats querypb.QueryStats + qryStats *querypb.QueryStats ) for { msg, err := qry.Recv() @@ -319,7 +322,7 @@ func (r *remoteQuery) Exec(ctx context.Context) *promql.Result { continue } if s := msg.GetStats(); s != nil { - qryStats = *s + qryStats = s continue } @@ -340,8 +343,10 @@ func (r *remoteQuery) Exec(ctx context.Context) *promql.Result { result = append(result, promql.Sample{Metric: builder.Labels(), F: ts.Samples[0].Value, T: r.start.UnixMilli()}) } } - r.samplesStats.UpdatePeak(int(qryStats.PeakSamples)) - r.samplesStats.TotalSamples = qryStats.SamplesTotal + if qryStats != nil { + r.samplesStats.UpdatePeak(int(qryStats.PeakSamples)) + r.samplesStats.TotalSamples = qryStats.SamplesTotal + } return &promql.Result{ Value: result, @@ -372,7 +377,7 @@ func (r *remoteQuery) Exec(ctx context.Context) *promql.Result { result = make(promql.Matrix, 0) warnings annotations.Annotations builder = labels.NewScratchBuilder(8) - qryStats querypb.QueryStats + qryStats *querypb.QueryStats ) for { msg, err := qry.Recv() @@ -388,7 +393,7 @@ func (r *remoteQuery) Exec(ctx context.Context) *promql.Result { continue } if s := msg.GetStats(); s != nil { - qryStats = *s + qryStats = s continue } @@ -419,8 +424,10 @@ func (r *remoteQuery) Exec(ctx context.Context) *promql.Result { } result = append(result, series) } - r.samplesStats.UpdatePeak(int(qryStats.PeakSamples)) - r.samplesStats.TotalSamples = qryStats.SamplesTotal + if qryStats != nil { + r.samplesStats.UpdatePeak(int(qryStats.PeakSamples)) + r.samplesStats.TotalSamples = qryStats.SamplesTotal + } return &promql.Result{Value: result, Warnings: warnings} } diff --git a/pkg/query/remote_engine_test.go b/pkg/query/remote_engine_test.go index 2831855bd3c..3fd22bb11e1 100644 --- a/pkg/query/remote_engine_test.go +++ b/pkg/query/remote_engine_test.go @@ -67,42 +67,42 @@ func TestRemoteEngine_LabelSets(t *testing.T) { tests := []struct { name string - tsdbInfos []infopb.TSDBInfo + tsdbInfos []*infopb.TSDBInfo replicaLabels []string expected []labels.Labels partitionLabels []string }{ { name: "empty label sets", - tsdbInfos: []infopb.TSDBInfo{}, + tsdbInfos: []*infopb.TSDBInfo{}, expected: []labels.Labels{}, }, { name: "empty label sets with replica labels", - tsdbInfos: []infopb.TSDBInfo{}, + tsdbInfos: []*infopb.TSDBInfo{}, replicaLabels: []string{"replica"}, expected: []labels.Labels{}, }, { name: "non-empty label sets", - tsdbInfos: []infopb.TSDBInfo{{ - Labels: zLabelSetFromStrings("a", "1"), + tsdbInfos: []*infopb.TSDBInfo{{ + Labels: labelpb.LabelSetFromStrings("a", "1"), }}, expected: []labels.Labels{labels.FromStrings("a", "1")}, }, { name: "non-empty label sets with replica labels", - tsdbInfos: []infopb.TSDBInfo{{ - Labels: zLabelSetFromStrings("a", "1", "b", "2"), + tsdbInfos: []*infopb.TSDBInfo{{ + Labels: labelpb.LabelSetFromStrings("a", "1", "b", "2"), }}, replicaLabels: []string{"a"}, expected: []labels.Labels{labels.FromStrings("b", "2")}, }, { name: "replica labels not in label sets", - tsdbInfos: []infopb.TSDBInfo{ + tsdbInfos: []*infopb.TSDBInfo{ { - Labels: zLabelSetFromStrings("a", "1", "c", "2"), + Labels: labelpb.LabelSetFromStrings("a", "1", "c", "2"), }, }, replicaLabels: []string{"a", "b"}, @@ -110,9 +110,9 @@ func TestRemoteEngine_LabelSets(t *testing.T) { }, { name: "non-empty label sets with partition labels", - tsdbInfos: []infopb.TSDBInfo{ + tsdbInfos: []*infopb.TSDBInfo{ { - Labels: zLabelSetFromStrings("a", "1", "c", "2"), + Labels: labelpb.LabelSetFromStrings("a", "1", "c", "2"), }, }, partitionLabels: []string{"a"}, @@ -138,33 +138,33 @@ func TestRemoteEngine_MinT(t *testing.T) { tests := []struct { name string - tsdbInfos []infopb.TSDBInfo + tsdbInfos []*infopb.TSDBInfo replicaLabels []string expected int64 }{ { name: "empty label sets", - tsdbInfos: []infopb.TSDBInfo{}, + tsdbInfos: []*infopb.TSDBInfo{}, expected: math.MaxInt64, }, { name: "empty label sets with replica labels", - tsdbInfos: []infopb.TSDBInfo{}, + tsdbInfos: []*infopb.TSDBInfo{}, replicaLabels: []string{"replica"}, expected: math.MaxInt64, }, { name: "non-empty label sets", - tsdbInfos: []infopb.TSDBInfo{{ - Labels: zLabelSetFromStrings("a", "1"), + tsdbInfos: []*infopb.TSDBInfo{{ + Labels: labelpb.LabelSetFromStrings("a", "1"), MinTime: 30, }}, expected: 30, }, { name: "non-empty label sets with replica labels", - tsdbInfos: []infopb.TSDBInfo{{ - Labels: zLabelSetFromStrings("a", "1", "b", "2"), + tsdbInfos: []*infopb.TSDBInfo{{ + Labels: labelpb.LabelSetFromStrings("a", "1", "b", "2"), MinTime: 30, }}, replicaLabels: []string{"a"}, @@ -172,13 +172,13 @@ func TestRemoteEngine_MinT(t *testing.T) { }, { name: "replicated labelsets with different mint", - tsdbInfos: []infopb.TSDBInfo{ + tsdbInfos: []*infopb.TSDBInfo{ { - Labels: zLabelSetFromStrings("a", "1", "replica", "1"), + Labels: labelpb.LabelSetFromStrings("a", "1", "replica", "1"), MinTime: 30, }, { - Labels: zLabelSetFromStrings("a", "1", "replica", "2"), + Labels: labelpb.LabelSetFromStrings("a", "1", "replica", "2"), MinTime: 60, }, }, @@ -187,21 +187,21 @@ func TestRemoteEngine_MinT(t *testing.T) { }, { name: "multiple replicated labelsets with different mint", - tsdbInfos: []infopb.TSDBInfo{ + tsdbInfos: []*infopb.TSDBInfo{ { - Labels: zLabelSetFromStrings("a", "1", "replica", "1"), + Labels: labelpb.LabelSetFromStrings("a", "1", "replica", "1"), MinTime: 30, }, { - Labels: zLabelSetFromStrings("a", "1", "replica", "2"), + Labels: labelpb.LabelSetFromStrings("a", "1", "replica", "2"), MinTime: 60, }, { - Labels: zLabelSetFromStrings("a", "2", "replica", "1"), + Labels: labelpb.LabelSetFromStrings("a", "2", "replica", "1"), MinTime: 80, }, { - Labels: zLabelSetFromStrings("a", "2", "replica", "2"), + Labels: labelpb.LabelSetFromStrings("a", "2", "replica", "2"), MinTime: 120, }, }, @@ -222,12 +222,6 @@ func TestRemoteEngine_MinT(t *testing.T) { } } -func zLabelSetFromStrings(ss ...string) labelpb.ZLabelSet { - return labelpb.ZLabelSet{ - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings(ss...)), - } -} - type warnClient struct { querypb.QueryClient } diff --git a/pkg/queryfrontend/labels_codec.go b/pkg/queryfrontend/labels_codec.go index 0557652b353..402653c6b27 100644 --- a/pkg/queryfrontend/labels_codec.go +++ b/pkg/queryfrontend/labels_codec.go @@ -82,7 +82,7 @@ func (c labelsCodec) MergeResponse(_ queryrange.Request, responses ...queryrange Data: lbls, }, nil case *ThanosSeriesResponse: - seriesData := make(labelpb.ZLabelSets, 0) + seriesData := make([]*labelpb.LabelSet, 0) uniqueSeries := make(map[string]struct{}) for _, res := range responses { @@ -95,7 +95,9 @@ func (c labelsCodec) MergeResponse(_ queryrange.Request, responses ...queryrange } } - sort.Sort(seriesData) + sort.Slice(seriesData, func(i, j int) bool { + return seriesData[i].PromLabels().String() < seriesData[j].PromLabels().String() + }) return &ThanosSeriesResponse{ Status: queryrange.StatusSuccess, Data: seriesData, diff --git a/pkg/queryfrontend/labels_codec_test.go b/pkg/queryfrontend/labels_codec_test.go index c7ff233aa53..5f303af915b 100644 --- a/pkg/queryfrontend/labels_codec_test.go +++ b/pkg/queryfrontend/labels_codec_test.go @@ -329,14 +329,14 @@ func TestLabelsCodec_DecodeResponse(t *testing.T) { seriesResponse := &ThanosSeriesResponse{ Status: "success", - Data: []labelpb.ZLabelSet{{Labels: []labelpb.ZLabel{{Name: "foo", Value: "bar"}}}}, + Data: []*labelpb.LabelSet{{Labels: []*labelpb.Label{{Name: "foo", Value: "bar"}}}}, } seriesData, err := json.Marshal(seriesResponse) testutil.Ok(t, err) seriesResponseWithHeaders := &ThanosSeriesResponse{ Status: "success", - Data: []labelpb.ZLabelSet{{Labels: []labelpb.ZLabel{{Name: "foo", Value: "bar"}}}}, + Data: []*labelpb.LabelSet{{Labels: []*labelpb.Label{{Name: "foo", Value: "bar"}}}}, Headers: []*ResponseHeader{{Name: cacheControlHeader, Values: []string{noStoreValue}}}, } seriesDataWithHeaders, err := json.Marshal(seriesResponseWithHeaders) @@ -468,45 +468,45 @@ func TestLabelsCodec_MergeResponse(t *testing.T) { { name: "One series response", responses: []queryrange.Response{ - &ThanosSeriesResponse{Status: "success", Data: []labelpb.ZLabelSet{{Labels: []labelpb.ZLabel{{Name: "foo", Value: "bar"}}}}}, + &ThanosSeriesResponse{Status: "success", Data: []*labelpb.LabelSet{{Labels: []*labelpb.Label{{Name: "foo", Value: "bar"}}}}}, }, - expectedResponse: &ThanosSeriesResponse{Status: "success", Data: []labelpb.ZLabelSet{{Labels: []labelpb.ZLabel{{Name: "foo", Value: "bar"}}}}}, + expectedResponse: &ThanosSeriesResponse{Status: "success", Data: []*labelpb.LabelSet{{Labels: []*labelpb.Label{{Name: "foo", Value: "bar"}}}}}, }, { name: "One series response and two empty responses", responses: []queryrange.Response{ &ThanosSeriesResponse{Status: queryrange.StatusSuccess}, - &ThanosSeriesResponse{Status: "success", Data: []labelpb.ZLabelSet{{Labels: []labelpb.ZLabel{{Name: "foo", Value: "bar"}}}}}, + &ThanosSeriesResponse{Status: "success", Data: []*labelpb.LabelSet{{Labels: []*labelpb.Label{{Name: "foo", Value: "bar"}}}}}, &ThanosSeriesResponse{Status: queryrange.StatusSuccess}, }, - expectedResponse: &ThanosSeriesResponse{Status: "success", Data: []labelpb.ZLabelSet{{Labels: []labelpb.ZLabel{{Name: "foo", Value: "bar"}}}}}, + expectedResponse: &ThanosSeriesResponse{Status: "success", Data: []*labelpb.LabelSet{{Labels: []*labelpb.Label{{Name: "foo", Value: "bar"}}}}}, }, { name: "Multiple duplicate series responses", responses: []queryrange.Response{ - &ThanosSeriesResponse{Status: "success", Data: []labelpb.ZLabelSet{{Labels: []labelpb.ZLabel{{Name: "foo", Value: "bar"}}}}}, - &ThanosSeriesResponse{Status: "success", Data: []labelpb.ZLabelSet{{Labels: []labelpb.ZLabel{{Name: "foo", Value: "bar"}}}}}, - &ThanosSeriesResponse{Status: "success", Data: []labelpb.ZLabelSet{{Labels: []labelpb.ZLabel{{Name: "foo", Value: "bar"}}}}}, + &ThanosSeriesResponse{Status: "success", Data: []*labelpb.LabelSet{{Labels: []*labelpb.Label{{Name: "foo", Value: "bar"}}}}}, + &ThanosSeriesResponse{Status: "success", Data: []*labelpb.LabelSet{{Labels: []*labelpb.Label{{Name: "foo", Value: "bar"}}}}}, + &ThanosSeriesResponse{Status: "success", Data: []*labelpb.LabelSet{{Labels: []*labelpb.Label{{Name: "foo", Value: "bar"}}}}}, }, - expectedResponse: &ThanosSeriesResponse{Status: "success", Data: []labelpb.ZLabelSet{{Labels: []labelpb.ZLabel{{Name: "foo", Value: "bar"}}}}}, + expectedResponse: &ThanosSeriesResponse{Status: "success", Data: []*labelpb.LabelSet{{Labels: []*labelpb.Label{{Name: "foo", Value: "bar"}}}}}, }, { name: "Multiple unordered series responses", responses: []queryrange.Response{ - &ThanosSeriesResponse{Status: "success", Data: []labelpb.ZLabelSet{ - {Labels: []labelpb.ZLabel{{Name: "foo", Value: "bar"}}}, - {Labels: []labelpb.ZLabel{{Name: "test", Value: "aaa"}, {Name: "instance", Value: "localhost:9090"}}}, + &ThanosSeriesResponse{Status: "success", Data: []*labelpb.LabelSet{ + {Labels: []*labelpb.Label{{Name: "foo", Value: "bar"}}}, + {Labels: []*labelpb.Label{{Name: "test", Value: "aaa"}, {Name: "instance", Value: "localhost:9090"}}}, }}, - &ThanosSeriesResponse{Status: "success", Data: []labelpb.ZLabelSet{ - {Labels: []labelpb.ZLabel{{Name: "foo", Value: "aaa"}}}, - {Labels: []labelpb.ZLabel{{Name: "test", Value: "bbb"}, {Name: "instance", Value: "localhost:9091"}}}, + &ThanosSeriesResponse{Status: "success", Data: []*labelpb.LabelSet{ + {Labels: []*labelpb.Label{{Name: "foo", Value: "aaa"}}}, + {Labels: []*labelpb.Label{{Name: "test", Value: "bbb"}, {Name: "instance", Value: "localhost:9091"}}}, }}, }, - expectedResponse: &ThanosSeriesResponse{Status: "success", Data: []labelpb.ZLabelSet{ - {Labels: []labelpb.ZLabel{{Name: "foo", Value: "aaa"}}}, - {Labels: []labelpb.ZLabel{{Name: "foo", Value: "bar"}}}, - {Labels: []labelpb.ZLabel{{Name: "test", Value: "aaa"}, {Name: "instance", Value: "localhost:9090"}}}, - {Labels: []labelpb.ZLabel{{Name: "test", Value: "bbb"}, {Name: "instance", Value: "localhost:9091"}}}, + expectedResponse: &ThanosSeriesResponse{Status: "success", Data: []*labelpb.LabelSet{ + {Labels: []*labelpb.Label{{Name: "foo", Value: "aaa"}}}, + {Labels: []*labelpb.Label{{Name: "foo", Value: "bar"}}}, + {Labels: []*labelpb.Label{{Name: "test", Value: "aaa"}, {Name: "instance", Value: "localhost:9090"}}}, + {Labels: []*labelpb.Label{{Name: "test", Value: "bbb"}, {Name: "instance", Value: "localhost:9091"}}}, }}, }, } { @@ -576,7 +576,7 @@ func BenchmarkLabelsCodecDecodeResponse(b *testing.B) { b.Run("SeriesResponse", func(b *testing.B) { seriesData, err := json.Marshal(&ThanosSeriesResponse{ Status: "success", - Data: []labelpb.ZLabelSet{{Labels: []labelpb.ZLabel{{Name: "foo", Value: "bar"}}}}, + Data: []*labelpb.LabelSet{{Labels: []*labelpb.Label{{Name: "foo", Value: "bar"}}}}, }) testutil.Ok(b, err) @@ -595,7 +595,7 @@ func BenchmarkLabelsCodecDecodeResponse(b *testing.B) { b.Run("SeriesResponseWithHeaders", func(b *testing.B) { seriesDataWithHeaders, err := json.Marshal(&ThanosSeriesResponse{ Status: "success", - Data: []labelpb.ZLabelSet{{Labels: []labelpb.ZLabel{{Name: "foo", Value: "bar"}}}}, + Data: []*labelpb.LabelSet{{Labels: []*labelpb.Label{{Name: "foo", Value: "bar"}}}}, Headers: []*ResponseHeader{{Name: cacheControlHeader, Values: []string{noStoreValue}}}, }) testutil.Ok(b, err) @@ -707,11 +707,11 @@ func makeQueryRangeResponses(size int) ([]queryrange.Response, []queryrange.Resp seriesResp, &ThanosSeriesResponse{ Status: "success", - Data: []labelpb.ZLabelSet{{Labels: []labelpb.ZLabel{{Name: fmt.Sprintf("foo-%d", i), Value: fmt.Sprintf("bar-%d", i)}}}}, + Data: []*labelpb.LabelSet{{Labels: []*labelpb.Label{{Name: fmt.Sprintf("foo-%d", i), Value: fmt.Sprintf("bar-%d", i)}}}}, }, &ThanosSeriesResponse{ Status: "success", - Data: []labelpb.ZLabelSet{{Labels: []labelpb.ZLabel{{Name: fmt.Sprintf("foo-%d", i+1), Value: fmt.Sprintf("bar-%d", i+1)}}}}, + Data: []*labelpb.LabelSet{{Labels: []*labelpb.Label{{Name: fmt.Sprintf("foo-%d", i+1), Value: fmt.Sprintf("bar-%d", i+1)}}}}, }, ) } diff --git a/pkg/queryfrontend/response.go b/pkg/queryfrontend/response.go index a6477130fad..24b000bc90b 100644 --- a/pkg/queryfrontend/response.go +++ b/pkg/queryfrontend/response.go @@ -4,11 +4,31 @@ package queryfrontend import ( - "unsafe" + gogoproto "github.com/gogo/protobuf/proto" "github.com/thanos-io/thanos/internal/cortex/querier/queryrange" ) +// Register response types with the gogo proto registry so that the cortex +// cache layer (which uses gogo's types.MarshalAny / types.EmptyAny) can +// round-trip these messages through protobuf Any. +func init() { + gogoproto.RegisterType((*ThanosLabelsResponse)(nil), "queryfrontend.ThanosLabelsResponse") + gogoproto.RegisterType((*ThanosSeriesResponse)(nil), "queryfrontend.ThanosSeriesResponse") +} + +// Marshal/Unmarshal bridge methods allow gogo protobuf's types.MarshalAny / +// types.UnmarshalAny (used by the cortex cache layer) to round-trip these +// protoc-gen-go messages without falling back to gogo's reflection-based +// codec, which is incompatible with the protoc-gen-go struct layout. + +func (m *ThanosLabelsResponse) Marshal() ([]byte, error) { return m.MarshalVT() } +func (m *ThanosLabelsResponse) Unmarshal(b []byte) error { return m.UnmarshalVT(b) } +func (m *ThanosSeriesResponse) Marshal() ([]byte, error) { return m.MarshalVT() } +func (m *ThanosSeriesResponse) Unmarshal(b []byte) error { return m.UnmarshalVT(b) } +func (m *ResponseHeader) Marshal() ([]byte, error) { return m.MarshalVT() } +func (m *ResponseHeader) Unmarshal(b []byte) error { return m.UnmarshalVT(b) } + // ThanosResponseExtractor helps to extract specific info from Query Response. type ThanosResponseExtractor struct{} @@ -39,19 +59,22 @@ func (ThanosResponseExtractor) ResponseWithoutStats(resp queryrange.Response) qu return resp } -// headersToQueryRangeHeaders convert slice of ResponseHeader to Cortex queryrange.PrometheusResponseHeader in an -// unsafe manner. It reuses the same memory. func headersToQueryRangeHeaders(headers []*ResponseHeader) []*queryrange.PrometheusResponseHeader { - return *(*[]*queryrange.PrometheusResponseHeader)(unsafe.Pointer(&headers)) + result := make([]*queryrange.PrometheusResponseHeader, len(headers)) + for i, h := range headers { + result[i] = &queryrange.PrometheusResponseHeader{ + Name: h.Name, + Values: h.Values, + } + } + return result } -// GetHeaders returns the HTTP headers in the response. -func (m *ThanosLabelsResponse) GetHeaders() []*queryrange.PrometheusResponseHeader { +func (m *ThanosLabelsResponse) PrometheusHeaders() []*queryrange.PrometheusResponseHeader { return headersToQueryRangeHeaders(m.Headers) } -// GetHeaders returns the HTTP headers in the response. -func (m *ThanosSeriesResponse) GetHeaders() []*queryrange.PrometheusResponseHeader { +func (m *ThanosSeriesResponse) PrometheusHeaders() []*queryrange.PrometheusResponseHeader { return headersToQueryRangeHeaders(m.Headers) } diff --git a/pkg/queryfrontend/response.pb.go b/pkg/queryfrontend/response.pb.go index 0aa88fdc624..75a1d56ec8a 100644 --- a/pkg/queryfrontend/response.pb.go +++ b/pkg/queryfrontend/response.pb.go @@ -1,31 +1,36 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.20.1 // source: queryfrontend/response.proto package queryfrontend import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" + reflect "reflect" + sync "sync" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/srikrsna/protoc-gen-gotag/tagger" labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type ThanosLabelsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Status string `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"` Data []string `protobuf:"bytes,2,rep,name=Data,proto3" json:"data"` ErrorType string `protobuf:"bytes,3,opt,name=ErrorType,proto3" json:"errorType,omitempty"` @@ -33,1054 +38,310 @@ type ThanosLabelsResponse struct { Headers []*ResponseHeader `protobuf:"bytes,5,rep,name=Headers,proto3" json:"-"` } -func (m *ThanosLabelsResponse) Reset() { *m = ThanosLabelsResponse{} } -func (m *ThanosLabelsResponse) String() string { return proto.CompactTextString(m) } -func (*ThanosLabelsResponse) ProtoMessage() {} -func (*ThanosLabelsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b882fa7024d92f38, []int{0} +func (x *ThanosLabelsResponse) Reset() { + *x = ThanosLabelsResponse{} + mi := &file_queryfrontend_response_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ThanosLabelsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ThanosLabelsResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ThanosLabelsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ThanosLabelsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ThanosLabelsResponse) ProtoMessage() {} + +func (x *ThanosLabelsResponse) ProtoReflect() protoreflect.Message { + mi := &file_queryfrontend_response_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *ThanosLabelsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ThanosLabelsResponse.Merge(m, src) -} -func (m *ThanosLabelsResponse) XXX_Size() int { - return m.Size() -} -func (m *ThanosLabelsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ThanosLabelsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ThanosLabelsResponse proto.InternalMessageInfo -type ThanosSeriesResponse struct { - Status string `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"` - Data []labelpb.ZLabelSet `protobuf:"bytes,2,rep,name=Data,proto3" json:"data"` - ErrorType string `protobuf:"bytes,3,opt,name=ErrorType,proto3" json:"errorType,omitempty"` - Error string `protobuf:"bytes,4,opt,name=Error,proto3" json:"error,omitempty"` - Headers []*ResponseHeader `protobuf:"bytes,5,rep,name=Headers,proto3" json:"-"` +// Deprecated: Use ThanosLabelsResponse.ProtoReflect.Descriptor instead. +func (*ThanosLabelsResponse) Descriptor() ([]byte, []int) { + return file_queryfrontend_response_proto_rawDescGZIP(), []int{0} } -func (m *ThanosSeriesResponse) Reset() { *m = ThanosSeriesResponse{} } -func (m *ThanosSeriesResponse) String() string { return proto.CompactTextString(m) } -func (*ThanosSeriesResponse) ProtoMessage() {} -func (*ThanosSeriesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b882fa7024d92f38, []int{1} -} -func (m *ThanosSeriesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ThanosSeriesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ThanosSeriesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *ThanosLabelsResponse) GetStatus() string { + if x != nil { + return x.Status } + return "" } -func (m *ThanosSeriesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ThanosSeriesResponse.Merge(m, src) -} -func (m *ThanosSeriesResponse) XXX_Size() int { - return m.Size() -} -func (m *ThanosSeriesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ThanosSeriesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ThanosSeriesResponse proto.InternalMessageInfo -type ResponseHeader struct { - Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"-"` - Values []string `protobuf:"bytes,2,rep,name=Values,proto3" json:"-"` +func (x *ThanosLabelsResponse) GetData() []string { + if x != nil { + return x.Data + } + return nil } -func (m *ResponseHeader) Reset() { *m = ResponseHeader{} } -func (m *ResponseHeader) String() string { return proto.CompactTextString(m) } -func (*ResponseHeader) ProtoMessage() {} -func (*ResponseHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_b882fa7024d92f38, []int{2} -} -func (m *ResponseHeader) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseHeader.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *ThanosLabelsResponse) GetErrorType() string { + if x != nil { + return x.ErrorType } -} -func (m *ResponseHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseHeader.Merge(m, src) -} -func (m *ResponseHeader) XXX_Size() int { - return m.Size() -} -func (m *ResponseHeader) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseHeader.DiscardUnknown(m) + return "" } -var xxx_messageInfo_ResponseHeader proto.InternalMessageInfo +func (x *ThanosLabelsResponse) GetError() string { + if x != nil { + return x.Error + } + return "" +} -func init() { - proto.RegisterType((*ThanosLabelsResponse)(nil), "queryfrontend.ThanosLabelsResponse") - proto.RegisterType((*ThanosSeriesResponse)(nil), "queryfrontend.ThanosSeriesResponse") - proto.RegisterType((*ResponseHeader)(nil), "queryfrontend.ResponseHeader") +func (x *ThanosLabelsResponse) GetHeaders() []*ResponseHeader { + if x != nil { + return x.Headers + } + return nil } -func init() { proto.RegisterFile("queryfrontend/response.proto", fileDescriptor_b882fa7024d92f38) } +type ThanosSeriesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -var fileDescriptor_b882fa7024d92f38 = []byte{ - // 367 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x92, 0x41, 0x4f, 0xea, 0x40, - 0x14, 0x85, 0x5b, 0x28, 0x7d, 0x8f, 0xe1, 0x3d, 0x8d, 0x03, 0x89, 0x85, 0x40, 0x4b, 0x58, 0x61, - 0xa2, 0x6d, 0x02, 0x71, 0xeb, 0xa2, 0xd1, 0xc4, 0x18, 0xe3, 0xa2, 0x10, 0x17, 0xee, 0x86, 0x70, - 0x45, 0x12, 0xe8, 0xd4, 0x99, 0x61, 0xd1, 0x7f, 0xa1, 0xff, 0x8a, 0x25, 0x4b, 0x57, 0x8d, 0xc2, - 0xae, 0x3f, 0xc1, 0x95, 0x61, 0x3a, 0x8d, 0xb0, 0x74, 0xe9, 0x6e, 0xe6, 0x9c, 0xef, 0xde, 0xe4, - 0x9c, 0x5c, 0xd4, 0x7c, 0x5e, 0x00, 0x8b, 0x1f, 0x19, 0x0d, 0x05, 0x84, 0x63, 0x8f, 0x01, 0x8f, - 0x68, 0xc8, 0xc1, 0x8d, 0x18, 0x15, 0x14, 0xff, 0xdf, 0x73, 0x1b, 0xb5, 0x09, 0x9d, 0x50, 0xe9, - 0x78, 0xdb, 0x57, 0x06, 0x35, 0xea, 0x5c, 0x50, 0x06, 0xde, 0x8c, 0x8c, 0x60, 0x16, 0x8d, 0x3c, - 0x11, 0x47, 0xc0, 0x33, 0xab, 0xf3, 0xa9, 0xa3, 0xda, 0xf0, 0x89, 0x84, 0x94, 0xdf, 0x6e, 0x5d, - 0x1e, 0xa8, 0xf5, 0xb8, 0x83, 0xcc, 0x81, 0x20, 0x62, 0xc1, 0x2d, 0xbd, 0xad, 0x77, 0xcb, 0x3e, - 0x4a, 0x13, 0xc7, 0xe4, 0x52, 0x09, 0x94, 0x83, 0x9b, 0xc8, 0xb8, 0x24, 0x82, 0x58, 0x85, 0x76, - 0xb1, 0x5b, 0xf6, 0xff, 0xa6, 0x89, 0x63, 0x8c, 0x89, 0x20, 0x81, 0x54, 0xf1, 0x39, 0x2a, 0x5f, - 0x31, 0x46, 0xd9, 0x30, 0x8e, 0xc0, 0x2a, 0xca, 0x25, 0xc7, 0x69, 0xe2, 0x54, 0x21, 0x17, 0x4f, - 0xe9, 0x7c, 0x2a, 0x60, 0x1e, 0x89, 0x38, 0xf8, 0x26, 0xf1, 0x09, 0x2a, 0xc9, 0x8f, 0x65, 0xc8, - 0x91, 0x6a, 0x9a, 0x38, 0x87, 0x72, 0x64, 0x07, 0xcf, 0x08, 0x7c, 0x81, 0xfe, 0x5c, 0x03, 0x19, - 0x03, 0xe3, 0x56, 0xa9, 0x5d, 0xec, 0x56, 0x7a, 0x2d, 0x77, 0xaf, 0x0e, 0x37, 0x4f, 0x93, 0x51, - 0x7e, 0x29, 0x4d, 0x1c, 0xfd, 0x2c, 0xc8, 0x87, 0x3a, 0xaf, 0x85, 0x3c, 0xfc, 0x00, 0xd8, 0x14, - 0x7e, 0x16, 0xbe, 0xbf, 0x13, 0xbe, 0xd2, 0x3b, 0x72, 0x85, 0x5c, 0xe4, 0x3e, 0xc8, 0x1e, 0x07, - 0x20, 0xfc, 0x7f, 0xcb, 0xc4, 0xd1, 0x7e, 0x5d, 0x27, 0x37, 0xe8, 0x60, 0x9f, 0xc0, 0x75, 0x64, - 0xdc, 0x91, 0x39, 0xa8, 0x2a, 0x14, 0x2f, 0x25, 0xdc, 0x42, 0xe6, 0x3d, 0x99, 0x2d, 0x80, 0xab, - 0x13, 0x50, 0xa6, 0x12, 0xfd, 0xe6, 0xf2, 0xc3, 0xd6, 0x96, 0x6b, 0x5b, 0x5f, 0xad, 0x6d, 0xfd, - 0x7d, 0x6d, 0xeb, 0x2f, 0x1b, 0x5b, 0x5b, 0x6d, 0x6c, 0xed, 0x6d, 0x63, 0x6b, 0x23, 0x53, 0x5e, - 0x60, 0xff, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x6d, 0x4c, 0xcd, 0xdf, 0xe1, 0x02, 0x00, 0x00, + Status string `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"` + Data []*labelpb.LabelSet `protobuf:"bytes,2,rep,name=Data,proto3" json:"data"` + ErrorType string `protobuf:"bytes,3,opt,name=ErrorType,proto3" json:"errorType,omitempty"` + Error string `protobuf:"bytes,4,opt,name=Error,proto3" json:"error,omitempty"` + Headers []*ResponseHeader `protobuf:"bytes,5,rep,name=Headers,proto3" json:"-"` } -func (m *ThanosLabelsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *ThanosSeriesResponse) Reset() { + *x = ThanosSeriesResponse{} + mi := &file_queryfrontend_response_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ThanosLabelsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *ThanosSeriesResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ThanosLabelsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Headers) > 0 { - for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Headers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintResponse(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.Error) > 0 { - i -= len(m.Error) - copy(dAtA[i:], m.Error) - i = encodeVarintResponse(dAtA, i, uint64(len(m.Error))) - i-- - dAtA[i] = 0x22 - } - if len(m.ErrorType) > 0 { - i -= len(m.ErrorType) - copy(dAtA[i:], m.ErrorType) - i = encodeVarintResponse(dAtA, i, uint64(len(m.ErrorType))) - i-- - dAtA[i] = 0x1a - } - if len(m.Data) > 0 { - for iNdEx := len(m.Data) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Data[iNdEx]) - copy(dAtA[i:], m.Data[iNdEx]) - i = encodeVarintResponse(dAtA, i, uint64(len(m.Data[iNdEx]))) - i-- - dAtA[i] = 0x12 +func (*ThanosSeriesResponse) ProtoMessage() {} + +func (x *ThanosSeriesResponse) ProtoReflect() protoreflect.Message { + mi := &file_queryfrontend_response_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if len(m.Status) > 0 { - i -= len(m.Status) - copy(dAtA[i:], m.Status) - i = encodeVarintResponse(dAtA, i, uint64(len(m.Status))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return mi.MessageOf(x) } -func (m *ThanosSeriesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +// Deprecated: Use ThanosSeriesResponse.ProtoReflect.Descriptor instead. +func (*ThanosSeriesResponse) Descriptor() ([]byte, []int) { + return file_queryfrontend_response_proto_rawDescGZIP(), []int{1} } -func (m *ThanosSeriesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *ThanosSeriesResponse) GetStatus() string { + if x != nil { + return x.Status + } + return "" } -func (m *ThanosSeriesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Headers) > 0 { - for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Headers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintResponse(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } +func (x *ThanosSeriesResponse) GetData() []*labelpb.LabelSet { + if x != nil { + return x.Data } - if len(m.Error) > 0 { - i -= len(m.Error) - copy(dAtA[i:], m.Error) - i = encodeVarintResponse(dAtA, i, uint64(len(m.Error))) - i-- - dAtA[i] = 0x22 - } - if len(m.ErrorType) > 0 { - i -= len(m.ErrorType) - copy(dAtA[i:], m.ErrorType) - i = encodeVarintResponse(dAtA, i, uint64(len(m.ErrorType))) - i-- - dAtA[i] = 0x1a - } - if len(m.Data) > 0 { - for iNdEx := len(m.Data) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Data[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintResponse(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Status) > 0 { - i -= len(m.Status) - copy(dAtA[i:], m.Status) - i = encodeVarintResponse(dAtA, i, uint64(len(m.Status))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return nil } -func (m *ResponseHeader) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ThanosSeriesResponse) GetErrorType() string { + if x != nil { + return x.ErrorType } - return dAtA[:n], nil + return "" } -func (m *ResponseHeader) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *ThanosSeriesResponse) GetError() string { + if x != nil { + return x.Error + } + return "" } -func (m *ResponseHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Values) > 0 { - for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Values[iNdEx]) - copy(dAtA[i:], m.Values[iNdEx]) - i = encodeVarintResponse(dAtA, i, uint64(len(m.Values[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintResponse(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa +func (x *ThanosSeriesResponse) GetHeaders() []*ResponseHeader { + if x != nil { + return x.Headers } - return len(dAtA) - i, nil + return nil } -func encodeVarintResponse(dAtA []byte, offset int, v uint64) int { - offset -= sovResponse(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base +type ResponseHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"-"` + Values []string `protobuf:"bytes,2,rep,name=Values,proto3" json:"-"` } -func (m *ThanosLabelsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Status) - if l > 0 { - n += 1 + l + sovResponse(uint64(l)) - } - if len(m.Data) > 0 { - for _, s := range m.Data { - l = len(s) - n += 1 + l + sovResponse(uint64(l)) - } - } - l = len(m.ErrorType) - if l > 0 { - n += 1 + l + sovResponse(uint64(l)) - } - l = len(m.Error) - if l > 0 { - n += 1 + l + sovResponse(uint64(l)) - } - if len(m.Headers) > 0 { - for _, e := range m.Headers { - l = e.Size() - n += 1 + l + sovResponse(uint64(l)) - } - } - return n + +func (x *ResponseHeader) Reset() { + *x = ResponseHeader{} + mi := &file_queryfrontend_response_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ThanosSeriesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Status) - if l > 0 { - n += 1 + l + sovResponse(uint64(l)) - } - if len(m.Data) > 0 { - for _, e := range m.Data { - l = e.Size() - n += 1 + l + sovResponse(uint64(l)) - } - } - l = len(m.ErrorType) - if l > 0 { - n += 1 + l + sovResponse(uint64(l)) - } - l = len(m.Error) - if l > 0 { - n += 1 + l + sovResponse(uint64(l)) - } - if len(m.Headers) > 0 { - for _, e := range m.Headers { - l = e.Size() - n += 1 + l + sovResponse(uint64(l)) - } - } - return n +func (x *ResponseHeader) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ResponseHeader) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovResponse(uint64(l)) - } - if len(m.Values) > 0 { - for _, s := range m.Values { - l = len(s) - n += 1 + l + sovResponse(uint64(l)) +func (*ResponseHeader) ProtoMessage() {} + +func (x *ResponseHeader) ProtoReflect() protoreflect.Message { + mi := &file_queryfrontend_response_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - return n + return mi.MessageOf(x) } -func sovResponse(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozResponse(x uint64) (n int) { - return sovResponse(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +// Deprecated: Use ResponseHeader.ProtoReflect.Descriptor instead. +func (*ResponseHeader) Descriptor() ([]byte, []int) { + return file_queryfrontend_response_proto_rawDescGZIP(), []int{2} } -func (m *ThanosLabelsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ThanosLabelsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ThanosLabelsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthResponse - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthResponse - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Status = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthResponse - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthResponse - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ErrorType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthResponse - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthResponse - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ErrorType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthResponse - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthResponse - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Error = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthResponse - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthResponse - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Headers = append(m.Headers, &ResponseHeader{}) - if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipResponse(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthResponse - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ResponseHeader) GetName() string { + if x != nil { + return x.Name } - return nil + return "" } -func (m *ThanosSeriesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ThanosSeriesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ThanosSeriesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthResponse - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthResponse - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Status = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthResponse - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthResponse - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data, labelpb.ZLabelSet{}) - if err := m.Data[len(m.Data)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ErrorType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthResponse - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthResponse - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ErrorType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthResponse - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthResponse - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Error = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthResponse - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthResponse - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Headers = append(m.Headers, &ResponseHeader{}) - if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipResponse(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthResponse - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ResponseHeader) GetValues() []string { + if x != nil { + return x.Values } return nil } -func (m *ResponseHeader) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseHeader: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseHeader: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthResponse - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthResponse - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthResponse - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthResponse - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Values = append(m.Values, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipResponse(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthResponse - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipResponse(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowResponse - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowResponse - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowResponse - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthResponse - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupResponse - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthResponse - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF +var File_queryfrontend_response_proto protoreflect.FileDescriptor + +var file_queryfrontend_response_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2f, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x1a, 0x19, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x70, 0x62, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, + 0x2f, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2, 0x02, + 0x0a, 0x14, 0x54, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x12, 0x9a, 0x84, 0x9e, 0x03, 0x0d, 0x6a, 0x73, 0x6f, + 0x6e, 0x3a, 0x22, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x24, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, + 0x42, 0x10, 0x9a, 0x84, 0x9e, 0x03, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x64, 0x61, 0x74, + 0x61, 0x22, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x3d, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0x9a, 0x84, 0x9e, + 0x03, 0x1a, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x79, 0x70, + 0x65, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x52, 0x09, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x31, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0x9a, 0x84, 0x9e, 0x03, 0x16, 0x6a, 0x73, 0x6f, + 0x6e, 0x3a, 0x22, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, + 0x74, 0x79, 0x22, 0x52, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x46, 0x0a, 0x07, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x42, 0x0d, 0x9a, 0x84, 0x9e, 0x03, + 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x2d, 0x22, 0x52, 0x07, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x73, 0x22, 0xb4, 0x02, 0x0a, 0x14, 0x54, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x53, 0x65, 0x72, + 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x12, 0x9a, 0x84, 0x9e, + 0x03, 0x0d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x52, + 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x36, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x74, 0x42, 0x10, 0x9a, 0x84, 0x9e, 0x03, 0x0b, 0x6a, 0x73, + 0x6f, 0x6e, 0x3a, 0x22, 0x64, 0x61, 0x74, 0x61, 0x22, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x3d, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x1f, 0x9a, 0x84, 0x9e, 0x03, 0x1a, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, + 0x74, 0x79, 0x22, 0x52, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x31, + 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0x9a, + 0x84, 0x9e, 0x03, 0x16, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2c, + 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x52, 0x05, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x12, 0x46, 0x0a, 0x07, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x42, 0x0d, 0x9a, 0x84, 0x9e, 0x03, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x2d, 0x22, + 0x52, 0x07, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x22, 0x5a, 0x0a, 0x0e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x04, 0x4e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0x9a, 0x84, 0x9e, 0x03, 0x08, + 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x2d, 0x22, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, + 0x0a, 0x06, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x0d, + 0x9a, 0x84, 0x9e, 0x03, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x2d, 0x22, 0x52, 0x06, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x74, 0x68, + 0x61, 0x6e, 0x6f, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x66, 0x72, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - ErrInvalidLengthResponse = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowResponse = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupResponse = fmt.Errorf("proto: unexpected end of group") + file_queryfrontend_response_proto_rawDescOnce sync.Once + file_queryfrontend_response_proto_rawDescData = file_queryfrontend_response_proto_rawDesc ) + +func file_queryfrontend_response_proto_rawDescGZIP() []byte { + file_queryfrontend_response_proto_rawDescOnce.Do(func() { + file_queryfrontend_response_proto_rawDescData = protoimpl.X.CompressGZIP(file_queryfrontend_response_proto_rawDescData) + }) + return file_queryfrontend_response_proto_rawDescData +} + +var file_queryfrontend_response_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_queryfrontend_response_proto_goTypes = []any{ + (*ThanosLabelsResponse)(nil), // 0: queryfrontend.ThanosLabelsResponse + (*ThanosSeriesResponse)(nil), // 1: queryfrontend.ThanosSeriesResponse + (*ResponseHeader)(nil), // 2: queryfrontend.ResponseHeader + (*labelpb.LabelSet)(nil), // 3: thanos.LabelSet +} +var file_queryfrontend_response_proto_depIdxs = []int32{ + 2, // 0: queryfrontend.ThanosLabelsResponse.Headers:type_name -> queryfrontend.ResponseHeader + 3, // 1: queryfrontend.ThanosSeriesResponse.Data:type_name -> thanos.LabelSet + 2, // 2: queryfrontend.ThanosSeriesResponse.Headers:type_name -> queryfrontend.ResponseHeader + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_queryfrontend_response_proto_init() } +func file_queryfrontend_response_proto_init() { + if File_queryfrontend_response_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_queryfrontend_response_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_queryfrontend_response_proto_goTypes, + DependencyIndexes: file_queryfrontend_response_proto_depIdxs, + MessageInfos: file_queryfrontend_response_proto_msgTypes, + }.Build() + File_queryfrontend_response_proto = out.File + file_queryfrontend_response_proto_rawDesc = nil + file_queryfrontend_response_proto_goTypes = nil + file_queryfrontend_response_proto_depIdxs = nil +} diff --git a/pkg/queryfrontend/response.proto b/pkg/queryfrontend/response.proto index 69bf2c06e5e..69bf0bfb439 100644 --- a/pkg/queryfrontend/response.proto +++ b/pkg/queryfrontend/response.proto @@ -5,38 +5,28 @@ syntax = "proto3"; package queryfrontend; -import "gogoproto/gogo.proto"; import "store/labelpb/types.proto"; +import "tagger/tagger.proto"; -option (gogoproto.sizer_all) = true; -option (gogoproto.marshaler_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; - +option go_package = "github.com/thanos-io/thanos/pkg/queryfrontend"; message ThanosLabelsResponse { - string Status = 1 [(gogoproto.jsontag) = "status"]; - repeated string Data = 2 [(gogoproto.jsontag) = "data"]; - string ErrorType = 3 [(gogoproto.jsontag) = "errorType,omitempty"]; - string Error = 4 [(gogoproto.jsontag) = "error,omitempty"]; - repeated ResponseHeader Headers = 5 [(gogoproto.jsontag) = "-"]; + string Status = 1 [(tagger.tags) = "json:\"status\""]; + repeated string Data = 2 [(tagger.tags) = "json:\"data\""]; + string ErrorType = 3 [(tagger.tags) = "json:\"errorType,omitempty\""]; + string Error = 4 [(tagger.tags) = "json:\"error,omitempty\""]; + repeated ResponseHeader Headers = 5 [(tagger.tags) = "json:\"-\""]; } message ThanosSeriesResponse { - string Status = 1 [(gogoproto.jsontag) = "status"]; - repeated thanos.ZLabelSet Data = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "data"]; - string ErrorType = 3 [(gogoproto.jsontag) = "errorType,omitempty"]; - string Error = 4 [(gogoproto.jsontag) = "error,omitempty"]; - repeated ResponseHeader Headers = 5 [(gogoproto.jsontag) = "-"]; + string Status = 1 [(tagger.tags) = "json:\"status\""]; + repeated thanos.LabelSet Data = 2 [(tagger.tags) = "json:\"data\""]; + string ErrorType = 3 [(tagger.tags) = "json:\"errorType,omitempty\""]; + string Error = 4 [(tagger.tags) = "json:\"error,omitempty\""]; + repeated ResponseHeader Headers = 5 [(tagger.tags) = "json:\"-\""]; } message ResponseHeader { - string Name = 1 [(gogoproto.jsontag) = "-"]; - repeated string Values = 2 [(gogoproto.jsontag) = "-"]; + string Name = 1 [(tagger.tags) = "json:\"-\""]; + repeated string Values = 2 [(tagger.tags) = "json:\"-\""]; } diff --git a/pkg/queryfrontend/response_vtproto.pb.go b/pkg/queryfrontend/response_vtproto.pb.go new file mode 100644 index 00000000000..e5ec9505da2 --- /dev/null +++ b/pkg/queryfrontend/response_vtproto.pb.go @@ -0,0 +1,1084 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.1-0.20250313105119-ba97887b0a25 +// source: queryfrontend/response.proto + +package queryfrontend + +import ( + fmt "fmt" + io "io" + + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *ThanosLabelsResponse) CloneVT() *ThanosLabelsResponse { + if m == nil { + return (*ThanosLabelsResponse)(nil) + } + r := new(ThanosLabelsResponse) + r.Status = m.Status + r.ErrorType = m.ErrorType + r.Error = m.Error + if rhs := m.Data; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Data = tmpContainer + } + if rhs := m.Headers; rhs != nil { + tmpContainer := make([]*ResponseHeader, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Headers = tmpContainer + } + return r +} + +func (m *ThanosLabelsResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ThanosSeriesResponse) CloneVT() *ThanosSeriesResponse { + if m == nil { + return (*ThanosSeriesResponse)(nil) + } + r := new(ThanosSeriesResponse) + r.Status = m.Status + r.ErrorType = m.ErrorType + r.Error = m.Error + if rhs := m.Data; rhs != nil { + tmpContainer := make([]*labelpb.LabelSet, len(rhs)) + for k, v := range rhs { + if vtpb, ok := interface{}(v).(interface{ CloneVT() *labelpb.LabelSet }); ok { + tmpContainer[k] = vtpb.CloneVT() + } else { + tmpContainer[k] = proto.Clone(v).(*labelpb.LabelSet) + } + } + r.Data = tmpContainer + } + if rhs := m.Headers; rhs != nil { + tmpContainer := make([]*ResponseHeader, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Headers = tmpContainer + } + return r +} + +func (m *ThanosSeriesResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ResponseHeader) CloneVT() *ResponseHeader { + if m == nil { + return (*ResponseHeader)(nil) + } + r := new(ResponseHeader) + r.Name = m.Name + if rhs := m.Values; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Values = tmpContainer + } + return r +} + +func (m *ResponseHeader) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *ThanosLabelsResponse) EqualVT(that *ThanosLabelsResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Status != that.Status { + return false + } + if len(this.Data) != len(that.Data) { + return false + } + for i, vx := range this.Data { + vy := that.Data[i] + if vx != vy { + return false + } + } + if this.ErrorType != that.ErrorType { + return false + } + if this.Error != that.Error { + return false + } + if len(this.Headers) != len(that.Headers) { + return false + } + for i, vx := range this.Headers { + vy := that.Headers[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &ResponseHeader{} + } + if q == nil { + q = &ResponseHeader{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *ThanosLabelsResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ThanosLabelsResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ThanosSeriesResponse) EqualVT(that *ThanosSeriesResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Status != that.Status { + return false + } + if len(this.Data) != len(that.Data) { + return false + } + for i, vx := range this.Data { + vy := that.Data[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &labelpb.LabelSet{} + } + if q == nil { + q = &labelpb.LabelSet{} + } + if equal, ok := interface{}(p).(interface{ EqualVT(*labelpb.LabelSet) bool }); ok { + if !equal.EqualVT(q) { + return false + } + } else if !proto.Equal(p, q) { + return false + } + } + } + if this.ErrorType != that.ErrorType { + return false + } + if this.Error != that.Error { + return false + } + if len(this.Headers) != len(that.Headers) { + return false + } + for i, vx := range this.Headers { + vy := that.Headers[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &ResponseHeader{} + } + if q == nil { + q = &ResponseHeader{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *ThanosSeriesResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ThanosSeriesResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ResponseHeader) EqualVT(that *ResponseHeader) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Name != that.Name { + return false + } + if len(this.Values) != len(that.Values) { + return false + } + for i, vx := range this.Values { + vy := that.Values[i] + if vx != vy { + return false + } + } + return true +} + +func (this *ResponseHeader) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ResponseHeader) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *ThanosLabelsResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ThanosLabelsResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ThanosLabelsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Headers) > 0 { + for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Headers[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + } + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0x22 + } + if len(m.ErrorType) > 0 { + i -= len(m.ErrorType) + copy(dAtA[i:], m.ErrorType) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ErrorType))) + i-- + dAtA[i] = 0x1a + } + if len(m.Data) > 0 { + for iNdEx := len(m.Data) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Data[iNdEx]) + copy(dAtA[i:], m.Data[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Data[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Status) > 0 { + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ThanosSeriesResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ThanosSeriesResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ThanosSeriesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Headers) > 0 { + for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Headers[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + } + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0x22 + } + if len(m.ErrorType) > 0 { + i -= len(m.ErrorType) + copy(dAtA[i:], m.ErrorType) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ErrorType))) + i-- + dAtA[i] = 0x1a + } + if len(m.Data) > 0 { + for iNdEx := len(m.Data) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.Data[iNdEx]).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Data[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Status) > 0 { + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ResponseHeader) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResponseHeader) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ResponseHeader) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Values) > 0 { + for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Values[iNdEx]) + copy(dAtA[i:], m.Values[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Values[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ThanosLabelsResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Status) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Data) > 0 { + for _, s := range m.Data { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + l = len(m.ErrorType) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Error) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Headers) > 0 { + for _, e := range m.Headers { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *ThanosSeriesResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Status) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Data) > 0 { + for _, e := range m.Data { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + l = len(m.ErrorType) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Error) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Headers) > 0 { + for _, e := range m.Headers { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *ResponseHeader) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Values) > 0 { + for _, s := range m.Values { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *ThanosLabelsResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ThanosLabelsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ThanosLabelsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ErrorType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ErrorType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Headers = append(m.Headers, &ResponseHeader{}) + if err := m.Headers[len(m.Headers)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ThanosSeriesResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ThanosSeriesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ThanosSeriesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data, &labelpb.LabelSet{}) + if unmarshal, ok := interface{}(m.Data[len(m.Data)-1]).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Data[len(m.Data)-1]); err != nil { + return err + } + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ErrorType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ErrorType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Headers = append(m.Headers, &ResponseHeader{}) + if err := m.Headers[len(m.Headers)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResponseHeader) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResponseHeader: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResponseHeader: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Values = append(m.Values, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pkg/queryfrontend/roundtrip_test.go b/pkg/queryfrontend/roundtrip_test.go index 01f35b6510a..9970752817e 100644 --- a/pkg/queryfrontend/roundtrip_test.go +++ b/pkg/queryfrontend/roundtrip_test.go @@ -931,7 +931,7 @@ func promqlResultsWithFailures(numFailures int) (*atomic.Int64, http.Handler) { func labelsResults(fail bool) (*int, http.Handler) { count := 0 var lock sync.Mutex - q := ThanosLabelsResponse{ + q := &ThanosLabelsResponse{ Status: "success", Data: []string{"__name__", "job"}, } @@ -955,9 +955,9 @@ func labelsResults(fail bool) (*int, http.Handler) { func seriesResults(fail bool) (*int, http.Handler) { count := 0 var lock sync.Mutex - q := ThanosSeriesResponse{ + q := &ThanosSeriesResponse{ Status: "success", - Data: []labelpb.ZLabelSet{{Labels: []labelpb.ZLabel{{Name: "__name__", Value: "up"}, {Name: "foo", Value: "bar"}}}}, + Data: []*labelpb.LabelSet{{Labels: []*labelpb.Label{{Name: "__name__", Value: "up"}, {Name: "foo", Value: "bar"}}}}, } return &count, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { diff --git a/pkg/receive/aligned_hashring.go b/pkg/receive/aligned_hashring.go deleted file mode 100644 index 30203fbb90d..00000000000 --- a/pkg/receive/aligned_hashring.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) The Thanos Authors. -// Licensed under the Apache License 2.0. - -package receive - -import ( - "fmt" - "sort" - "strconv" - - "github.com/cespare/xxhash" - "github.com/pkg/errors" - - "github.com/thanos-io/thanos/pkg/strutil" -) - -// groupByAZ groups endpoints by Availability Zone and sorts them by their inferred ordinal in a k8s statefulset. -// It returns a 2D slice where each inner slice represents an AZ (sorted alphabetically) -// and contains endpoints sorted by ordinal. All inner slices are truncated to the -// length of the largest common sequence of ordinals starting from 0 across all AZs. -// All endpoint addresses must be valid k8s DNS names with 0-index ordinals at the end of the pod name. -func groupByAZ(endpoints []Endpoint) ([][]Endpoint, error) { - if len(endpoints) == 0 { - return nil, errors.New("no endpoints provided") - } - - // Group endpoints by AZ and then by ordinal. - azEndpoints := make(map[string]map[int]Endpoint) - for _, ep := range endpoints { - ordinal, err := strutil.ExtractPodOrdinal(ep.Address) - if err != nil { - return nil, errors.Wrapf(err, "failed to extract ordinal from address %s", ep.Address) - } - if _, ok := azEndpoints[ep.AZ]; !ok { - azEndpoints[ep.AZ] = make(map[int]Endpoint) - } - if _, exists := azEndpoints[ep.AZ][ordinal]; exists { - return nil, fmt.Errorf("duplicate endpoint ordinal %d for address %s in AZ %s", ordinal, ep.Address, ep.AZ) - } - azEndpoints[ep.AZ][ordinal] = ep - } - - // Get sorted list of AZ names. - sortedAZs := make([]string, 0, len(azEndpoints)) - for az := range azEndpoints { - sortedAZs = append(sortedAZs, az) - } - sort.Strings(sortedAZs) - - // Determine the maximum common ordinal across all AZs. - maxCommonOrdinal := -1 - for i := 0; ; i++ { - presentInAllAZs := true - for _, az := range sortedAZs { - if _, ok := azEndpoints[az][i]; !ok { - presentInAllAZs = false - if i == 0 { - return nil, fmt.Errorf("AZ %q is missing endpoint with ordinal 0", az) - } - break - } - } - if !presentInAllAZs { - maxCommonOrdinal = i - 1 - break - } - } - if maxCommonOrdinal < 0 { - return nil, errors.New("no common endpoints with ordinal 0 found across all AZs") - } - numAZs := len(sortedAZs) - result := make([][]Endpoint, numAZs) - for i, az := range sortedAZs { - result[i] = make([]Endpoint, 0, maxCommonOrdinal+1) - for j := 0; j <= maxCommonOrdinal; j++ { - result[i] = append(result[i], azEndpoints[az][j]) - } - } - return result, nil -} - -// newAlignedKetamaHashring creates a Ketama hash ring where replicas are strictly aligned across Availability Zones. -// Each section on the hash ring corresponds to a primary endpoint (taken from the first AZ) and its -// aligned replicas in other AZs (endpoints with the same ordinal). The hash for a section is calculated -// based *only* on the primary endpoint's address. -func newAlignedKetamaHashring(endpoints []Endpoint, sectionsPerNode int, replicationFactor uint64) (*ketamaHashring, error) { - if replicationFactor == 0 { - return nil, errors.New("replication factor cannot be zero") - } - if sectionsPerNode <= 0 { - return nil, errors.New("sections per node must be positive") - } - groupedEndpoints, err := groupByAZ(endpoints) - if err != nil { - return nil, errors.Wrap(err, "failed to group endpoints by AZ") - } - numAZs := len(groupedEndpoints) - if numAZs == 0 { - return nil, errors.New("no endpoint groups found after grouping by AZ") - } - if uint64(numAZs) != replicationFactor { - return nil, fmt.Errorf("number of AZs (%d) must equal replication factor (%d)", numAZs, replicationFactor) - } - numEndpointsPerAZ := len(groupedEndpoints[0]) - if numEndpointsPerAZ == 0 { - return nil, errors.New("AZ groups are empty after grouping") - } - totalEndpoints := numAZs * numEndpointsPerAZ - flatEndpoints := make([]Endpoint, 0, totalEndpoints) - for azIndex := 0; azIndex < numAZs; azIndex++ { - flatEndpoints = append(flatEndpoints, groupedEndpoints[azIndex]...) - } - hasher := xxhash.New() - ringSections := make(sections, 0, numEndpointsPerAZ*sectionsPerNode) - - // Iterate through primary endpoints (those in the first AZ) to define sections. - for primaryOrdinalIndex := 0; primaryOrdinalIndex < numEndpointsPerAZ; primaryOrdinalIndex++ { - primaryEndpoint := groupedEndpoints[0][primaryOrdinalIndex] - for sectionIndex := 1; sectionIndex <= sectionsPerNode; sectionIndex++ { - hasher.Reset() - _, _ = hasher.Write([]byte(primaryEndpoint.Address + ":" + strconv.Itoa(sectionIndex))) - sectionHash := hasher.Sum64() - sec := §ion{ - hash: sectionHash, - az: primaryEndpoint.AZ, - endpointIndex: uint64(primaryOrdinalIndex), - replicas: make([]uint64, 0, replicationFactor), - } - - // Find indices of all replicas (including primary) in the flat list and verify alignment. - for azIndex := 0; azIndex < numAZs; azIndex++ { - replicaFlatIndex := azIndex*numEndpointsPerAZ + primaryOrdinalIndex - replicaEndpoint := flatEndpoints[replicaFlatIndex] - replicaOrdinal, err := strutil.ExtractPodOrdinal(replicaEndpoint.Address) - if err != nil { - return nil, errors.Wrapf(err, "failed to extract ordinal from replica endpoint %s in AZ %s", replicaEndpoint.Address, replicaEndpoint.AZ) - } - if replicaOrdinal != primaryOrdinalIndex { - return nil, fmt.Errorf("ordinal mismatch for primary endpoint %s (ordinal %d): replica %s in AZ %s has ordinal %d", - primaryEndpoint.Address, primaryOrdinalIndex, replicaEndpoint.Address, replicaEndpoint.AZ, replicaOrdinal) - } - sec.replicas = append(sec.replicas, uint64(replicaFlatIndex)) - } - ringSections = append(ringSections, sec) - } - } - sort.Sort(ringSections) - return &ketamaHashring{ - endpoints: flatEndpoints, - sections: ringSections, - numEndpoints: uint64(totalEndpoints), - }, nil -} diff --git a/pkg/receive/aligned_hashring_test.go b/pkg/receive/aligned_hashring_test.go deleted file mode 100644 index c5e9feb611e..00000000000 --- a/pkg/receive/aligned_hashring_test.go +++ /dev/null @@ -1,378 +0,0 @@ -// Copyright (c) The Thanos Authors. -// Licensed under the Apache License 2.0. - -package receive - -import ( - "sort" - "strconv" - "strings" - "testing" - - "github.com/efficientgo/core/testutil" - "github.com/stretchr/testify/require" - "github.com/thanos-io/thanos/pkg/store/labelpb" - "github.com/thanos-io/thanos/pkg/store/storepb/prompb" - "github.com/thanos-io/thanos/pkg/strutil" -) - -// podDNS creates a DNS-like string for testing endpoint addresses. -func podDNS(name string, ordinal int) string { - return name + "-" + strconv.Itoa(ordinal) + ".test-svc.test-namespace.svc.cluster.local" -} - -func TestGroupByAZ(t *testing.T) { - // Test setup endpoints. - ep0a := Endpoint{Address: podDNS("pod", 0), AZ: "zone-a"} - ep1a := Endpoint{Address: podDNS("pod", 1), AZ: "zone-a"} - ep2a := Endpoint{Address: podDNS("pod", 2), AZ: "zone-a"} - ep0b := Endpoint{Address: podDNS("pod", 0), AZ: "zone-b"} - ep1b := Endpoint{Address: podDNS("pod", 1), AZ: "zone-b"} - ep0c := Endpoint{Address: podDNS("pod", 0), AZ: "zone-c"} - ep1c := Endpoint{Address: podDNS("pod", 1), AZ: "zone-c"} - invalidEp := Endpoint{Address: "invalid-address-format", AZ: "zone-a"} - duplicateEp0a := Endpoint{Address: podDNS("anotherpod", 0), AZ: "zone-a"} // Same ordinal (0) as ep0a in zone-a. - - testCases := map[string]struct { - inputEndpoints []Endpoint - expectedResult [][]Endpoint - expectError bool - errorContains string - }{ - "error on empty input": { - inputEndpoints: []Endpoint{}, - expectedResult: nil, - expectError: true, - errorContains: "no endpoints provided", - }, - "single AZ, multiple endpoints": { - inputEndpoints: []Endpoint{ep1a, ep0a, ep2a}, - expectedResult: [][]Endpoint{ - {ep0a, ep1a, ep2a}, - }, - expectError: false, - }, - "multiple AZs, balanced and ordered": { - inputEndpoints: []Endpoint{ep1a, ep0b, ep0a, ep1b}, - expectedResult: [][]Endpoint{ - {ep0a, ep1a}, - {ep0b, ep1b}, - }, - expectError: false, - }, - "multiple AZs, different counts, stops at first missing ordinal > 0": { - inputEndpoints: []Endpoint{ep1a, ep0b, ep0a, ep1b, ep2a, ep0c}, - expectedResult: [][]Endpoint{ - {ep0a}, - {ep0b}, - {ep0c}, - }, - expectError: false, - }, - "error if ordinal 0 missing in any AZ": { - inputEndpoints: []Endpoint{ep1a, ep2a, ep1b}, - expectedResult: nil, - expectError: true, - errorContains: "missing endpoint with ordinal 0", - }, - "error if ordinal 0 missing in only one AZ": { - inputEndpoints: []Endpoint{ep0a, ep1a, ep1b}, - expectedResult: nil, - expectError: true, - errorContains: `AZ "zone-b" is missing endpoint with ordinal 0`, - }, - "error on invalid address format": { - inputEndpoints: []Endpoint{ep0a, invalidEp, ep0b}, - expectedResult: nil, - expectError: true, - errorContains: "failed to extract ordinal from address invalid-address-format", - }, - "error on duplicate ordinal within an AZ": { - inputEndpoints: []Endpoint{ep0a, ep1a, ep0b, duplicateEp0a}, - expectedResult: nil, - expectError: true, - errorContains: "duplicate endpoint ordinal 0 for address " + duplicateEp0a.Address + " in AZ zone-a", - }, - "AZ sorting check": { - inputEndpoints: []Endpoint{ep0b, ep0c, ep0a}, - expectedResult: [][]Endpoint{ - {ep0a}, - {ep0b}, - {ep0c}, - }, - expectError: false, - }, - "multiple AZs, stops correctly when next ordinal missing everywhere": { - inputEndpoints: []Endpoint{ep1a, ep0b, ep0a, ep1b, ep0c, ep1c}, - expectedResult: [][]Endpoint{ - {ep0a, ep1a}, - {ep0b, ep1b}, - {ep0c, ep1c}, - }, - expectError: false, - }, - } - - for tcName, tc := range testCases { - t.Run(tcName, func(t *testing.T) { - result, err := groupByAZ(tc.inputEndpoints) - - if tc.expectError { - testutil.NotOk(t, err) - if tc.errorContains != "" { - testutil.Assert(t, strings.Contains(err.Error(), tc.errorContains), "Expected error message to contain '%s', but got: %v", tc.errorContains, err) - } - testutil.Assert(t, result == nil, "Expected nil result on error, got: %v", result) - } else { - testutil.Ok(t, err) - testutil.Equals(t, tc.expectedResult, result) - - // Verify outer slice (AZs) is sorted alphabetically. - if err == nil && len(result) > 1 { - azOrderCorrect := sort.SliceIsSorted(result, func(i, j int) bool { - return result[i][0].AZ < result[j][0].AZ - }) - testutil.Assert(t, azOrderCorrect, "Outer slice is not sorted by AZ") - } - } - }) - } -} - -func TestAlignedKetamaHashringGet(t *testing.T) { - t.Parallel() - - ep0a := Endpoint{Address: podDNS("pod", 0), AZ: "zone-a"} - ep1a := Endpoint{Address: podDNS("pod", 1), AZ: "zone-a"} - ep0b := Endpoint{Address: podDNS("pod", 0), AZ: "zone-b"} - ep1b := Endpoint{Address: podDNS("pod", 1), AZ: "zone-b"} - ep0c := Endpoint{Address: podDNS("pod", 0), AZ: "zone-c"} - ep1c := Endpoint{Address: podDNS("pod", 1), AZ: "zone-c"} - invalidEp := Endpoint{Address: "invalid-address", AZ: "zone-a"} - duplicateEp0a := Endpoint{Address: podDNS("anotherpod", 0), AZ: "zone-a"} - - tsForReplicaTest := &prompb.TimeSeries{ - Labels: []labelpb.ZLabel{{Name: "test", Value: "replica-routing"}}, - } - - testCases := map[string]struct { - inputEndpoints []Endpoint - replicationFactor uint64 - sectionsPerNode int - - tenant string - ts *prompb.TimeSeries - n uint64 - expectedEndpoint Endpoint - - expectConstructorError bool - constructorErrorContains string - expectGetNError bool - getNErrorContains string - }{ - "valid 2 AZs, RF=2, get replica 0": { - inputEndpoints: []Endpoint{ep1a, ep0b, ep0a, ep1b}, - replicationFactor: 2, - sectionsPerNode: SectionsPerNode, - tenant: "tenant1", - ts: tsForReplicaTest, - n: 0, - expectedEndpoint: ep0a, - expectConstructorError: false, - expectGetNError: false, - }, - "valid 2 AZs, RF=2, get replica 1": { - inputEndpoints: []Endpoint{ep1a, ep0b, ep0a, ep1b}, - replicationFactor: 2, - sectionsPerNode: SectionsPerNode, - tenant: "tenant1", - ts: tsForReplicaTest, - n: 1, - expectedEndpoint: ep0b, - expectConstructorError: false, - expectGetNError: false, - }, - "valid 3 AZs, RF=3, get replica 0": { - inputEndpoints: []Endpoint{ep1a, ep0b, ep0a, ep1b, ep0c, ep1c}, - replicationFactor: 3, - sectionsPerNode: SectionsPerNode, - tenant: "tenant1", - ts: tsForReplicaTest, - n: 0, - expectedEndpoint: ep0a, - expectConstructorError: false, - expectGetNError: false, - }, - "valid 3 AZs, RF=3, get replica 1": { - inputEndpoints: []Endpoint{ep1a, ep0b, ep0a, ep1b, ep0c, ep1c}, - replicationFactor: 3, - sectionsPerNode: SectionsPerNode, - tenant: "tenant1", - ts: tsForReplicaTest, - n: 1, - expectedEndpoint: ep0b, - expectConstructorError: false, - expectGetNError: false, - }, - "valid 3 AZs, RF=3, get replica 2": { - inputEndpoints: []Endpoint{ep1a, ep0b, ep0a, ep1b, ep0c, ep1c}, - replicationFactor: 3, - sectionsPerNode: SectionsPerNode, - tenant: "tenant1", - ts: tsForReplicaTest, - n: 2, - expectedEndpoint: ep0c, - expectConstructorError: false, - expectGetNError: false, - }, - "error: empty input": { - inputEndpoints: []Endpoint{}, - replicationFactor: 1, - sectionsPerNode: SectionsPerNode, - expectConstructorError: true, - constructorErrorContains: "no endpoints provided", - }, - "error: invalid address": { - inputEndpoints: []Endpoint{ep0a, invalidEp, ep0b}, - replicationFactor: 2, - sectionsPerNode: SectionsPerNode, - expectConstructorError: true, - constructorErrorContains: "failed to extract ordinal from address invalid-address", - }, - "error: duplicate ordinal": { - inputEndpoints: []Endpoint{ep0a, ep1a, ep0b, duplicateEp0a}, - replicationFactor: 2, - sectionsPerNode: SectionsPerNode, - expectConstructorError: true, - constructorErrorContains: "duplicate endpoint", - }, - "error: missing ordinal 0": { - inputEndpoints: []Endpoint{ep1a, ep1b}, - replicationFactor: 2, - sectionsPerNode: SectionsPerNode, - expectConstructorError: true, - constructorErrorContains: "failed to group endpoints by AZ: AZ \"zone-a\" is missing endpoint with ordinal 0", - }, - "error: AZ count != RF (too few AZs)": { - inputEndpoints: []Endpoint{ep0a, ep1a}, - replicationFactor: 2, - sectionsPerNode: SectionsPerNode, - expectConstructorError: true, - constructorErrorContains: "number of AZs (1) must equal replication factor (2)", - }, - "error: AZ count != RF (too many AZs)": { - inputEndpoints: []Endpoint{ep0a, ep1a, ep0b, ep1b, ep0c, ep1c}, - replicationFactor: 2, - sectionsPerNode: SectionsPerNode, - expectConstructorError: true, - constructorErrorContains: "number of AZs (3) must equal replication factor (2)", - }, - "constructor success with unbalanced AZs (uses common subset)": { - inputEndpoints: []Endpoint{ep0a, ep1a, ep0b}, - replicationFactor: 2, - sectionsPerNode: SectionsPerNode, - expectConstructorError: false, - }, - "error: GetN index out of bounds (n >= numEndpoints)": { - inputEndpoints: []Endpoint{ep1a, ep0b, ep0a, ep1b}, - replicationFactor: 2, - sectionsPerNode: SectionsPerNode, - tenant: "tenant1", - ts: tsForReplicaTest, - n: 4, - expectConstructorError: false, - expectGetNError: true, - getNErrorContains: "insufficient nodes; have 4, want 5", - }, - } - - for tcName, tc := range testCases { - t.Run(tcName, func(t *testing.T) { - hashRing, err := newAlignedKetamaHashring(tc.inputEndpoints, tc.sectionsPerNode, tc.replicationFactor) - - if tc.expectConstructorError { - require.Error(t, err, "Expected constructor error") - require.Nil(t, hashRing, "Hashring should be nil on constructor error") - if tc.constructorErrorContains != "" { - require.Contains(t, err.Error(), tc.constructorErrorContains, "Constructor error message mismatch") - } - return - } - - require.NoError(t, err, "Expected constructor to succeed") - require.NotNil(t, hashRing, "Hashring should not be nil on successful construction") - - if tc.ts == nil && !tc.expectGetNError { - return - } - if tc.ts == nil && tc.expectGetNError { - tc.ts = &prompb.TimeSeries{Labels: []labelpb.ZLabel{{Name: "dummy", Value: "dummy"}}} - } - - result, getNErr := hashRing.GetN(tc.tenant, tc.ts, tc.n) - if tc.expectGetNError { - require.Error(t, getNErr, "Expected GetN error") - if tc.getNErrorContains != "" { - require.Contains(t, getNErr.Error(), tc.getNErrorContains, "GetN error message mismatch") - } - } else { - require.NoError(t, getNErr, "Expected GetN to succeed") - testutil.Equals(t, tc.expectedEndpoint, result, "GetN returned unexpected endpoint") - } - }) - } -} - -func TestAlignedKetamaHashringReplicaOrdinals(t *testing.T) { - t.Parallel() - - var endpoints []Endpoint - for i := 0; i < 20; i++ { - endpoints = append(endpoints, Endpoint{Address: podDNS("pod", i), AZ: "zone-a"}) - } - for i := 0; i < 20; i++ { - endpoints = append(endpoints, Endpoint{Address: podDNS("pod", i), AZ: "zone-b"}) - } - for i := 0; i < 20; i++ { - endpoints = append(endpoints, Endpoint{Address: podDNS("pod", i), AZ: "zone-c"}) - } - replicationFactor := uint64(3) - sectionsPerNode := 10 - - hashRing, err := newAlignedKetamaHashring(endpoints, sectionsPerNode, replicationFactor) - require.NoError(t, err, "Aligned hashring constructor failed") - require.NotNil(t, hashRing, "Hashring should not be nil") - require.NotEmpty(t, hashRing.sections, "Hashring should contain sections") - - // Verify that all replicas within a section have the same ordinal. - for i, s := range hashRing.sections { - if len(s.replicas) == 0 { - continue - } - - expectedOrdinal := -1 - - for replicaNum, replicaIndex := range s.replicas { - require.Less(t, int(replicaIndex), len(hashRing.endpoints), - "Section %d (hash %d), Replica %d: index %d out of bounds for endpoints list (len %d)", - i, s.hash, replicaNum, replicaIndex, len(hashRing.endpoints)) - - endpoint := hashRing.endpoints[replicaIndex] - ordinal, err := strutil.ExtractPodOrdinal(endpoint.Address) - require.NoError(t, err, - "Section %d (hash %d), Replica %d: failed to extract ordinal from address %s", - i, s.hash, replicaNum, endpoint.Address) - - if expectedOrdinal == -1 { - expectedOrdinal = ordinal - } else { - require.Equal(t, expectedOrdinal, ordinal, - "Section %d (hash %d), Replica %d (%s): Mismatched ordinal. Expected %d, got %d. Replicas in section: %v", - i, s.hash, replicaNum, endpoint.Address, expectedOrdinal, ordinal, s.replicas) - } - } - if len(s.replicas) > 0 { - require.NotEqual(t, -1, expectedOrdinal, "Section %d (hash %d): Failed to determine expected ordinal for replicas %v", i, s.hash, s.replicas) - } - } -} diff --git a/pkg/receive/capnproto_server_bench_test.go b/pkg/receive/capnproto_server_bench_test.go index ba8d176dad2..54094604831 100644 --- a/pkg/receive/capnproto_server_bench_test.go +++ b/pkg/receive/capnproto_server_bench_test.go @@ -21,23 +21,23 @@ import ( func BenchmarkCapNProtoServer_SingleConcurrentClient(b *testing.B) { wreq := storepb.WriteRequest{ Tenant: "example-tenant", - Timeseries: []prompb.TimeSeries{ + Timeseries: []*prompb.TimeSeries{ { - Labels: []labelpb.ZLabel{ + Labels: labelpb.Labels{ {Name: "__name__", Value: "up"}, {Name: "job", Value: "prometheus"}, }, - Samples: []prompb.Sample{ + Samples: []*prompb.Sample{ {Timestamp: 1, Value: 1}, {Timestamp: 2, Value: 2}, }, }, { - Labels: []labelpb.ZLabel{ + Labels: labelpb.Labels{ {Name: "__name__", Value: "up"}, {Name: "job", Value: "thanos"}, }, - Samples: []prompb.Sample{ + Samples: []*prompb.Sample{ {Timestamp: 3, Value: 3}, {Timestamp: 4, Value: 4}, }, diff --git a/pkg/receive/capnproto_writer.go b/pkg/receive/capnproto_writer.go index e3f1fd6929f..946c02c4602 100644 --- a/pkg/receive/capnproto_writer.go +++ b/pkg/receive/capnproto_writer.go @@ -78,7 +78,7 @@ func (r *CapNProtoWriter) Write(ctx context.Context, tenantID string, wreq *writ // Check if time series labels are valid. If not, skip the time series // and report the error. if err := validateLabels(series.Labels); err != nil { - lset := &labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(series.Labels)} + lset := &labelpb.LabelSet{Labels: labelpb.FromPromLabels(series.Labels)} errorTracker.addLabelsError(err, lset, tLogger) continue } diff --git a/pkg/receive/config.go b/pkg/receive/config.go index 75bda21e491..0a4a4127644 100644 --- a/pkg/receive/config.go +++ b/pkg/receive/config.go @@ -22,7 +22,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/model/labels" + "github.com/thanos-io/thanos/pkg/store/labelpb" ) var ( @@ -67,6 +67,7 @@ type Endpoint struct { Address string `json:"address"` CapNProtoAddress string `json:"capnproto_address"` AZ string `json:"az"` + Shard int `json:"shard"` } func (e *Endpoint) String() string { @@ -113,6 +114,7 @@ func (e *Endpoint) unmarshal(data []byte) error { e.Address = configEndpoint.Address e.AZ = configEndpoint.AZ e.CapNProtoAddress = configEndpoint.CapNProtoAddress + e.Shard = configEndpoint.Shard return nil } @@ -124,7 +126,7 @@ type HashringConfig struct { TenantMatcherType tenantMatcher `json:"tenant_matcher_type,omitempty"` Endpoints []Endpoint `json:"endpoints"` Algorithm HashringAlgorithm `json:"algorithm,omitempty"` - ExternalLabels labels.Labels `json:"external_labels,omitempty"` + ExternalLabels labelpb.Labels `json:"external_labels,omitempty"` // If non-zero then enable shuffle sharding. ShuffleShardingConfig ShuffleShardingConfig `json:"shuffle_sharding_config,omitempty"` } @@ -140,13 +142,8 @@ type ShuffleShardingConfig struct { CacheSize int `json:"cache_size"` // ZoneAwarenessDisabled disables zone awareness. We still try to spread the load // across the available zones, but we don't try to balance the shards across zones. - ZoneAwarenessDisabled bool `json:"zone_awareness_disabled"` - // AlignedOrdinalSharding enables aligned ordinal selection for shuffle sharding. - // When true and using aligned_ketama algorithm, the same ordinals are selected - // across all AZs, preserving strict replica alignment. ShardSize represents the - // number of ordinals to select (resulting in ShardSize * numAZs total endpoints). - AlignedOrdinalSharding bool `json:"aligned_ordinal_sharding"` - Overrides []ShuffleShardingOverrideConfig `json:"overrides,omitempty"` + ZoneAwarenessDisabled bool `json:"zone_awareness_disabled"` + Overrides []ShuffleShardingOverrideConfig `json:"overrides,omitempty"` } type tenantMatcher string diff --git a/pkg/receive/handler.go b/pkg/receive/handler.go index 1363177c7fa..3e80f1abe4f 100644 --- a/pkg/receive/handler.go +++ b/pkg/receive/handler.go @@ -31,9 +31,9 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/common/route" - "github.com/prometheus/prometheus/model/relabel" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb" + thanosrelabel "github.com/thanos-io/thanos/pkg/relabel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" "golang.org/x/exp/slices" @@ -56,6 +56,7 @@ import ( "github.com/thanos-io/thanos/pkg/store/storepb/prompb" "github.com/thanos-io/thanos/pkg/tenancy" "github.com/thanos-io/thanos/pkg/tracing" + "github.com/thanos-io/thanos/pkg/vtproto" ) const ( @@ -102,8 +103,8 @@ var ( errRequestTooLarge = errors.New("write request too large") ) -// zlabelsGet avoids ZLabels -> PromLabels conversion in hot paths. -func zlabelsGet(lbls []labelpb.ZLabel, name string) (string, bool) { +// labelsGet returns the value for a label name from a Labels slice without conversion. +func labelsGet(lbls labelpb.Labels, name string) (string, bool) { for _, l := range lbls { if l.Name == name { return l.Value, true @@ -151,6 +152,8 @@ type Options struct { // Handler serves a Prometheus remote write receiving HTTP endpoint. type Handler struct { + storepb.UnimplementedWriteableStoreServer + logger log.Logger writer *Writer router *route.Router @@ -338,7 +341,8 @@ func NewHandler(logger log.Logger, o *Options) *Handler { return true // return buffer to the pool. } return false // discard the buffer that is too large. - }).WithDisabled(o.PoolingDisabled).Build(), + }).WithDisabled(o.PoolingDisabled). + Build(), } h.forwardRequests.WithLabelValues(labelSuccess) @@ -450,7 +454,7 @@ func getSortedStringSliceDiff(slice1, slice2 []Endpoint) []Endpoint { slice2Items[s2] = struct{}{} } - var difference = make([]Endpoint, 0) + var difference = make([]Endpoint, 0, len(slice1Items)) for s1 := range slice1Items { _, s2Contains := slice2Items[s1] if s2Contains { @@ -536,7 +540,7 @@ func (h *Handler) getStats(r *http.Request, statsByLabelName string) ([]statusap // getTenantForStorage returns the tenant to use when writing a time series to TSDB. // This is the actual tenant ID used for storage, unlike tenantKeyForDistribution which // may include prefixes for hashring distribution purposes. -func (h *Handler) getTenantForStorage(tenantHTTP string, ts prompb.TimeSeries) string { +func (h *Handler) getTenantForStorage(tenantHTTP string, ts *prompb.TimeSeries) string { // If TenantAttributor is configured, the logic is identical to tenantKeyForDistribution. if h.options.TenantAttributor != nil { return h.tenantKeyForDistribution(tenantHTTP, ts) @@ -545,7 +549,7 @@ func (h *Handler) getTenantForStorage(tenantHTTP string, ts prompb.TimeSeries) s // Legacy behavior: use splitTenantLabelName if configured. tenant := tenantHTTP if h.splitTenantLabelName != "" { - if tnt, ok := zlabelsGet(ts.Labels, h.splitTenantLabelName); ok && tnt != "" { + if tnt, ok := labelsGet(ts.Labels, h.splitTenantLabelName); ok && tnt != "" { tenant = tnt } } @@ -559,13 +563,12 @@ func (h *Handler) getTenantForStorage(tenantHTTP string, ts prompb.TimeSeries) s // - If verify-attribution is true, use the HTTP tenant for actual routing. // - If verify-attribution is false and HTTP header is provided (tenant != default), use the HTTP tenant. // - If verify-attribution is false and HTTP header is not provided, do attribution from labels. -func (h *Handler) tenantKeyForDistribution(tenantHTTP string, ts prompb.TimeSeries) string { +func (h *Handler) tenantKeyForDistribution(tenantHTTP string, ts *prompb.TimeSeries) string { // If TenantAttributor is configured, use rule-based tenant attribution. if h.options.TenantAttributor != nil { // In verify mode: attribution for metrics only, use HTTP tenant for actual routing. if h.options.TenantAttributor.IsVerifyMode() { - lbls := labelpb.ZLabelsToPromLabels(ts.Labels) - attributedTenant := h.options.TenantAttributor.GetTenantFromLabels(lbls) + attributedTenant := h.options.TenantAttributor.GetTenantFromLabels(ts.Labels) h.options.TenantAttributor.RecordVerification(attributedTenant, tenantHTTP) // Track what tenant would be attributed (for monitoring attribution rules) h.tenantAttributedTotal.WithLabelValues(attributedTenant, "label_rules").Inc() @@ -579,8 +582,7 @@ func (h *Handler) tenantKeyForDistribution(tenantHTTP string, ts prompb.TimeSeri } // No HTTP header provided: do attribution from labels. - lbls := labelpb.ZLabelsToPromLabels(ts.Labels) - attributedTenant := h.options.TenantAttributor.GetTenantFromLabels(lbls) + attributedTenant := h.options.TenantAttributor.GetTenantFromLabels(ts.Labels) h.tenantAttributedTotal.WithLabelValues(attributedTenant, "label_rules").Inc() return attributedTenant } @@ -590,7 +592,7 @@ func (h *Handler) tenantKeyForDistribution(tenantHTTP string, ts prompb.TimeSeri if h.splitTenantLabelName == "" { return tenant } - if v, ok := zlabelsGet(ts.Labels, h.splitTenantLabelName); ok && v != "" { + if v, ok := labelsGet(ts.Labels, h.splitTenantLabelName); ok && v != "" { return h.splitTenantLabelName + ":" + v } return h.options.DefaultTenantID @@ -626,8 +628,11 @@ func (h *Handler) Run() error { return h.httpSrv.Serve(listener) } -// replica encapsulates the replica number of a request and if the request is -// already replicated. +// replica describes the replication intent of a write request. +// When 'replicated' is false, the request has not yet been replicated and must be +// fanned out to replicas 0 through ReplicationFactor-1. +// When replicated is true, the request has already been assigned to a specific +// replica and n identifies which one. No further fan-out is needed. type replica struct { n uint64 replicated bool @@ -639,9 +644,17 @@ type endpointReplica struct { replica uint64 } +// distributionKey identifies a unique (endpoint, replica, tenant) write +// destination, replacing the previous nested map[endpointReplica]map[string]trackedSeries. +type distributionKey struct { + er endpointReplica + tenant string + local bool +} + type trackedSeries struct { seriesIDs []int - timeSeries []prompb.TimeSeries + timeSeries []*prompb.TimeSeries } type writeResponse struct { @@ -660,7 +673,7 @@ func newWriteResponse(seriesIDs []int, err error, er endpointReplica, tenant str } } -func secondsSinceFirstSample(toMS int64, ts prompb.TimeSeries) float64 { +func secondsSinceFirstSample(toMS int64, ts *prompb.TimeSeries) float64 { fromMS := toMS if len(ts.Samples) > 0 { fromMS = ts.Samples[0].Timestamp @@ -668,7 +681,7 @@ func secondsSinceFirstSample(toMS int64, ts prompb.TimeSeries) float64 { return float64(toMS-fromMS) / 1000 } -func isPreAgged(ts prompb.TimeSeries) bool { +func isPreAgged(ts *prompb.TimeSeries) bool { for _, l := range ts.Labels { if l.Name == labelPreAgg && (l.Value == "true" || strings.HasPrefix(l.Value, "v")) { return true @@ -780,11 +793,20 @@ func (h *Handler) receiveHTTP(w http.ResponseWriter, r *http.Request) { return } - // NOTE: Due to zero copy ZLabels, Labels used from WriteRequests keeps memory - // from the whole request. Ensure that we always copy those when we want to - // store them for longer time. - wreq := &prompb.WriteRequest{} - if err := wreq.Unmarshal(*reqBuf); err != nil { + wreq := prompb.WriteRequestFromVTPool() + wrefReturnWg := &sync.WaitGroup{} + wrefReturnWg.Add(1) + // Note: we have to essentially "reference count" the writeRequest usage + // because the fanoutForward function spawns background goroutines that still hold + // onto parts of the writeRequest struct. Thus, it is only safe to return the writeRequest + // to the pool after this AND that routine have finished. + go func() { + wrefReturnWg.Wait() + wreq.ReturnToVTPool() + }() + defer wrefReturnWg.Done() + + if err := wreq.UnmarshalVT(*reqBuf); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } @@ -834,19 +856,8 @@ func (h *Handler) receiveHTTP(w http.ResponseWriter, r *http.Request) { return } - // Deep copy all label strings to detach them from pooled decode buffer. - // Required for correctness when pooled buffers are reused and for preventing - // retention of the whole request buffer via zero-copy label references. - for i := range wreq.Timeseries { - labelpb.ReAllocZLabelsStrings(&wreq.Timeseries[i].Labels, h.writer.opts.Intern) - // Also detach exemplar labels from the pooled buffer. - for j := range wreq.Timeseries[i].Exemplars { - labelpb.ReAllocZLabelsStrings(&wreq.Timeseries[i].Exemplars[j].Labels, h.writer.opts.Intern) - } - } - responseStatusCode := http.StatusOK - tenantStats, err := h.handleRequest(ctx, rep, tenantHTTP, wreq) + tenantStats, err := h.handleRequest(ctx, rep, tenantHTTP, wreq.Timeseries, wrefReturnWg) if err != nil { level.Debug(tLogger).Log("msg", "failed to handle request", "err", err.Error()) switch errors.Cause(err) { @@ -883,17 +894,10 @@ func (h *Handler) receiveHTTP(w http.ResponseWriter, r *http.Request) { // Log high latency requests (>3 minutes) with sampling (1 in 10000) if lat > 180 && !isPreAgged && rand.Intn(10000) == 0 { - - // Convert labels to string for logging - var labelPairs []string - for _, label := range ts.Labels { - labelPairs = append(labelPairs, fmt.Sprintf("%s=%s", label.Name, label.Value)) - } - level.Warn(h.logger).Log( "msg", "high e2e latency detected for non-rollup timeseries", "latency_seconds", lat, - "labels", fmt.Sprintf("{%s}", strings.Join(labelPairs, ", ")), + "labels", labelpb.Labels(ts.Labels).String(), ) } } @@ -908,7 +912,7 @@ type requestStats struct { type tenantRequestStats map[string]requestStats -func (h *Handler) handleRequest(ctx context.Context, rep uint64, tenantHTTP string, wreq *prompb.WriteRequest) (tenantRequestStats, error) { +func (h *Handler) handleRequest(ctx context.Context, rep uint64, tenantHTTP string, timeseries []*prompb.TimeSeries, wrefReturnWg *sync.WaitGroup) (tenantRequestStats, error) { tLogger := log.With(h.logger, "tenantHTTP", tenantHTTP) // This replica value is used to detect cycles in cyclic topologies. @@ -937,7 +941,7 @@ func (h *Handler) handleRequest(ctx context.Context, rep uint64, tenantHTTP stri // Forward any time series as necessary. All time series // destined for the local node will be written to the receiver. // Time series will be replicated as necessary. - return h.forward(ctx, tenantHTTP, r, wreq) + return h.forward(ctx, tenantHTTP, r, timeseries, wrefReturnWg) } // forward accepts a write request, batches its time series by @@ -948,64 +952,34 @@ func (h *Handler) handleRequest(ctx context.Context, rep uint64, tenantHTTP stri // unless the request needs to be replicated. // The function only returns when all requests have finished // or the context is canceled. -func (h *Handler) forward(ctx context.Context, tenantHTTP string, r replica, wreq *prompb.WriteRequest) (tenantRequestStats, error) { +func (h *Handler) forward(ctx context.Context, tenantHTTP string, r replica, timeseries []*prompb.TimeSeries, wrefReturnWg *sync.WaitGroup) (tenantRequestStats, error) { span, ctx := tracing.StartSpan(ctx, "receive_fanout_forward") defer span.Finish() - var replicas []uint64 - if r.replicated { - replicas = []uint64{r.n} - } else { - for rn := uint64(0); rn < h.options.ReplicationFactor; rn++ { - replicas = append(replicas, rn) - } - } - - params := remoteWriteParams{ - tenant: tenantHTTP, - writeRequest: wreq, - replicas: replicas, - alreadyReplicated: r.replicated, - } - - return h.fanoutForward(ctx, params) -} - -type remoteWriteParams struct { - tenant string - writeRequest *prompb.WriteRequest - replicas []uint64 - alreadyReplicated bool + return h.fanoutForward(ctx, tenantHTTP, r, timeseries, wrefReturnWg) } -func (h *Handler) gatherWriteStats(rf int, writes ...map[endpointReplica]map[string]trackedSeries) tenantRequestStats { - var stats tenantRequestStats = make(tenantRequestStats) - - for _, write := range writes { - for er := range write { - for tenant, series := range write[er] { - samples := 0 +func (h *Handler) gatherWriteStats(rf int, writes map[distributionKey]*trackedSeries) tenantRequestStats { + stats := make(tenantRequestStats, len(writes)) - for _, ts := range series.timeSeries { - samples += len(ts.Samples) - } - - if st, ok := stats[tenant]; ok { - st.timeseries += len(series.timeSeries) - st.totalSamples += samples + for key, series := range writes { + samples := 0 + for _, ts := range series.timeSeries { + samples += len(ts.Samples) + } - stats[tenant] = st - } else { - stats[tenant] = requestStats{ - timeseries: len(series.timeSeries), - totalSamples: samples, - } - } + if st, ok := stats[key.tenant]; ok { + st.timeseries += len(series.timeSeries) + st.totalSamples += samples + stats[key.tenant] = st + } else { + stats[key.tenant] = requestStats{ + timeseries: len(series.timeSeries), + totalSamples: samples, } } } - // adjust counters by the replication factor for tenant, st := range stats { st.timeseries /= rf st.totalSamples /= rf @@ -1015,7 +989,7 @@ func (h *Handler) gatherWriteStats(rf int, writes ...map[endpointReplica]map[str return stats } -func (h *Handler) fanoutForward(ctx context.Context, params remoteWriteParams) (tenantRequestStats, error) { +func (h *Handler) fanoutForward(ctx context.Context, tenant string, r replica, timeseries []*prompb.TimeSeries, wrefReturnWg *sync.WaitGroup) (tenantRequestStats, error) { ctx, cancel := context.WithTimeout(tracing.CopyTraceContext(context.Background(), ctx), h.options.ForwardTimeout) var writeErrors writeErrors @@ -1030,38 +1004,37 @@ func (h *Handler) fanoutForward(ctx context.Context, params remoteWriteParams) ( } }() - logTags := []interface{}{"tenant", params.tenant} + logTags := []interface{}{"tenant", tenant} if id, ok := middleware.RequestIDFromContext(ctx); ok { logTags = append(logTags, "request-id", id) } requestLogger := log.With(h.logger, logTags...) - localWrites, remoteWrites, err := h.distributeTimeseriesToReplicas(params.tenant, params.replicas, params.writeRequest.Timeseries) + writes, err := h.distributeTimeseriesToReplicas(tenant, r, timeseries) if err != nil { level.Error(requestLogger).Log("msg", "failed to distribute timeseries to replicas", "err", err) return stats, err } - stats = h.gatherWriteStats(len(params.replicas), localWrites, remoteWrites) + rf := int(h.options.ReplicationFactor) + if r.replicated { + rf = 1 + } + stats = h.gatherWriteStats(rf, writes) // Precompute seriesID -> tenantKey used by distributeTimeseriesToReplicas so we can // attribute errorSeries correctly even when the responses channel closes. - seriesTenantKey := make([]string, len(params.writeRequest.Timeseries)) - for i, ts := range params.writeRequest.Timeseries { - seriesTenantKey[i] = h.tenantKeyForDistribution(params.tenant, ts) + seriesTenantKey := make([]string, len(timeseries)) + for i, ts := range timeseries { + seriesTenantKey[i] = h.tenantKeyForDistribution(tenant, ts) } - // Prepare a buffered channel to receive the responses from the local and remote writes. Remote writes will all go - // asynchronously and with this capacity we will never block on writing to the channel. - maxBufferedResponses := len(localWrites) - for er := range remoteWrites { - maxBufferedResponses += len(remoteWrites[er]) - } - - responses := make(chan writeResponse, maxBufferedResponses) + responses := make(chan writeResponse, len(writes)) wg := sync.WaitGroup{} - - h.sendWrites(ctx, &wg, params, localWrites, remoteWrites, responses) + if wrefReturnWg != nil { + wrefReturnWg.Add(1) + } + h.sendWrites(ctx, &wg, r.replicated, writes, responses) go func() { wg.Wait() @@ -1077,15 +1050,18 @@ func (h *Handler) fanoutForward(ctx context.Context, params remoteWriteParams) ( level.Debug(requestLogger).Log("msg", "request failed, but not needed to achieve quorum", "err", resp.err) } } + if wrefReturnWg != nil { + wrefReturnWg.Done() + } }() }() quorum := h.writeQuorum() - if params.alreadyReplicated { + if r.replicated { quorum = 1 } - successes := make([]int, len(params.writeRequest.Timeseries)) - seriesErrs := newReplicationErrors(quorum, len(params.writeRequest.Timeseries)) + successes := make([]int, len(timeseries)) + seriesErrs := newReplicationErrors(quorum, len(timeseries)) for { select { case <-ctx.Done(): @@ -1126,79 +1102,92 @@ func (h *Handler) fanoutForward(ctx context.Context, params remoteWriteParams) ( } // distributeTimeseriesToReplicas distributes the given timeseries from the tenant to different endpoints in a manner -// that achieves the replication factor indicated by replicas. -// The first return value are the series that should be written to the local node. The second return value are the -// series that should be written to remote nodes. +// that achieves the replication factor. +// When r.replicated is true, only the single replica r.n is used. +// Otherwise, replicas 0 through ReplicationFactor-1 are used. +// The returned map is keyed by (endpointReplica, tenant, local) so that callers +// can distinguish local vs remote writes without a nested map. func (h *Handler) distributeTimeseriesToReplicas( tenantHTTP string, - replicas []uint64, - timeseries []prompb.TimeSeries, -) (map[endpointReplica]map[string]trackedSeries, map[endpointReplica]map[string]trackedSeries, error) { + r replica, + timeseries []*prompb.TimeSeries, +) (map[distributionKey]*trackedSeries, error) { h.mtx.RLock() defer h.mtx.RUnlock() - remoteWrites := make(map[endpointReplica]map[string]trackedSeries) - localWrites := make(map[endpointReplica]map[string]trackedSeries) + + var replicaStart, replicaEnd uint64 + if r.replicated { + replicaStart, replicaEnd = r.n, r.n+1 + } else { + replicaStart, replicaEnd = 0, h.options.ReplicationFactor + } + + writes := make(map[distributionKey]*trackedSeries) for tsIndex, ts := range timeseries { tenant := h.tenantKeyForDistribution(tenantHTTP, ts) - for _, rn := range replicas { - endpoint, err := h.hashring.GetN(tenant, &ts, rn) + for rn := replicaStart; rn < replicaEnd; rn++ { + endpoint, err := h.hashring.GetN(tenant, ts, rn) if err != nil { - return nil, nil, err + return nil, err } - endpointReplica := endpointReplica{endpoint: endpoint, replica: rn} - var writeDestination = remoteWrites - if endpoint.HasAddress(h.options.Endpoint) { - writeDestination = localWrites + key := distributionKey{ + er: endpointReplica{endpoint: endpoint, replica: rn}, + tenant: tenant, + local: endpoint.HasAddress(h.options.Endpoint), } - writeableSeries, ok := writeDestination[endpointReplica] - if !ok { - writeableSeries = make(map[string]trackedSeries, 1) - writeDestination[endpointReplica] = writeableSeries + tracked := writes[key] + if tracked == nil { + tracked = &trackedSeries{} + writes[key] = tracked } - tenantSeries := writeableSeries[tenant] - - tenantSeries.timeSeries = append(tenantSeries.timeSeries, ts) - tenantSeries.seriesIDs = append(tenantSeries.seriesIDs, tsIndex) - - writeDestination[endpointReplica][tenant] = tenantSeries + tracked.timeSeries = append(tracked.timeSeries, timeseries[tsIndex]) + tracked.seriesIDs = append(tracked.seriesIDs, tsIndex) } } - if h.receiverMode == RouterOnly && len(localWrites) > 0 { - panic("router only mode should not have any local writes") + + if h.receiverMode == RouterOnly { + for key := range writes { + if key.local { + panic("router only mode should not have any local writes") + } + } } - if h.receiverMode == IngestorOnly && len(remoteWrites) > 0 { - panic("ingestor only mode should not have any remote writes") + if h.receiverMode == IngestorOnly { + for key := range writes { + if !key.local { + panic("ingestor only mode should not have any remote writes") + } + } } - return localWrites, remoteWrites, nil + return writes, nil } // sendWrites sends the local and remote writes to execute concurrently, controlling them through the provided sync.WaitGroup. // The responses from the writes are sent to the responses channel. +// TODO: this should probably just be a single loop and all should be done in a separate goroutine. func (h *Handler) sendWrites( ctx context.Context, wg *sync.WaitGroup, - params remoteWriteParams, - localWrites map[endpointReplica]map[string]trackedSeries, - remoteWrites map[endpointReplica]map[string]trackedSeries, + alreadyReplicated bool, + writes map[distributionKey]*trackedSeries, responses chan writeResponse, ) { // Do the writes to the local node first. This should be easy and fast. - for writeDestination := range localWrites { - func(writeDestination endpointReplica) { - for tenant, trackedSeries := range localWrites[writeDestination] { - h.sendLocalWrite(ctx, writeDestination, tenant, trackedSeries, responses) - } - }(writeDestination) + for key, series := range writes { + if !key.local { + continue + } + h.sendLocalWrite(ctx, key.er, key.tenant, series, responses) } // Do the writes to remote nodes. Run them all in parallel. - for writeDestination := range remoteWrites { - for tenant, trackedSeries := range remoteWrites[writeDestination] { - wg.Add(1) - - h.sendRemoteWrite(ctx, tenant, writeDestination, trackedSeries, params.alreadyReplicated, responses, wg) + for key, series := range writes { + if key.local { + continue } + wg.Add(1) + h.sendRemoteWrite(ctx, key.tenant, key.er, series, alreadyReplicated, responses, wg) } } @@ -1208,7 +1197,7 @@ func (h *Handler) sendLocalWrite( ctx context.Context, writeDestination endpointReplica, tenantHTTP string, - trackedSeries trackedSeries, + trackedSeries *trackedSeries, responses chan<- writeResponse, ) { span, tracingCtx := tracing.StartSpan(ctx, "receive_local_tsdb_write") @@ -1216,7 +1205,7 @@ func (h *Handler) sendLocalWrite( span.SetTag("endpoint", writeDestination.endpoint) span.SetTag("replica", writeDestination.replica) - tenantSeriesMapping := map[string][]prompb.TimeSeries{} + tenantSeriesMapping := make(map[string][]*prompb.TimeSeries, len(trackedSeries.timeSeries)) for _, ts := range trackedSeries.timeSeries { tenant := h.getTenantForStorage(tenantHTTP, ts) tenantSeriesMapping[tenant] = append(tenantSeriesMapping[tenant], ts) @@ -1242,7 +1231,7 @@ func (h *Handler) sendRemoteWrite( ctx context.Context, tenant string, endpointReplica endpointReplica, - trackedSeries trackedSeries, + trackedSeries *trackedSeries, alreadyReplicated bool, responses chan writeResponse, wg *sync.WaitGroup, @@ -1321,7 +1310,13 @@ func (h *Handler) RemoteWrite(ctx context.Context, r *storepb.WriteRequest) (*st span, ctx := tracing.StartSpan(ctx, "receive_grpc") defer span.Finish() - _, err := h.handleRequest(ctx, uint64(r.Replica), r.Tenant, &prompb.WriteRequest{Timeseries: r.Timeseries}) + // The generated POOL_RETURN_REFCOUNT handler manages the storepb.WriteRequest pool + // lifecycle via a context-injected WaitGroup. We extract it here and pass it through + // the pipeline so that fanoutForward's drain goroutine can hold a reference, delaying + // pool return until all async work completes. + wg := vtproto.ReturnWGFromContext(ctx) + + _, err := h.handleRequest(ctx, uint64(r.Replica), r.Tenant, r.Timeseries, wg) if err != nil { level.Debug(h.logger).Log("msg", "failed to handle request", "err", err) } @@ -1347,14 +1342,13 @@ func (h *Handler) relabel(wreq *prompb.WriteRequest) { if len(relabelConfigs) == 0 { return } - timeSeries := make([]prompb.TimeSeries, 0, len(wreq.Timeseries)) + timeSeries := make([]*prompb.TimeSeries, 0, len(wreq.Timeseries)) for _, ts := range wreq.Timeseries { var keep bool - lbls, keep := relabel.Process(labelpb.ZLabelsToPromLabels(ts.Labels), relabelConfigs...) + ts.Labels, keep = thanosrelabel.Process(ts.Labels, relabelConfigs...) if !keep { continue } - ts.Labels = labelpb.ZLabelsFromPromLabels(lbls) timeSeries = append(timeSeries, ts) } wreq.Timeseries = timeSeries @@ -1740,7 +1734,7 @@ func (p *peerGroup) closeUnlocked(endpoint Endpoint) error { p.connections[endpoint].wp.Close() delete(p.connections, endpoint) if err := c.client.Close(); err != nil { - return fmt.Errorf("closing connection for %s", endpoint) + return fmt.Errorf("closing connection for %v", endpoint) } return nil diff --git a/pkg/receive/handler_grpc_bench_test.go b/pkg/receive/handler_grpc_bench_test.go new file mode 100644 index 00000000000..a710db7c72c --- /dev/null +++ b/pkg/receive/handler_grpc_bench_test.go @@ -0,0 +1,204 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +package receive + +import ( + "context" + "fmt" + "net" + "testing" + "time" + + "github.com/go-kit/log" + "github.com/prometheus/client_golang/prometheus" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + + "github.com/thanos-io/thanos/pkg/store/labelpb" + "github.com/thanos-io/thanos/pkg/store/storepb" + "github.com/thanos-io/thanos/pkg/store/storepb/prompb" + "github.com/thanos-io/thanos/pkg/tenancy" +) + +type benchCluster struct { + handlers []*Handler + servers []*grpc.Server + endpoints []Endpoint + client storepb.WriteableStoreClient + conn *grpc.ClientConn +} + +func (c *benchCluster) close() { + c.conn.Close() + for _, h := range c.handlers { + for _, ep := range c.endpoints { + h.peers.close(ep) + } + } + for _, srv := range c.servers { + srv.GracefulStop() + } +} + +// setupBenchCluster creates a cluster of numNodes receive handlers, each +// running on a real gRPC server with an in-process TCP listener. The +// handlers are wired into a hashmod hashring and connected via real gRPC +// peer connections. A client connected to the first node is returned. +func setupBenchCluster(b *testing.B, numNodes int, rf uint64) *benchCluster { + b.Helper() + + logger := log.NewNopLogger() + + listeners := make([]net.Listener, numNodes) + addresses := make([]string, numNodes) + for i := 0; i < numNodes; i++ { + lis, err := net.Listen("tcp", "localhost:0") + if err != nil { + b.Fatalf("listen: %v", err) + } + listeners[i] = lis + addresses[i] = lis.Addr().String() + } + + endpoints := make([]Endpoint, numNodes) + for i, addr := range addresses { + endpoints[i] = Endpoint{Address: addr} + } + + limiter, _ := NewLimiter(NewNopConfig(), nil, RouterIngestor, log.NewNopLogger(), 1*time.Second) + + handlers := make([]*Handler, numNodes) + for i := 0; i < numNodes; i++ { + appendable := &fakeAppendable{appender: newFakeAppender(nil, nil, nil)} + handlers[i] = NewHandler(logger, &Options{ + TenantHeader: tenancy.DefaultTenantHeader, + DefaultTenantID: "bench-grpc", + ReplicaHeader: DefaultReplicaHeader, + ReplicationFactor: rf, + ForwardTimeout: 5 * time.Minute, + Writer: NewWriter(log.NewNopLogger(), newFakeTenantAppendable(appendable), &WriterOptions{}, prometheus.NewRegistry()), + Limiter: limiter, + Endpoint: addresses[i], + ReplicationProtocol: ProtobufReplication, + DialOpts: []grpc.DialOption{ + grpc.WithTransportCredentials(insecure.NewCredentials()), + }, + }) + } + + servers := make([]*grpc.Server, numNodes) + for i := 0; i < numNodes; i++ { + servers[i] = grpc.NewServer() + storepb.RegisterWriteableStoreServer(servers[i], handlers[i]) + lis := listeners[i] + go func() { _ = servers[i].Serve(lis) }() + } + + hashring, err := NewMultiHashring(AlgorithmHashmod, rf, []HashringConfig{{ + Hashring: "bench", + Endpoints: endpoints, + }}, prometheus.NewRegistry()) + if err != nil { + b.Fatalf("hashring: %v", err) + } + for _, h := range handlers { + h.Hashring(hashring) + } + + conn, err := grpc.NewClient( + addresses[0], + grpc.WithTransportCredentials(insecure.NewCredentials()), + ) + if err != nil { + b.Fatalf("dial: %v", err) + } + + return &benchCluster{ + handlers: handlers, + servers: servers, + endpoints: endpoints, + client: storepb.NewWriteableStoreClient(conn), + conn: conn, + } +} + +func BenchmarkHandlerRemoteWriteGRPC(b *testing.B) { + type topology struct { + name string + numNodes int + rf uint64 + } + topologies := []topology{ + {"single_node", 1, 1}, + {"three_node_rf1", 3, 1}, + {"three_node_rf3", 3, 3}, + } + + type payload struct { + name string + numSeries int + samplesPerSeries int + labelsPerSeries int + } + payloads := []payload{ + {"small_10s", 10, 1, 5}, + {"medium_500s", 500, 1, 10}, + {"large_5000s", 5000, 1, 10}, + } + + for _, topo := range topologies { + b.Run(topo.name, func(b *testing.B) { + cluster := setupBenchCluster(b, topo.numNodes, topo.rf) + defer cluster.close() + + for _, pl := range payloads { + req := buildWriteRequest(b, pl.numSeries, pl.samplesPerSeries, pl.labelsPerSeries) + + b.Run(pl.name, func(b *testing.B) { + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + resp, err := cluster.client.RemoteWrite(context.Background(), req) + if err != nil { + b.Fatal(err) + } + if resp == nil { + b.Fatal("nil response") + } + } + }) + } + }) + } +} + +func buildWriteRequest(b *testing.B, numSeries, samplesPerSeries, labelsPerSeries int) *storepb.WriteRequest { + b.Helper() + wreq := &storepb.WriteRequest{ + Tenant: "bench-grpc", + Timeseries: make([]*prompb.TimeSeries, numSeries), + } + for s := 0; s < numSeries; s++ { + lbls := make([]*labelpb.Label, labelsPerSeries) + lbls[0] = &labelpb.Label{Name: "__name__", Value: fmt.Sprintf("bench_metric_%d", s)} + for l := 1; l < labelsPerSeries; l++ { + lbls[l] = &labelpb.Label{ + Name: fmt.Sprintf("label_%03d", l), + Value: fmt.Sprintf("val_%03d_%06d", l, s), + } + } + samples := make([]*prompb.Sample, samplesPerSeries) + for i := 0; i < samplesPerSeries; i++ { + samples[i] = &prompb.Sample{ + Value: float64(i), + Timestamp: int64(s*samplesPerSeries + i), + } + } + wreq.Timeseries[s] = &prompb.TimeSeries{ + Labels: lbls, + Samples: samples, + } + } + return wreq +} diff --git a/pkg/receive/handler_test.go b/pkg/receive/handler_test.go index e1f753d38b8..b83c7ca8d9e 100644 --- a/pkg/receive/handler_test.go +++ b/pkg/receive/handler_test.go @@ -29,7 +29,6 @@ import ( "github.com/efficientgo/core/testutil" "github.com/go-kit/log" "github.com/go-kit/log/level" - "github.com/gogo/protobuf/proto" "github.com/golang/snappy" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" @@ -59,6 +58,8 @@ import ( "github.com/thanos-io/thanos/pkg/store/storepb" "github.com/thanos-io/thanos/pkg/store/storepb/prompb" "github.com/thanos-io/thanos/pkg/tenancy" + thanostestutil "github.com/thanos-io/thanos/pkg/testutil" + "github.com/thanos-io/thanos/pkg/vtproto" ) const dnsScheme = "dns" @@ -151,7 +152,7 @@ func (f *fakeAppendable) Appender(_ context.Context) (storage.Appender, error) { type fakeAppender struct { sync.Mutex - samples map[storage.SeriesRef][]prompb.Sample + samples map[storage.SeriesRef][]*prompb.Sample exemplars map[storage.SeriesRef][]exemplar.Exemplar appendErr func() error commitErr func() error @@ -172,7 +173,7 @@ func newFakeAppender(appendErr, commitErr, rollbackErr func() error) *fakeAppend rollbackErr = nilErrFn } return &fakeAppender{ - samples: make(map[storage.SeriesRef][]prompb.Sample), + samples: make(map[storage.SeriesRef][]*prompb.Sample), appendErr: appendErr, commitErr: commitErr, rollbackErr: rollbackErr, @@ -183,11 +184,11 @@ func (f *fakeAppender) UpdateMetadata(storage.SeriesRef, labels.Labels, promethe return 0, nil } -func (f *fakeAppender) Get(l labels.Labels) []prompb.Sample { +func (f *fakeAppender) Get(l labels.Labels) []*prompb.Sample { f.Lock() defer f.Unlock() s := f.samples[storage.SeriesRef(l.Hash())] - res := make([]prompb.Sample, len(s)) + res := make([]*prompb.Sample, len(s)) copy(res, s) return res } @@ -198,7 +199,7 @@ func (f *fakeAppender) Append(ref storage.SeriesRef, l labels.Labels, t int64, v if ref == 0 { ref = storage.SeriesRef(l.Hash()) } - f.samples[ref] = append(f.samples[ref], prompb.Sample{Timestamp: t, Value: v}) + f.samples[ref] = append(f.samples[ref], &prompb.Sample{Timestamp: t, Value: v}) return ref, f.appendErr() } @@ -267,7 +268,7 @@ func (g *fakePeersGroup) close(addr Endpoint) error { func (g *fakePeersGroup) getConnection(_ context.Context, endpoint Endpoint) (WriteableStoreAsyncClient, error) { c, ok := g.clients[endpoint] if !ok { - return nil, fmt.Errorf("client %s not found", endpoint) + return nil, fmt.Errorf("client %v not found", endpoint) } return c, nil } @@ -302,7 +303,7 @@ func newTestHandlerHashring( ReplicaHeader: DefaultReplicaHeader, ReplicationFactor: replicationFactor, ForwardTimeout: 5 * time.Minute, - Writer: NewWriter(log.NewNopLogger(), newFakeTenantAppendable(appendables[i]), wOpts), + Writer: NewWriter(log.NewNopLogger(), newFakeTenantAppendable(appendables[i]), wOpts, prometheus.NewRegistry()), Limiter: limiter, }) handlers = append(handlers, h) @@ -768,13 +769,13 @@ func testReceiveQuorum(t *testing.T, hashringAlgo HashringAlgorithm, withConsist // Test that each time series is stored // the correct amount of times in each fake DB. for _, ts := range tc.wreq.Timeseries { - lset := labelpb.ZLabelsToPromLabels(ts.Labels) + lset := labelpb.ToPromLabels(ts.Labels) for j, a := range tc.appendables { if withConsistencyDelay { var expected int n := a.appender.(*fakeAppender).Get(lset) got := uint64(len(n)) - if a.appenderErr == nil && endpointHit(t, hashring, tc.replicationFactor, handlers[j].options.Endpoint, tenant, &ts) { + if a.appenderErr == nil && endpointHit(t, hashring, tc.replicationFactor, handlers[j].options.Endpoint, tenant, ts) { // We have len(handlers) copies of each sample because the test case // is run once for each handler and they all use the same appender. expected = len(handlers) * len(ts.Samples) @@ -786,7 +787,7 @@ func testReceiveQuorum(t *testing.T, hashringAlgo HashringAlgorithm, withConsist var expectedMin int n := a.appender.(*fakeAppender).Get(lset) got := uint64(len(n)) - if a.appenderErr == nil && endpointHit(t, hashring, tc.replicationFactor, handlers[j].options.Endpoint, tenant, &ts) { + if a.appenderErr == nil && endpointHit(t, hashring, tc.replicationFactor, handlers[j].options.Endpoint, tenant, ts) { // We have len(handlers) copies of each sample because the test case // is run once for each handler and they all use the same appender. expectedMin = int((tc.replicationFactor/2)+1) * len(ts.Samples) @@ -939,16 +940,15 @@ func TestReceiveWriteRequestLimits(t *testing.T) { ) wreq := &prompb.WriteRequest{ - Timeseries: []prompb.TimeSeries{}, + Timeseries: []*prompb.TimeSeries{}, } for i := 0; i < tc.amountSeries; i += 1 { - label := labelpb.ZLabel{Name: "foo", Value: "bar"} - series := prompb.TimeSeries{ - Labels: []labelpb.ZLabel{label}, + series := &prompb.TimeSeries{ + Labels: labelpb.FromStrings("foo", "bar"), } for j := 0; j < tc.amountSamples; j += 1 { - sample := prompb.Sample{Value: float64(j), Timestamp: int64(j)} + sample := &prompb.Sample{Value: float64(j), Timestamp: int64(j)} series.Samples = append(series.Samples, sample) } wreq.Timeseries = append(wreq.Timeseries, series) @@ -999,7 +999,7 @@ func cycleErrors(errs []error) func() error { // makeRequest is a helper to make a correct request against a remote write endpoint given a request. func makeRequest(h *Handler, tenant string, wreq *prompb.WriteRequest) (*httptest.ResponseRecorder, error) { - buf, err := proto.Marshal(wreq) + buf, err := wreq.MarshalVT() if err != nil { return nil, errors.Wrap(err, "marshal request") } @@ -1031,12 +1031,36 @@ type fakeRemoteWriteGRPCServer struct { h storepb.WriteableStoreServer } +// remoteWriteRoundtrip simulates the generated POOL_RETURN_REFCOUNT gRPC handler: +// marshal on the "client side", unmarshal into a pooled object on the "server side", +// set up reference-counted pool return via context, and call RemoteWrite. +func (f *fakeRemoteWriteGRPCServer) remoteWriteRoundtrip(ctx context.Context, in *storepb.WriteRequest) (*storepb.WriteResponse, error) { + b, err := in.MarshalVT() + if err != nil { + return nil, err + } + serverReq := storepb.WriteRequestFromVTPool() + if err := serverReq.UnmarshalVT(b); err != nil { + serverReq.ReturnToVTPool() + return nil, err + } + wg := &sync.WaitGroup{} + wg.Add(1) + go func() { + wg.Wait() + serverReq.ReturnToVTPool() + }() + defer wg.Done() + ctx = vtproto.WithReturnWG(ctx, wg) + return f.h.RemoteWrite(ctx, serverReq) +} + func (f *fakeRemoteWriteGRPCServer) RemoteWrite(ctx context.Context, in *storepb.WriteRequest, opts ...grpc.CallOption) (*storepb.WriteResponse, error) { - return f.h.RemoteWrite(ctx, in) + return f.remoteWriteRoundtrip(ctx, in) } func (f *fakeRemoteWriteGRPCServer) RemoteWriteAsync(ctx context.Context, in *storepb.WriteRequest, er endpointReplica, seriesIDs []int, responses chan writeResponse, cb func(error)) { - _, err := f.h.RemoteWrite(ctx, in) + _, err := f.remoteWriteRoundtrip(ctx, in) responses <- writeResponse{ er: er, err: err, @@ -1100,36 +1124,28 @@ func (a *tsOverrideAppender) GetRef(lset labels.Labels, hash uint64) (storage.Se // serializeSeriesWithOneSample returns marshaled and compressed remote write requests like it would // be sent to Thanos receive. // It has one sample and allow passing multiple series, in same manner as typical Prometheus would batch it. -func serializeSeriesWithOneSample(t testing.TB, series [][]labelpb.ZLabel) []byte { - r := &prompb.WriteRequest{Timeseries: make([]prompb.TimeSeries, 0, len(series))} +func serializeSeriesWithOneSample(t testing.TB, series []labelpb.Labels) []byte { + r := &prompb.WriteRequest{Timeseries: make([]*prompb.TimeSeries, 0, len(series))} for _, s := range series { - r.Timeseries = append(r.Timeseries, prompb.TimeSeries{ + r.Timeseries = append(r.Timeseries, &prompb.TimeSeries{ Labels: s, // Timestamp does not matter, it will be overridden. - Samples: []prompb.Sample{{Value: math.MaxFloat64, Timestamp: math.MinInt64}}, + Samples: []*prompb.Sample{{Value: math.MaxFloat64, Timestamp: math.MinInt64}}, }) } - body, err := proto.Marshal(r) + body, err := r.MarshalVT() testutil.Ok(t, err) return snappy.Encode(nil, body) } -func makeSeriesWithValues(numSeries int) []prompb.TimeSeries { - series := make([]prompb.TimeSeries, numSeries) +func makeSeriesWithValues(numSeries int) []*prompb.TimeSeries { + series := make([]*prompb.TimeSeries, numSeries) for i := 0; i < numSeries; i++ { - series[i] = prompb.TimeSeries{ - Labels: []labelpb.ZLabel{ - { - Name: fmt.Sprintf("pod-%d", i), - Value: fmt.Sprintf("nginx-%d", i), - }, - }, - Samples: []prompb.Sample{ - { - Value: float64(i), - Timestamp: 10, - }, + series[i] = &prompb.TimeSeries{ + Labels: labelpb.FromStrings(fmt.Sprintf("pod-%d", i), fmt.Sprintf("nginx-%d", i)), + Samples: []*prompb.Sample{ + {Value: float64(i), Timestamp: 10}, }, } } @@ -1147,6 +1163,7 @@ func benchmarkHandlerMultiTSDBReceiveRemoteWrite(b testutil.TB) { testutil.Ok(b, closeFunc()) }() handler := handlers[0] + handler.logger = log.NewNopLogger() reg := prometheus.NewRegistry() @@ -1159,14 +1176,14 @@ func benchmarkHandlerMultiTSDBReceiveRemoteWrite(b testutil.TB) { NoLockfile: true, StripeSize: 1, // Disable stripe pre allocation so we can have clear profiles. }, - labels.FromStrings("replica", "01"), + labelpb.FromStrings("replica", "01"), "tenant_id", nil, false, metadata.NoneFunc, ) defer func() { testutil.Ok(b, m.Close()) }() - handler.writer = NewWriter(logger, m, &WriterOptions{}) + handler.writer = NewWriter(logger, m, &WriterOptions{}, prometheus.NewRegistry()) testutil.Ok(b, m.Flush()) testutil.Ok(b, m.Open()) @@ -1177,13 +1194,13 @@ func benchmarkHandlerMultiTSDBReceiveRemoteWrite(b testutil.TB) { }{ { name: "typical labels under 1KB, 500 of them", - writeRequest: serializeSeriesWithOneSample(b, func() [][]labelpb.ZLabel { - series := make([][]labelpb.ZLabel, 500) + writeRequest: serializeSeriesWithOneSample(b, func() []labelpb.Labels { + series := make([]labelpb.Labels, 500) for s := 0; s < len(series); s++ { - lbls := make([]labelpb.ZLabel, 10) + lbls := make(labelpb.Labels, 10) for i := 0; i < len(lbls); i++ { // Label ~20B name, 50B value. - lbls[i] = labelpb.ZLabel{Name: fmt.Sprintf("abcdefghijabcdefghijabcdefghij%d", i), Value: fmt.Sprintf("abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij%d", i)} + lbls[i] = &labelpb.Label{Name: fmt.Sprintf("abcdefghijabcdefghijabcdefghij%d", i), Value: fmt.Sprintf("abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij%d", i)} } series[s] = lbls } @@ -1192,13 +1209,13 @@ func benchmarkHandlerMultiTSDBReceiveRemoteWrite(b testutil.TB) { }, { name: "typical labels under 1KB, 5000 of them", - writeRequest: serializeSeriesWithOneSample(b, func() [][]labelpb.ZLabel { - series := make([][]labelpb.ZLabel, 5000) + writeRequest: serializeSeriesWithOneSample(b, func() []labelpb.Labels { + series := make([]labelpb.Labels, 5000) for s := 0; s < len(series); s++ { - lbls := make([]labelpb.ZLabel, 10) + lbls := make(labelpb.Labels, 10) for i := 0; i < len(lbls); i++ { // Label ~20B name, 50B value. - lbls[i] = labelpb.ZLabel{Name: fmt.Sprintf("abcdefghijabcdefghijabcdefghij%d", i), Value: fmt.Sprintf("abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij%d", i)} + lbls[i] = &labelpb.Label{Name: fmt.Sprintf("abcdefghijabcdefghijabcdefghij%d", i), Value: fmt.Sprintf("abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij%d", i)} } series[s] = lbls } @@ -1207,13 +1224,13 @@ func benchmarkHandlerMultiTSDBReceiveRemoteWrite(b testutil.TB) { }, { name: "typical labels under 1KB, 20000 of them", - writeRequest: serializeSeriesWithOneSample(b, func() [][]labelpb.ZLabel { - series := make([][]labelpb.ZLabel, 20000) + writeRequest: serializeSeriesWithOneSample(b, func() []labelpb.Labels { + series := make([]labelpb.Labels, 20000) for s := 0; s < len(series); s++ { - lbls := make([]labelpb.ZLabel, 10) + lbls := make(labelpb.Labels, 10) for i := 0; i < len(lbls); i++ { // Label ~20B name, 50B value. - lbls[i] = labelpb.ZLabel{Name: fmt.Sprintf("abcdefghijabcdefghijabcdefghij%d", i), Value: fmt.Sprintf("abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij%d", i)} + lbls[i] = &labelpb.Label{Name: fmt.Sprintf("abcdefghijabcdefghijabcdefghij%d", i), Value: fmt.Sprintf("abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij%d", i)} } series[s] = lbls } @@ -1222,8 +1239,8 @@ func benchmarkHandlerMultiTSDBReceiveRemoteWrite(b testutil.TB) { }, { name: "extremely large label value 10MB, 10 of them", - writeRequest: serializeSeriesWithOneSample(b, func() [][]labelpb.ZLabel { - series := make([][]labelpb.ZLabel, 10) + writeRequest: serializeSeriesWithOneSample(b, func() []labelpb.Labels { + series := make([]labelpb.Labels, 10) for s := 0; s < len(series); s++ { lbl := &strings.Builder{} lbl.Grow(1024 * 1024 * 10) // 10MB. @@ -1231,7 +1248,7 @@ func benchmarkHandlerMultiTSDBReceiveRemoteWrite(b testutil.TB) { for i := 0; i < lbl.Cap()/len(word); i++ { _, _ = lbl.WriteString(word) } - series[s] = []labelpb.ZLabel{{Name: "__name__", Value: lbl.String()}} + series[s] = labelpb.FromStrings("__name__", lbl.String()) } return series }()), @@ -1376,51 +1393,27 @@ func TestRelabel(t *testing.T) { for _, tcase := range []struct { name string relabel []*relabel.Config - writeRequest prompb.WriteRequest - expectedWriteRequest prompb.WriteRequest + writeRequest *prompb.WriteRequest + expectedWriteRequest *prompb.WriteRequest }{ { name: "empty relabel configs", - writeRequest: prompb.WriteRequest{ - Timeseries: []prompb.TimeSeries{ + writeRequest: &prompb.WriteRequest{ + Timeseries: []*prompb.TimeSeries{ { - Labels: []labelpb.ZLabel{ - { - Name: "__name__", - Value: "test_metric", - }, - { - Name: "foo", - Value: "bar", - }, - }, - Samples: []prompb.Sample{ - { - Timestamp: 0, - Value: 1, - }, + Labels: labelpb.FromStrings("__name__", "test_metric", "foo", "bar"), + Samples: []*prompb.Sample{ + {Timestamp: 0, Value: 1}, }, }, }, }, - expectedWriteRequest: prompb.WriteRequest{ - Timeseries: []prompb.TimeSeries{ + expectedWriteRequest: &prompb.WriteRequest{ + Timeseries: []*prompb.TimeSeries{ { - Labels: []labelpb.ZLabel{ - { - Name: "__name__", - Value: "test_metric", - }, - { - Name: "foo", - Value: "bar", - }, - }, - Samples: []prompb.Sample{ - { - Timestamp: 0, - Value: 1, - }, + Labels: labelpb.FromStrings("__name__", "test_metric", "foo", "bar"), + Samples: []*prompb.Sample{ + {Timestamp: 0, Value: 1}, }, }, }, @@ -1437,46 +1430,22 @@ func TestRelabel(t *testing.T) { Replacement: "baz", }, }, - writeRequest: prompb.WriteRequest{ - Timeseries: []prompb.TimeSeries{ + writeRequest: &prompb.WriteRequest{ + Timeseries: []*prompb.TimeSeries{ { - Labels: []labelpb.ZLabel{ - { - Name: "__name__", - Value: "test_metric", - }, - { - Name: "foo", - Value: "bar", - }, - }, - Samples: []prompb.Sample{ - { - Timestamp: 0, - Value: 1, - }, + Labels: labelpb.FromStrings("__name__", "test_metric", "foo", "bar"), + Samples: []*prompb.Sample{ + {Timestamp: 0, Value: 1}, }, }, }, }, - expectedWriteRequest: prompb.WriteRequest{ - Timeseries: []prompb.TimeSeries{ + expectedWriteRequest: &prompb.WriteRequest{ + Timeseries: []*prompb.TimeSeries{ { - Labels: []labelpb.ZLabel{ - { - Name: "__name__", - Value: "test_metric", - }, - { - Name: "foo", - Value: "bar", - }, - }, - Samples: []prompb.Sample{ - { - Timestamp: 0, - Value: 1, - }, + Labels: labelpb.FromStrings("__name__", "test_metric", "foo", "bar"), + Samples: []*prompb.Sample{ + {Timestamp: 0, Value: 1}, }, }, }, @@ -1498,46 +1467,22 @@ func TestRelabel(t *testing.T) { Replacement: "foo", }, }, - writeRequest: prompb.WriteRequest{ - Timeseries: []prompb.TimeSeries{ + writeRequest: &prompb.WriteRequest{ + Timeseries: []*prompb.TimeSeries{ { - Labels: []labelpb.ZLabel{ - { - Name: "__name__", - Value: "test_metric", - }, - { - Name: "foo", - Value: "bar", - }, - }, - Samples: []prompb.Sample{ - { - Timestamp: 0, - Value: 1, - }, + Labels: labelpb.FromStrings("__name__", "test_metric", "foo", "bar"), + Samples: []*prompb.Sample{ + {Timestamp: 0, Value: 1}, }, }, }, }, - expectedWriteRequest: prompb.WriteRequest{ - Timeseries: []prompb.TimeSeries{ + expectedWriteRequest: &prompb.WriteRequest{ + Timeseries: []*prompb.TimeSeries{ { - Labels: []labelpb.ZLabel{ - { - Name: "__name__", - Value: "foo", - }, - { - Name: "foo", - Value: "test", - }, - }, - Samples: []prompb.Sample{ - { - Timestamp: 0, - Value: 1, - }, + Labels: labelpb.FromStrings("__name__", "foo", "foo", "test"), + Samples: []*prompb.Sample{ + {Timestamp: 0, Value: 1}, }, }, }, @@ -1551,42 +1496,22 @@ func TestRelabel(t *testing.T) { Regex: relabel.MustNewRegexp("foo"), }, }, - writeRequest: prompb.WriteRequest{ - Timeseries: []prompb.TimeSeries{ + writeRequest: &prompb.WriteRequest{ + Timeseries: []*prompb.TimeSeries{ { - Labels: []labelpb.ZLabel{ - { - Name: "__name__", - Value: "test_metric", - }, - { - Name: "foo", - Value: "bar", - }, - }, - Samples: []prompb.Sample{ - { - Timestamp: 0, - Value: 1, - }, + Labels: labelpb.FromStrings("__name__", "test_metric", "foo", "bar"), + Samples: []*prompb.Sample{ + {Timestamp: 0, Value: 1}, }, }, }, }, - expectedWriteRequest: prompb.WriteRequest{ - Timeseries: []prompb.TimeSeries{ + expectedWriteRequest: &prompb.WriteRequest{ + Timeseries: []*prompb.TimeSeries{ { - Labels: []labelpb.ZLabel{ - { - Name: "__name__", - Value: "test_metric", - }, - }, - Samples: []prompb.Sample{ - { - Timestamp: 0, - Value: 1, - }, + Labels: labelpb.FromStrings("__name__", "test_metric"), + Samples: []*prompb.Sample{ + {Timestamp: 0, Value: 1}, }, }, }, @@ -1601,30 +1526,18 @@ func TestRelabel(t *testing.T) { Regex: relabel.MustNewRegexp("bar"), }, }, - writeRequest: prompb.WriteRequest{ - Timeseries: []prompb.TimeSeries{ + writeRequest: &prompb.WriteRequest{ + Timeseries: []*prompb.TimeSeries{ { - Labels: []labelpb.ZLabel{ - { - Name: "__name__", - Value: "test_metric", - }, - { - Name: "foo", - Value: "bar", - }, - }, - Samples: []prompb.Sample{ - { - Timestamp: 0, - Value: 1, - }, + Labels: labelpb.FromStrings("__name__", "test_metric", "foo", "bar"), + Samples: []*prompb.Sample{ + {Timestamp: 0, Value: 1}, }, }, }, }, - expectedWriteRequest: prompb.WriteRequest{ - Timeseries: []prompb.TimeSeries{}, + expectedWriteRequest: &prompb.WriteRequest{ + Timeseries: []*prompb.TimeSeries{}, }, }, { @@ -1635,27 +1548,13 @@ func TestRelabel(t *testing.T) { Regex: relabel.MustNewRegexp("foo"), }, }, - writeRequest: prompb.WriteRequest{ - Timeseries: []prompb.TimeSeries{ + writeRequest: &prompb.WriteRequest{ + Timeseries: []*prompb.TimeSeries{ { - Labels: []labelpb.ZLabel{ - { - Name: "__name__", - Value: "test_metric", - }, + Labels: labelpb.FromStrings("__name__", "test_metric", "foo", "bar"), + Exemplars: []*prompb.Exemplar{ { - Name: "foo", - Value: "bar", - }, - }, - Exemplars: []prompb.Exemplar{ - { - Labels: []labelpb.ZLabel{ - { - Name: "traceID", - Value: "foo", - }, - }, + Labels: labelpb.FromStrings("traceID", "foo"), Value: 1, Timestamp: 1, }, @@ -1663,23 +1562,13 @@ func TestRelabel(t *testing.T) { }, }, }, - expectedWriteRequest: prompb.WriteRequest{ - Timeseries: []prompb.TimeSeries{ + expectedWriteRequest: &prompb.WriteRequest{ + Timeseries: []*prompb.TimeSeries{ { - Labels: []labelpb.ZLabel{ - { - Name: "__name__", - Value: "test_metric", - }, - }, - Exemplars: []prompb.Exemplar{ + Labels: labelpb.FromStrings("__name__", "test_metric"), + Exemplars: []*prompb.Exemplar{ { - Labels: []labelpb.ZLabel{ - { - Name: "traceID", - Value: "foo", - }, - }, + Labels: labelpb.FromStrings("traceID", "foo"), Value: 1, Timestamp: 1, }, @@ -1697,27 +1586,13 @@ func TestRelabel(t *testing.T) { Regex: relabel.MustNewRegexp("bar"), }, }, - writeRequest: prompb.WriteRequest{ - Timeseries: []prompb.TimeSeries{ + writeRequest: &prompb.WriteRequest{ + Timeseries: []*prompb.TimeSeries{ { - Labels: []labelpb.ZLabel{ + Labels: labelpb.FromStrings("__name__", "test_metric", "foo", "bar"), + Exemplars: []*prompb.Exemplar{ { - Name: "__name__", - Value: "test_metric", - }, - { - Name: "foo", - Value: "bar", - }, - }, - Exemplars: []prompb.Exemplar{ - { - Labels: []labelpb.ZLabel{ - { - Name: "traceID", - Value: "foo", - }, - }, + Labels: labelpb.FromStrings("traceID", "foo"), Value: 1, Timestamp: 1, }, @@ -1725,8 +1600,8 @@ func TestRelabel(t *testing.T) { }, }, }, - expectedWriteRequest: prompb.WriteRequest{ - Timeseries: []prompb.TimeSeries{}, + expectedWriteRequest: &prompb.WriteRequest{ + Timeseries: []*prompb.TimeSeries{}, }, }, } { @@ -1735,8 +1610,8 @@ func TestRelabel(t *testing.T) { Relabeller: newRelabelerWithConstantConfig(tcase.relabel, nil), }) - h.relabel(&tcase.writeRequest) - testutil.Equals(t, tcase.expectedWriteRequest, tcase.writeRequest) + h.relabel(tcase.writeRequest) + thanostestutil.ProtoEquals(t, tcase.expectedWriteRequest, tcase.writeRequest) }) } } @@ -1859,25 +1734,30 @@ func TestDistributeSeries(t *testing.T) { hr := &hashringSeenTenants{Hashring: hashring} h.Hashring(hr) - _, remote, err := h.distributeTimeseriesToReplicas( + writes, err := h.distributeTimeseriesToReplicas( "foo", - []uint64{0}, - []prompb.TimeSeries{ + replica{n: 0, replicated: true}, + []*prompb.TimeSeries{ { - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings("a", "b", tenantIDLabelName, "bar")), + Labels: labelpb.FromStrings("a", "b", tenantIDLabelName, "bar"), }, { - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings("b", "a", tenantIDLabelName, "boo")), + Labels: labelpb.FromStrings("b", "a", tenantIDLabelName, "boo"), }, }, ) require.NoError(t, err) - require.Len(t, remote, 1) - require.Len(t, remote[endpointReplica{endpoint: endpoint, replica: 0}][tenantIDLabelName+":bar"].timeSeries, 1) - require.Len(t, remote[endpointReplica{endpoint: endpoint, replica: 0}][tenantIDLabelName+":boo"].timeSeries, 1) - require.Equal(t, 2, labelpb.ZLabelsToPromLabels(remote[endpointReplica{endpoint: endpoint, replica: 0}][tenantIDLabelName+":bar"].timeSeries[0].Labels).Len()) - require.Equal(t, 2, labelpb.ZLabelsToPromLabels(remote[endpointReplica{endpoint: endpoint, replica: 0}][tenantIDLabelName+":boo"].timeSeries[0].Labels).Len()) + er := endpointReplica{endpoint: endpoint, replica: 0} + barKey := distributionKey{er: er, tenant: tenantIDLabelName + ":bar", local: false} + booKey := distributionKey{er: er, tenant: tenantIDLabelName + ":boo", local: false} + + require.Len(t, writes, 2) + require.Len(t, writes[barKey].timeSeries, 1) + require.Len(t, writes[booKey].timeSeries, 1) + + require.Equal(t, 2, len(writes[barKey].timeSeries[0].Labels)) + require.Equal(t, 2, len(writes[booKey].timeSeries[0].Labels)) require.Equal(t, map[string]struct{}{tenantIDLabelName + ":bar": {}, tenantIDLabelName + ":boo": {}}, hr.seenTenants) } @@ -1919,19 +1799,14 @@ func TestHandlerFlippingHashrings(t *testing.T) { return } - _, err := h.handleRequest(ctx, 0, "test", &prompb.WriteRequest{ - Timeseries: []prompb.TimeSeries{ - { - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings("foo", "bar")), - Samples: []prompb.Sample{ - { - Timestamp: time.Now().Unix(), - Value: 123, - }, - }, + _, err := h.handleRequest(ctx, 0, "test", []*prompb.TimeSeries{ + { + Labels: labelpb.FromStrings("foo", "bar"), + Samples: []*prompb.Sample{ + {Timestamp: time.Now().Unix(), Value: 123}, }, }, - }) + }, nil) require.Error(t, err) } }() @@ -1994,16 +1869,14 @@ func TestIngestorRestart(t *testing.T) { defer client.Close() ctx := context.TODO() - data := &prompb.WriteRequest{ - Timeseries: []prompb.TimeSeries{ - { - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings("foo", "bar")), - Samples: []prompb.Sample{{Timestamp: time.Now().Unix(), Value: 123}}, - }, + data := []*prompb.TimeSeries{ + { + Labels: labelpb.FromStrings("foo", "bar"), + Samples: []*prompb.Sample{{Timestamp: time.Now().Unix(), Value: 123}}, }, } - stats, err := client.handleRequest(ctx, 0, "test", data) + stats, err := client.handleRequest(ctx, 0, "test", data, nil) require.NoError(t, err) require.Equal(t, tenantRequestStats{ "test": requestStats{timeseries: 1, totalSamples: 1}, @@ -2018,7 +1891,7 @@ func TestIngestorRestart(t *testing.T) { iter, errs := 10, 0 for i := 0; i < iter; i++ { - _, err = client.handleRequest(ctx, 0, "test", data) + _, err = client.handleRequest(ctx, 0, "test", data, nil) if err != nil { require.Error(t, errUnavailable, err) errs++ @@ -2032,6 +1905,8 @@ func TestIngestorRestart(t *testing.T) { } type fakeStoreServer struct { + storepb.UnimplementedWriteableStoreServer + logger log.Logger } @@ -2055,3 +1930,121 @@ func startIngestor(logger log.Logger, serverAddress string, delay time.Duration) }() return srv } + +// SIMPLE CASE: pooling disabled: +// BenchmarkReceiveHTTPLargeBody/c:0.0MB_uc:0.0MB-32 894674 6805 ns/op 5.00 MB/s 5191 B/op 60 allocs/op +// SIMPLE CASE: pooling enabled: +// BenchmarkReceiveHTTPLargeBody/c:0.0MB_uc:0.0MB-32 979448 5973 ns/op 5.69 MB/s 3909 B/op 54 allocs/op +// Next Iter. +// BenchmarkReceiveHTTPLargeBody/c:0.0MB_uc:0.0MB-32 200830 5821 ns/op 5.84 MB/s 3904 B/op 53 allocs/op +// MOAR ITER +// BenchmarkReceiveHTTPLargeBody/c:0.0MB_uc:0.0MB-32 200000 5542 ns/op 6.13 MB/s 3473 B/op 51 allocs/op +// BenchmarkReceiveHTTPLargeBody/c:0.0MB_uc:0.0MB-32 200000 5727 ns/op 5.94 MB/s 3464 B/op 51 allocs/op +// BenchmarkReceiveHTTPLargeBody/c:0.0MB_uc:0.0MB-32 200000 5665 ns/op 6.00 MB/s 3373 B/op 50 allocs/op +// BenchmarkReceiveHTTPLargeBody/c:0.0MB_uc:0.0MB-32 200000 5616 ns/op 6.05 MB/s 2588 B/op 49 allocs/op +// BenchmarkReceiveHTTPLargeBody/c:0.0MB_uc:0.0MB-32 200000 5540 ns/op 6.14 MB/s 2580 B/op 49 allocs/op +// Now on the LARGE size: (with all them optimizations) +// BenchmarkReceiveHTTPLargeBody/c:0.0MB_uc:0.0MB-32 1000 281270 ns/op 43.79 MB/s 309522 B/op 3358 allocs/op + +// VTProto introduced, with my basic optimizations, no pooling, etc. +// BenchmarkReceiveHTTPLargeBody/c:0.0MB_uc:0.0MB-32 200000 5918 ns/op 5.75 MB/s 3592 B/op 55 allocs/op +// BenchmarkReceiveHTTPLargeBody/c:0.0MB_uc:0.0MB#01-32 200000 499428 ns/op 24.66 MB/s 397838 B/op 5479 allocs/op +// VTProto introduced, WITHOUT my extra optimizations: +// BenchmarkReceiveHTTPLargeBody/c:0.0MB_uc:0.0MB-32 200000 6396 ns/op 5.32 MB/s 4034 B/op 58 allocs/op +// BenchmarkReceiveHTTPLargeBody/c:0.0MB_uc:0.0MB#01-32 200000 503491 ns/op 24.46 MB/s 392868 B/op 5479 allocs/op +// VTProto introduced, with extra extra optimizzations, and pooling: +// BenchmarkReceiveHTTPLargeBody/c:0.0MB_uc:0.0MB-32 200000 6383 ns/op 5.33 MB/s 3232 B/op 50 allocs/op +// BenchmarkReceiveHTTPLargeBody/c:0.0MB_uc:0.0MB#01-32 200000 367150 ns/op 33.54 MB/s 187918 B/op 2376 allocs/op. +func BenchmarkReceiveHTTPLargeBody(b *testing.B) { + tests := []struct { + namePrefix string + numSeries int + samplesPerSeries int + labelsPerSeries int + }{ + { + namePrefix: "single", + numSeries: 1, + samplesPerSeries: 1, + labelsPerSeries: 1, + }, + { + namePrefix: "medium-small", + numSeries: 100, + samplesPerSeries: 10, + labelsPerSeries: 10, + }, + } + + appendables := []*fakeAppendable{ + {appender: newFakeAppender(nil, nil, nil)}, + } + handlers, _, closeFunc, err := newTestHandlerHashring(appendables, 1, AlgorithmHashmod, false) + if err != nil { + b.Fatalf("unable to create test handler: %v", err) + } + defer func() { + if err := closeFunc(); err != nil { + b.Fatal(err) + } + for _, h := range handlers { + h.Close() + } + }() + handler := handlers[0] + handler.logger = log.NewNopLogger() + handler.options.DefaultTenantID = "bench-large-body" + for _, tc := range tests { + wreq := buildLargeWriteRequest(tc.numSeries, tc.samplesPerSeries, tc.labelsPerSeries) + body, err := wreq.MarshalVT() + if err != nil { + b.Fatalf("marshal: %v", err) + } + compressed := snappy.Encode(nil, body) + + name := fmt.Sprintf("c:%.1fMB_uc:%.1fMB", float64(len(compressed))/(1024*1024), float64(len(body))/(1024*1024)) + b.Run(name, func(b *testing.B) { + b.SetBytes(int64(len(compressed))) + rec := httptest.NewRecorder() + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + handler.receiveHTTP(rec, &http.Request{ + ContentLength: int64(len(compressed)), + Body: io.NopCloser(bytes.NewReader(compressed)), + }) + if rec.Code != http.StatusOK { + b.Fatalf("expected 200, got %d: %s", rec.Code, rec.Body.String()) + } + } + }) + } +} + +func buildLargeWriteRequest(numSeries, samplesPerSeries, labelsPerSeries int) *prompb.WriteRequest { + wreq := &prompb.WriteRequest{ + Timeseries: make([]*prompb.TimeSeries, numSeries), + } + for s := 0; s < numSeries; s++ { + lbls := make([]*labelpb.Label, labelsPerSeries) + lbls[0] = &labelpb.Label{Name: "__name__", Value: fmt.Sprintf("bench_metric_%d", s)} + for l := 1; l < labelsPerSeries; l++ { + lbls[l] = &labelpb.Label{ + Name: fmt.Sprintf("label_%03d", l), + Value: fmt.Sprintf("val_%03d_%06d", l, s), + } + } + samples := make([]*prompb.Sample, samplesPerSeries) + for i := 0; i < samplesPerSeries; i++ { + samples[i] = &prompb.Sample{ + Value: float64(i), + Timestamp: int64(s*samplesPerSeries + i), + } + } + wreq.Timeseries[s] = &prompb.TimeSeries{ + Labels: lbls, + Samples: samples, + } + } + return wreq +} diff --git a/pkg/receive/hashring.go b/pkg/receive/hashring.go index 0b63f9aea8b..dd26e3a50e0 100644 --- a/pkg/receive/hashring.go +++ b/pkg/receive/hashring.go @@ -27,8 +27,6 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" "github.com/thanos-io/thanos/pkg/store/labelpb" - "github.com/thanos-io/thanos/pkg/strutil" - "github.com/thanos-io/thanos/pkg/store/storepb/prompb" ) @@ -36,9 +34,9 @@ import ( type HashringAlgorithm string const ( - AlgorithmHashmod HashringAlgorithm = "hashmod" - AlgorithmKetama HashringAlgorithm = "ketama" - AlgorithmAlignedKetama HashringAlgorithm = "aligned_ketama" + AlgorithmHashmod HashringAlgorithm = "hashmod" + AlgorithmKetama HashringAlgorithm = "ketama" + AlgorithmRendezvous HashringAlgorithm = "rendezvous" // SectionsPerNode is the number of sections in the ring assigned to each node // in the ketama hashring. A higher number yields a better series distribution, @@ -366,7 +364,7 @@ type shuffleShardHashring struct { nodes []Endpoint // cache stores tenant-specific subrings. The value is Hashring to support both - // *ketamaHashring (regular shuffle sharding) and aligned ketama subrings. + // *ketamaHashring (regular shuffle sharding) and *rendezvousHashring subrings. cache *lru.Cache[string, Hashring] metrics *shuffleShardCacheMetrics @@ -594,9 +592,10 @@ func (s *shuffleShardHashring) getTenantShardCached(tenant string) (Hashring, er var h Hashring var err error - if s.shuffleShardingConfig.AlignedOrdinalSharding { - h, err = s.getTenantShardAligned(tenant) - } else { + switch s.baseRing.(type) { + case *rendezvousHashring: + h, err = s.getTenantShardRendezvous(tenant) + default: h, err = s.getTenantShard(tenant) } if err != nil { @@ -710,248 +709,207 @@ func (s *shuffleShardHashring) getTenantShard(tenant string) (*ketamaHashring, e return newKetamaHashring(finalNodes, SectionsPerNode, s.replicationFactor) } -// ordinalSection represents a section in the ordinal ring for consistent hashing. -type ordinalSection struct { - ordinal int - hash uint64 -} +// groupByAZ groups endpoints by Availability Zone and sorts them by shard. +// It returns a 2D slice where each inner slice represents an AZ (sorted alphabetically) +// and contains endpoints sorted by shard. All inner slices are truncated to the +// length of the largest common sequence of shards starting from 0 across all AZs. +func groupByAZ(endpoints []Endpoint) ([][]Endpoint, error) { + if len(endpoints) == 0 { + return nil, errors.New("no endpoints provided") + } + + // Group endpoints by AZ and then by shard. + azEndpoints := make(map[string]map[int]Endpoint) + for _, ep := range endpoints { + if _, ok := azEndpoints[ep.AZ]; !ok { + azEndpoints[ep.AZ] = make(map[int]Endpoint) + } + if _, exists := azEndpoints[ep.AZ][ep.Shard]; exists { + return nil, fmt.Errorf("duplicate endpoint shard %d for address %s in AZ %s", ep.Shard, ep.Address, ep.AZ) + } + azEndpoints[ep.AZ][ep.Shard] = ep + } -type ordinalSections []ordinalSection + // Get sorted list of AZ names. + sortedAZs := make([]string, 0, len(azEndpoints)) + for az := range azEndpoints { + sortedAZs = append(sortedAZs, az) + } + sort.Strings(sortedAZs) -func (o ordinalSections) Len() int { return len(o) } -func (o ordinalSections) Less(i, j int) bool { return o[i].hash < o[j].hash } -func (o ordinalSections) Swap(i, j int) { o[i], o[j] = o[j], o[i] } + // Determine the maximum common shard across all AZs. + maxCommonShard := -1 + for i := 0; ; i++ { + presentInAllAZs := true + for _, az := range sortedAZs { + if _, ok := azEndpoints[az][i]; !ok { + presentInAllAZs = false + if i == 0 { + return nil, fmt.Errorf("AZ %q is missing endpoint with shard 0", az) + } + break + } + } + if !presentInAllAZs { + maxCommonShard = i - 1 + break + } + } + if maxCommonShard < 0 { + return nil, errors.New("no common endpoints with shard 0 found across all AZs") + } + numAZs := len(sortedAZs) + result := make([][]Endpoint, numAZs) + for i, az := range sortedAZs { + result[i] = make([]Endpoint, 0, maxCommonShard+1) + for j := 0; j <= maxCommonShard; j++ { + result[i] = append(result[i], azEndpoints[az][j]) + } + } + return result, nil +} -// extractOrdinalStructure extracts the ordinal-to-endpoint mapping per AZ -// and returns the set of ordinals common to all AZs. -func extractOrdinalStructure(endpoints []Endpoint) (map[string]map[int]Endpoint, []int, error) { +// extractShardStructure extracts the shard-to-endpoint mapping per AZ +// and returns the set of shards common to all AZs. +func extractShardStructure(endpoints []Endpoint) (map[string]map[int]Endpoint, []int, error) { if len(endpoints) == 0 { return nil, nil, errors.New("no endpoints provided") } - // Group endpoints by AZ and ordinal - azOrdinalMap := make(map[string]map[int]Endpoint) + // Group endpoints by AZ and shard + azShardMap := make(map[string]map[int]Endpoint) for _, ep := range endpoints { - ordinal, err := strutil.ExtractPodOrdinal(ep.Address) - if err != nil { - return nil, nil, errors.Wrapf(err, "failed to extract ordinal from address %s", ep.Address) - } - if _, ok := azOrdinalMap[ep.AZ]; !ok { - azOrdinalMap[ep.AZ] = make(map[int]Endpoint) + if _, ok := azShardMap[ep.AZ]; !ok { + azShardMap[ep.AZ] = make(map[int]Endpoint) } - azOrdinalMap[ep.AZ][ordinal] = ep + azShardMap[ep.AZ][ep.Shard] = ep } - if len(azOrdinalMap) == 0 { + if len(azShardMap) == 0 { return nil, nil, errors.New("no AZs found") } - // Find common ordinals across all AZs - var commonOrdinals []int + // Find common shards across all AZs + var commonShards []int var firstAZ string - for az := range azOrdinalMap { + for az := range azShardMap { firstAZ = az break } - for ordinal := range azOrdinalMap[firstAZ] { + for shard := range azShardMap[firstAZ] { presentInAll := true - for az, ordMap := range azOrdinalMap { + for az, shardMap := range azShardMap { if az == firstAZ { continue } - if _, ok := ordMap[ordinal]; !ok { + if _, ok := shardMap[shard]; !ok { presentInAll = false break } } if presentInAll { - commonOrdinals = append(commonOrdinals, ordinal) + commonShards = append(commonShards, shard) } } - if len(commonOrdinals) == 0 { - return nil, nil, errors.New("no common ordinals found across all AZs") + if len(commonShards) == 0 { + return nil, nil, errors.New("no common shards found across all AZs") } - sort.Ints(commonOrdinals) - return azOrdinalMap, commonOrdinals, nil + sort.Ints(commonShards) + return azShardMap, commonShards, nil } -// buildOrdinalRing creates a consistent hash ring of ordinals. -// Each ordinal gets multiple sections for better distribution. -func buildOrdinalRing(ordinals []int, sectionsPerOrdinal int) ordinalSections { - ring := make(ordinalSections, 0, len(ordinals)*sectionsPerOrdinal) - hasher := xxhash.New() - - for _, ordinal := range ordinals { - for i := 1; i <= sectionsPerOrdinal; i++ { - hasher.Reset() - _, _ = hasher.Write([]byte(fmt.Sprintf("ordinal-%d:%d", ordinal, i))) - ring = append(ring, ordinalSection{ - ordinal: ordinal, - hash: hasher.Sum64(), - }) - } - } - - sort.Sort(ring) - return ring -} - -// selectOrdinalsConsistent selects ordinals using consistent hashing. -// This provides stability: adding ordinal N only affects tenants that would hash near N. -func selectOrdinalsConsistent(ring ordinalSections, tenant string, count int) []int { - if count >= len(ring) { - // Return all unique ordinals if count exceeds ring size - seen := make(map[int]struct{}) - for _, sec := range ring { - seen[sec.ordinal] = struct{}{} - } - result := make([]int, 0, len(seen)) - for ord := range seen { - result = append(result, ord) - } - sort.Ints(result) +// selectShardsRendezvous selects shards using rendezvous (highest random weight) hashing. +// For each shard, it computes hash(tenant, shard) and picks the top-K shards with the highest values. +func selectShardsRendezvous(commonShards []int, tenant string, count int) []int { + if count >= len(commonShards) { + result := make([]int, len(commonShards)) + copy(result, commonShards) return result } - seed := ShuffleShardSeed(tenant, "") // No AZ suffix for alignment - r := rand.New(rand.NewSource(seed)) + hasher := xxhash.New() - selected := make(map[int]struct{}) - result := make([]int, 0, count) + type shardScore struct { + shard int + score uint64 + } + scores := make([]shardScore, len(commonShards)) + for i, shard := range commonShards { + hasher.Reset() + _, _ = hasher.Write([]byte(tenant)) + _, _ = hasher.Write([]byte(strconv.Itoa(shard))) + scores[i] = shardScore{shard: shard, score: hasher.Sum64()} + } - for len(result) < count { - pos := r.Uint64() - idx := sort.Search(len(ring), func(i int) bool { - return ring[i].hash >= pos - }) - if idx == len(ring) { - idx = 0 - } + // Partial sort: find top-K by score (descending). + sort.Slice(scores, func(i, j int) bool { + return scores[i].score > scores[j].score + }) - // Walk ring to find unselected ordinal - for j := 0; j < len(ring); j++ { - checkIdx := (idx + j) % len(ring) - ord := ring[checkIdx].ordinal - if _, ok := selected[ord]; !ok { - selected[ord] = struct{}{} - result = append(result, ord) - break - } - } + result := make([]int, count) + for i := 0; i < count; i++ { + result[i] = scores[i].shard } - sort.Ints(result) return result } -// getTenantShardAligned returns a tenant shard with aligned ordinals across all AZs. -// Unlike getTenantShard which selects nodes independently per AZ, this selects -// ordinals first, then takes the same ordinal from each AZ. -func (s *shuffleShardHashring) getTenantShardAligned(tenant string) (Hashring, error) { - // Extract ordinal structure from all nodes - azOrdinalMap, commonOrdinals, err := extractOrdinalStructure(s.nodes) +// getTenantShardRendezvous returns a tenant shard with aligned shards across all AZs +// using rendezvous hashing for shard selection. Unlike getTenantShard which selects nodes +// independently per AZ, this selects shards first, then takes the same shard from each AZ. +func (s *shuffleShardHashring) getTenantShardRendezvous(tenant string) (Hashring, error) { + // Extract shard structure from all nodes + azShardMap, commonShards, err := extractShardStructure(s.nodes) if err != nil { - return nil, errors.Wrap(err, "failed to extract ordinal structure") + return nil, errors.Wrap(err, "failed to extract shard structure") } - // Determine shard size (number of ordinals to select) - shardSize := s.getShardSize(tenant) - if shardSize > len(commonOrdinals) { - return nil, fmt.Errorf("shard size %d exceeds available common ordinals (%d)", shardSize, len(commonOrdinals)) + // shard_size is the total shard size; divide by numAZs to get per-AZ count. + totalShardSize := s.getShardSize(tenant) + numAZs := len(azShardMap) + perAZShards := totalShardSize / numAZs // floor + if perAZShards == 0 { + return nil, fmt.Errorf("shard size %d too small for %d AZs", totalShardSize, numAZs) + } + if perAZShards > len(commonShards) { + return nil, fmt.Errorf("per-AZ shard count %d (from total %d / %d AZs) exceeds available common shards (%d)", perAZShards, totalShardSize, numAZs, len(commonShards)) } - // Build ordinal ring for consistent hashing - // Use fewer sections per ordinal since we have fewer ordinals than nodes - sectionsPerOrdinal := SectionsPerNode - ordinalRing := buildOrdinalRing(commonOrdinals, sectionsPerOrdinal) - - // Select ordinals using consistent hashing - selectedOrdinals := selectOrdinalsConsistent(ordinalRing, tenant, shardSize) + // Select shards using rendezvous hashing + selectedShards := selectShardsRendezvous(commonShards, tenant, perAZShards) - // Build endpoint list with same ordinals from each AZ - // Sorted AZ order for deterministic endpoint ordering - sortedAZs := make([]string, 0, len(azOrdinalMap)) - for az := range azOrdinalMap { + // Build endpoint list with same shards from each AZ + sortedAZs := make([]string, 0, len(azShardMap)) + for az := range azShardMap { sortedAZs = append(sortedAZs, az) } sort.Strings(sortedAZs) - // Create aligned ketama subring manually to preserve ordinal alignment - // without requiring sequential ordinals starting from 0 - return newAlignedSubring(azOrdinalMap, sortedAZs, selectedOrdinals, SectionsPerNode, s.replicationFactor) -} - -// newAlignedSubring creates a ketama hashring with aligned replicas from a subset of ordinals. -// Unlike newAlignedKetamaHashring, this doesn't require ordinals to be sequential from 0. -// The alignment property: for any section, all replicas have the same ordinal across different AZs. -func newAlignedSubring( - azOrdinalMap map[string]map[int]Endpoint, - sortedAZs []string, - selectedOrdinals []int, - sectionsPerNode int, - replicationFactor uint64, -) (*ketamaHashring, error) { - numAZs := len(sortedAZs) - numOrdinals := len(selectedOrdinals) - - if uint64(numAZs) != replicationFactor { - return nil, fmt.Errorf("number of AZs (%d) must equal replication factor (%d)", numAZs, replicationFactor) - } - - // Build flat endpoint list: [AZ0-ord0, AZ0-ord1, ..., AZ1-ord0, AZ1-ord1, ...] - // where ordN refers to selectedOrdinals[N], not the actual ordinal value - totalEndpoints := numAZs * numOrdinals - flatEndpoints := make([]Endpoint, 0, totalEndpoints) - for _, az := range sortedAZs { - for _, ordinal := range selectedOrdinals { - ep, ok := azOrdinalMap[az][ordinal] + // Build azEndpoints directly (non-contiguous shards are OK for sub-rings). + numShards := len(selectedShards) + azEndpoints := make([][]Endpoint, len(sortedAZs)) + var flatEndpoints []Endpoint + for i, az := range sortedAZs { + azEndpoints[i] = make([]Endpoint, 0, numShards) + for _, shard := range selectedShards { + ep, ok := azShardMap[az][shard] if !ok { - return nil, fmt.Errorf("ordinal %d not found in AZ %s", ordinal, az) + return nil, fmt.Errorf("shard %d not found in AZ %s", shard, az) } - flatEndpoints = append(flatEndpoints, ep) + azEndpoints[i] = append(azEndpoints[i], ep) } + flatEndpoints = append(flatEndpoints, azEndpoints[i]...) } - // Create sections with aligned replicas - // For aligned subring, we create sections based on the first AZ's endpoints (primary) - // Each section's replicas point to the same "position" (ordinal index) in each AZ - hasher := xxhash.New() - ringSections := make(sections, 0, numOrdinals*sectionsPerNode) - - for ordinalIdx := 0; ordinalIdx < numOrdinals; ordinalIdx++ { - // Primary endpoint is from the first AZ - primaryEndpoint := flatEndpoints[ordinalIdx] // AZ0 endpoints are at indices 0..numOrdinals-1 - - for sectionIdx := 1; sectionIdx <= sectionsPerNode; sectionIdx++ { - hasher.Reset() - _, _ = hasher.Write([]byte(primaryEndpoint.Address + ":" + strconv.Itoa(sectionIdx))) - - sec := §ion{ - hash: hasher.Sum64(), - az: primaryEndpoint.AZ, - endpointIndex: uint64(ordinalIdx), // Index within first AZ - replicas: make([]uint64, 0, replicationFactor), - } - - // Add replicas: same ordinal index from each AZ - for azIdx := 0; azIdx < numAZs; azIdx++ { - replicaFlatIndex := azIdx*numOrdinals + ordinalIdx - sec.replicas = append(sec.replicas, uint64(replicaFlatIndex)) - } - - ringSections = append(ringSections, sec) - } - } - - sort.Sort(ringSections) - - return &ketamaHashring{ - endpoints: flatEndpoints, - sections: ringSections, - numEndpoints: uint64(totalEndpoints), + return &rendezvousHashring{ + azEndpoints: azEndpoints, + sortedAZs: sortedAZs, + numShards: numShards, + replicationFactor: s.replicationFactor, + flatEndpoints: flatEndpoints, }, nil } @@ -979,6 +937,11 @@ func NewMultiHashring(algorithm HashringAlgorithm, replicationFactor uint64, cfg cache: make(map[string]Hashring), } + numShardsGauge := promauto.With(reg).NewGaugeVec(prometheus.GaugeOpts{ + Name: "thanos_receive_hashring_shards", + Help: "Number of shards per hashring after groupByAZ alignment.", + }, []string{"hashring"}) + for _, h := range cfg { var hashring Hashring var err error @@ -986,7 +949,7 @@ func NewMultiHashring(algorithm HashringAlgorithm, replicationFactor uint64, cfg if h.Algorithm != "" { activeAlgorithm = h.Algorithm } - hashring, err = newHashring(activeAlgorithm, h.Endpoints, replicationFactor, h.Hashring, h.Tenants, h.ShuffleShardingConfig, reg) + hashring, err = newHashring(activeAlgorithm, h.Endpoints, replicationFactor, h.Hashring, h.Tenants, h.ShuffleShardingConfig, reg, numShardsGauge) if err != nil { return nil, err } @@ -1007,7 +970,7 @@ func NewMultiHashring(algorithm HashringAlgorithm, replicationFactor uint64, cfg return m, nil } -func newHashring(algorithm HashringAlgorithm, endpoints []Endpoint, replicationFactor uint64, hashring string, tenants []string, shuffleShardingConfig ShuffleShardingConfig, reg prometheus.Registerer) (Hashring, error) { +func newHashring(algorithm HashringAlgorithm, endpoints []Endpoint, replicationFactor uint64, hashring string, tenants []string, shuffleShardingConfig ShuffleShardingConfig, reg prometheus.Registerer, numShardsGauge *prometheus.GaugeVec) (Hashring, error) { switch algorithm { case AlgorithmHashmod: @@ -1031,11 +994,12 @@ func newHashring(algorithm HashringAlgorithm, endpoints []Endpoint, replicationF return newShuffleShardHashring(ringImpl, shuffleShardingConfig, replicationFactor, reg, hashring) } return ringImpl, nil - case AlgorithmAlignedKetama: - ringImpl, err := newAlignedKetamaHashring(endpoints, SectionsPerNode, replicationFactor) + case AlgorithmRendezvous: + ringImpl, err := newRendezvousHashring(endpoints, replicationFactor) if err != nil { return nil, err } + numShardsGauge.WithLabelValues(hashring).Set(float64(ringImpl.numShards)) if shuffleShardingConfig.ShardSize > 0 { if shuffleShardingConfig.ShardSize > len(endpoints) { return nil, fmt.Errorf("shard size %d is larger than number of nodes in hashring %s (%d)", shuffleShardingConfig.ShardSize, hashring, len(endpoints)) diff --git a/pkg/receive/hashring_test.go b/pkg/receive/hashring_test.go index 379861420e8..4908f4a6d41 100644 --- a/pkg/receive/hashring_test.go +++ b/pkg/receive/hashring_test.go @@ -6,6 +6,8 @@ package receive import ( "fmt" "math" + "sort" + "strconv" "strings" "testing" @@ -23,15 +25,9 @@ func TestHashringGet(t *testing.T) { t.Parallel() ts := &prompb.TimeSeries{ - Labels: []labelpb.ZLabel{ - { - Name: "foo", - Value: "bar", - }, - { - Name: "baz", - Value: "qux", - }, + Labels: labelpb.Labels{ + {Name: "foo", Value: "bar"}, + {Name: "baz", Value: "qux"}, }, } @@ -223,11 +219,8 @@ func TestKetamaHashringGet(t *testing.T) { t.Parallel() baseTS := &prompb.TimeSeries{ - Labels: []labelpb.ZLabel{ - { - Name: "pod", - Value: "nginx", - }, + Labels: labelpb.Labels{ + {Name: "pod", Value: "nginx"}, }, } tests := []struct { @@ -280,11 +273,8 @@ func TestKetamaHashringGet(t *testing.T) { name: "base case with different timeseries", endpoints: []Endpoint{{Address: "node-1"}, {Address: "node-2"}, {Address: "node-3"}}, ts: &prompb.TimeSeries{ - Labels: []labelpb.ZLabel{ - { - Name: "pod", - Value: "thanos", - }, + Labels: labelpb.Labels{ + {Name: "pod", Value: "thanos"}, }, }, expectedNode: "node-3", @@ -457,8 +447,8 @@ func TestKetamaHashringEvenAZSpread(t *testing.T) { tenant := "default-tenant" ts := &prompb.TimeSeries{ - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings("foo", "bar")), - Samples: []prompb.Sample{{Value: 1, Timestamp: 0}}, + Labels: labelpb.FromStrings("foo", "bar"), + Samples: []*prompb.Sample{{Value: 1, Timestamp: 0}}, } for _, tt := range []struct { @@ -632,8 +622,8 @@ func TestKetamaHashringEvenNodeSpread(t *testing.T) { nodeSpread := make(map[string]int) for i := 0; i < int(tt.numSeries); i++ { ts := &prompb.TimeSeries{ - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings("foo", fmt.Sprintf("%d", i))), - Samples: []prompb.Sample{{Value: 1, Timestamp: 0}}, + Labels: labelpb.FromStrings("foo", fmt.Sprintf("%d", i)), + Samples: []*prompb.Sample{{Value: 1, Timestamp: 0}}, } for j := 0; j < int(tt.replicas); j++ { r, err := hashRing.GetN(tenant, ts, uint64(j)) @@ -801,11 +791,8 @@ func TestShuffleShardHashring(t *testing.T) { // We'll sample multiple times to ensure consistency for i := 0; i < 100; i++ { ts := &prompb.TimeSeries{ - Labels: []labelpb.ZLabel{ - { - Name: "iteration", - Value: fmt.Sprintf("%d", i), - }, + Labels: labelpb.Labels{ + {Name: "iteration", Value: fmt.Sprintf("%d", i)}, }, } @@ -831,15 +818,9 @@ func TestShuffleShardHashring(t *testing.T) { for i := 0; i < 10+trial; i++ { ts := &prompb.TimeSeries{ - Labels: []labelpb.ZLabel{ - { - Name: "iteration", - Value: fmt.Sprintf("%d", i), - }, - { - Name: "trial", - Value: fmt.Sprintf("%d", trial), - }, + Labels: labelpb.Labels{ + {Name: "iteration", Value: fmt.Sprintf("%d", i)}, + {Name: "trial", Value: fmt.Sprintf("%d", trial)}, }, } @@ -855,26 +836,23 @@ func TestShuffleShardHashring(t *testing.T) { } } -func makeSeries() []prompb.TimeSeries { +func makeSeries() []*prompb.TimeSeries { numSeries := 10000 - series := make([]prompb.TimeSeries, numSeries) + series := make([]*prompb.TimeSeries, numSeries) for i := 0; i < numSeries; i++ { - series[i] = prompb.TimeSeries{ - Labels: []labelpb.ZLabel{ - { - Name: "pod", - Value: fmt.Sprintf("nginx-%d", i), - }, + series[i] = &prompb.TimeSeries{ + Labels: labelpb.Labels{ + {Name: "pod", Value: fmt.Sprintf("nginx-%d", i)}, }, } } return series } -func findSeries(initialAssignments map[string][]prompb.TimeSeries, node string, newSeries prompb.TimeSeries) bool { +func findSeries(initialAssignments map[string][]*prompb.TimeSeries, node string, newSeries *prompb.TimeSeries) bool { for _, oldSeries := range initialAssignments[node] { - l1 := labelpb.ZLabelsToPromLabels(newSeries.Labels) - l2 := labelpb.ZLabelsToPromLabels(oldSeries.Labels) + l1 := labelpb.ToPromLabels(newSeries.Labels) + l2 := labelpb.ToPromLabels(oldSeries.Labels) if labels.Equal(l1, l2) { return true } @@ -883,19 +861,19 @@ func findSeries(initialAssignments map[string][]prompb.TimeSeries, node string, return false } -func assignSeries(series []prompb.TimeSeries, nodes []Endpoint) (map[string][]prompb.TimeSeries, error) { +func assignSeries(series []*prompb.TimeSeries, nodes []Endpoint) (map[string][]*prompb.TimeSeries, error) { return assignReplicatedSeries(series, nodes, 0) } -func assignReplicatedSeries(series []prompb.TimeSeries, nodes []Endpoint, replicas uint64) (map[string][]prompb.TimeSeries, error) { +func assignReplicatedSeries(series []*prompb.TimeSeries, nodes []Endpoint, replicas uint64) (map[string][]*prompb.TimeSeries, error) { hashRing, err := newKetamaHashring(nodes, SectionsPerNode, replicas) if err != nil { return nil, err } - assignments := make(map[string][]prompb.TimeSeries) + assignments := make(map[string][]*prompb.TimeSeries) for i := uint64(0); i < replicas; i++ { for _, ts := range series { - result, err := hashRing.GetN("tenant", &ts, i) + result, err := hashRing.GetN("tenant", ts, i) if err != nil { return nil, err } @@ -1019,7 +997,7 @@ func getTenantNodes(t *testing.T, ring *shuffleShardHashring, tenant string, sha // Sample many time series to discover all nodes in the shard for i := 0; i < 1000; i++ { ts := &prompb.TimeSeries{ - Labels: []labelpb.ZLabel{ + Labels: labelpb.Labels{ {Name: "series", Value: fmt.Sprintf("%d", i)}, }, } @@ -1047,409 +1025,118 @@ func compareNodeSets(before, after map[string]struct{}) (added, removed []string return } -// makeK8sEndpoint creates an endpoint with K8s-style DNS name that has an extractable ordinal. -func makeK8sEndpoint(podName string, ordinal int, az string) Endpoint { - return Endpoint{ - Address: fmt.Sprintf("%s-%d.svc.test.svc.cluster.local:10901", podName, ordinal), - AZ: az, - } -} - -func TestAlignedOrdinalShardingBasic(t *testing.T) { - t.Parallel() - - // Create 3 AZs with 5 ordinals each (15 total endpoints) - endpoints := make([]Endpoint, 0, 15) - azs := []string{"az-a", "az-b", "az-c"} - for _, az := range azs { - for ord := 0; ord < 5; ord++ { - endpoints = append(endpoints, makeK8sEndpoint("pod-"+az, ord, az)) - } - } - - // Create aligned ketama base ring with RF=3 (one per AZ) - baseRing, err := newAlignedKetamaHashring(endpoints, SectionsPerNode, 3) - require.NoError(t, err) - - // Create shuffle shard hashring with aligned ordinal sharding enabled - cfg := ShuffleShardingConfig{ - ShardSize: 2, // Select 2 ordinals -> 6 endpoints (2 * 3 AZs) - AlignedOrdinalSharding: true, - } - shardRing, err := newShuffleShardHashring(baseRing, cfg, 3, prometheus.NewRegistry(), "test-aligned") - require.NoError(t, err) - - // Get the tenant shard - tenant := "test-tenant" - shard, err := shardRing.getTenantShardAligned(tenant) - require.NoError(t, err) - - // Verify we got the right number of nodes (2 ordinals * 3 AZs = 6) - nodes := shard.Nodes() - require.Len(t, nodes, 6, "expected 6 endpoints (2 ordinals * 3 AZs)") - - // Extract ordinals from each AZ and verify they're the same - ordinalsByAZ := make(map[string][]int) - for _, node := range nodes { - ordinalsByAZ[node.AZ] = append(ordinalsByAZ[node.AZ], extractOrdinalFromAddress(t, node.Address)) - } - - // Verify each AZ has exactly 2 ordinals - require.Len(t, ordinalsByAZ, 3, "expected 3 AZs") - for az, ordinals := range ordinalsByAZ { - require.Len(t, ordinals, 2, "AZ %s should have 2 ordinals", az) - } - - // Verify all AZs have the SAME ordinals (the key invariant) - var referenceOrdinals []int - for _, ordinals := range ordinalsByAZ { - if referenceOrdinals == nil { - referenceOrdinals = ordinals - } else { - require.ElementsMatch(t, referenceOrdinals, ordinals, - "all AZs should have the same ordinals for aligned ordinal sharding") - } - } - - t.Logf("Selected ordinals: %v", referenceOrdinals) -} - -func TestAlignedOrdinalShardingConsistency(t *testing.T) { - t.Parallel() - - // Create 3 AZs with 5 ordinals each - endpoints := make([]Endpoint, 0, 15) - azs := []string{"az-a", "az-b", "az-c"} - for _, az := range azs { - for ord := 0; ord < 5; ord++ { - endpoints = append(endpoints, makeK8sEndpoint("pod-"+az, ord, az)) - } - } - - baseRing, err := newAlignedKetamaHashring(endpoints, SectionsPerNode, 3) - require.NoError(t, err) - - cfg := ShuffleShardingConfig{ - ShardSize: 2, - AlignedOrdinalSharding: true, - } - shardRing, err := newShuffleShardHashring(baseRing, cfg, 3, prometheus.NewRegistry(), "test-consistency") - require.NoError(t, err) - - // Verify same tenant always gets same ordinals across multiple calls - tenant := "consistent-tenant" - var firstOrdinals []int - - for trial := 0; trial < 10; trial++ { - shard, err := shardRing.getTenantShardAligned(tenant) - require.NoError(t, err) - - currentOrdinals := extractOrdinalsFromShard(t, shard) - if firstOrdinals == nil { - firstOrdinals = currentOrdinals - } else { - require.Equal(t, firstOrdinals, currentOrdinals, - "same tenant should always get same ordinals") - } - } -} - -func TestAlignedOrdinalShardingDifferentTenants(t *testing.T) { - t.Parallel() - - // Create 3 AZs with 10 ordinals each to have enough spread - endpoints := make([]Endpoint, 0, 30) - azs := []string{"az-a", "az-b", "az-c"} - for _, az := range azs { - for ord := 0; ord < 10; ord++ { - endpoints = append(endpoints, makeK8sEndpoint("pod-"+az, ord, az)) - } - } - - baseRing, err := newAlignedKetamaHashring(endpoints, SectionsPerNode, 3) - require.NoError(t, err) - - cfg := ShuffleShardingConfig{ - ShardSize: 3, // Select 3 ordinals - AlignedOrdinalSharding: true, - } - shardRing, err := newShuffleShardHashring(baseRing, cfg, 3, prometheus.NewRegistry(), "test-diff-tenants") - require.NoError(t, err) - - // Different tenants should (likely) get different ordinals - tenantOrdinals := make(map[string][]int) - numTenants := 20 - - for i := 0; i < numTenants; i++ { - tenant := fmt.Sprintf("tenant-%d", i) - shard, err := shardRing.getTenantShardAligned(tenant) - require.NoError(t, err) - tenantOrdinals[tenant] = extractOrdinalsFromShard(t, shard) - } - - // Count unique ordinal sets - uniqueSets := make(map[string]int) - for _, ordinals := range tenantOrdinals { - key := fmt.Sprintf("%v", ordinals) - uniqueSets[key]++ - } - - // With 10 ordinals choosing 3, there are C(10,3)=120 possible combinations - // We expect multiple unique sets across 20 tenants - t.Logf("Unique ordinal sets: %d out of %d tenants", len(uniqueSets), numTenants) - require.Greater(t, len(uniqueSets), 1, "different tenants should get different ordinal sets") +// podDNS creates a DNS-like string for testing endpoint addresses. +func podDNS(name string, shard int) string { + return name + "-" + strconv.Itoa(shard) + ".test-svc.test-namespace.svc.cluster.local" } -func TestAlignedOrdinalShardingPreservesAlignment(t *testing.T) { - t.Parallel() - - // Create 3 AZs with 5 ordinals each - endpoints := make([]Endpoint, 0, 15) - azs := []string{"az-a", "az-b", "az-c"} - for _, az := range azs { - for ord := 0; ord < 5; ord++ { - endpoints = append(endpoints, makeK8sEndpoint("pod-"+az, ord, az)) - } - } - - baseRing, err := newAlignedKetamaHashring(endpoints, SectionsPerNode, 3) - require.NoError(t, err) - - cfg := ShuffleShardingConfig{ - ShardSize: 2, - AlignedOrdinalSharding: true, - } - shardRing, err := newShuffleShardHashring(baseRing, cfg, 3, prometheus.NewRegistry(), "test-preserves") - require.NoError(t, err) - - tenant := "alignment-test-tenant" - - // Use GetN to get replicas and verify they're aligned (same ordinal across AZs) - for i := 0; i < 100; i++ { - ts := &prompb.TimeSeries{ - Labels: []labelpb.ZLabel{ - {Name: "series", Value: fmt.Sprintf("series-%d", i)}, +func TestGroupByAZ(t *testing.T) { + // Test setup endpoints. + ep0a := Endpoint{Address: podDNS("pod", 0), AZ: "zone-a", Shard: 0} + ep1a := Endpoint{Address: podDNS("pod", 1), AZ: "zone-a", Shard: 1} + ep2a := Endpoint{Address: podDNS("pod", 2), AZ: "zone-a", Shard: 2} + ep0b := Endpoint{Address: podDNS("pod", 0), AZ: "zone-b", Shard: 0} + ep1b := Endpoint{Address: podDNS("pod", 1), AZ: "zone-b", Shard: 1} + ep0c := Endpoint{Address: podDNS("pod", 0), AZ: "zone-c", Shard: 0} + ep1c := Endpoint{Address: podDNS("pod", 1), AZ: "zone-c", Shard: 1} + duplicateEp0a := Endpoint{Address: podDNS("anotherpod", 0), AZ: "zone-a", Shard: 0} // Same shard (0) as ep0a in zone-a. + + testCases := map[string]struct { + inputEndpoints []Endpoint + expectedResult [][]Endpoint + expectError bool + errorContains string + }{ + "error on empty input": { + inputEndpoints: []Endpoint{}, + expectedResult: nil, + expectError: true, + errorContains: "no endpoints provided", + }, + "single AZ, multiple endpoints": { + inputEndpoints: []Endpoint{ep1a, ep0a, ep2a}, + expectedResult: [][]Endpoint{ + {ep0a, ep1a, ep2a}, }, - } - - // Get all 3 replicas (RF=3) - var replicas []Endpoint - for n := uint64(0); n < 3; n++ { - ep, err := shardRing.GetN(tenant, ts, n) - require.NoError(t, err) - replicas = append(replicas, ep) - } - - // Verify all 3 replicas have the same ordinal but different AZs - ordinals := make(map[int]struct{}) - azsSeen := make(map[string]struct{}) - for _, ep := range replicas { - ordinals[extractOrdinalFromAddress(t, ep.Address)] = struct{}{} - azsSeen[ep.AZ] = struct{}{} - } - - require.Len(t, ordinals, 1, "all replicas should have the same ordinal for series %d", i) - require.Len(t, azsSeen, 3, "replicas should span all 3 AZs for series %d", i) - } -} - -// TestAlignedOrdinalShardingDataDistribution verifies the key behavior: -// - With shard_size=2, tenant gets 2 ordinals (e.g., ordinals 1 and 4) -// - Series are distributed across both ordinals -// - a-1, b-1, c-1 always receive the same series (aligned replicas for ordinal 1) -// - a-4, b-4, c-4 always receive the same series (aligned replicas for ordinal 4) -// - Series assigned to ordinal 1 are different from series assigned to ordinal 4. -func TestAlignedOrdinalShardingDataDistribution(t *testing.T) { - t.Parallel() - - // Create 3 AZs with 5 ordinals each - endpoints := make([]Endpoint, 0, 15) - azs := []string{"az-a", "az-b", "az-c"} - for _, az := range azs { - for ord := 0; ord < 5; ord++ { - endpoints = append(endpoints, makeK8sEndpoint("pod-"+az, ord, az)) - } - } - - baseRing, err := newAlignedKetamaHashring(endpoints, SectionsPerNode, 3) - require.NoError(t, err) - - cfg := ShuffleShardingConfig{ - ShardSize: 2, // Select 2 ordinals - AlignedOrdinalSharding: true, - } - shardRing, err := newShuffleShardHashring(baseRing, cfg, 3, prometheus.NewRegistry(), "test-distribution") - require.NoError(t, err) - - tenant := "distribution-test-tenant" - - // First, get the tenant's selected ordinals - shard, err := shardRing.getTenantShardAligned(tenant) - require.NoError(t, err) - selectedOrdinals := extractOrdinalsFromShard(t, shard) - require.Len(t, selectedOrdinals, 2, "tenant should have exactly 2 ordinals") - t.Logf("Tenant's selected ordinals: %v", selectedOrdinals) - - // Track which series go to which ordinal - // Key: ordinal, Value: set of series indices - seriesByOrdinal := make(map[int]map[int]struct{}) - for _, ord := range selectedOrdinals { - seriesByOrdinal[ord] = make(map[int]struct{}) - } - - // Track which endpoints receive which series - // Key: endpoint address, Value: set of series indices - seriesByEndpoint := make(map[string]map[int]struct{}) - - // Generate many series and track their distribution - numSeries := 1000 - for i := 0; i < numSeries; i++ { - ts := &prompb.TimeSeries{ - Labels: []labelpb.ZLabel{ - {Name: "series", Value: fmt.Sprintf("series-%d", i)}, - {Name: "__name__", Value: "test_metric"}, + expectError: false, + }, + "multiple AZs, balanced and ordered": { + inputEndpoints: []Endpoint{ep1a, ep0b, ep0a, ep1b}, + expectedResult: [][]Endpoint{ + {ep0a, ep1a}, + {ep0b, ep1b}, }, - } - - // Get all 3 replicas - var replicas []Endpoint - for n := uint64(0); n < 3; n++ { - ep, err := shardRing.GetN(tenant, ts, n) - require.NoError(t, err) - replicas = append(replicas, ep) - - // Track series per endpoint - if seriesByEndpoint[ep.Address] == nil { - seriesByEndpoint[ep.Address] = make(map[int]struct{}) - } - seriesByEndpoint[ep.Address][i] = struct{}{} - } - - // All replicas should have the same ordinal - ordinal := extractOrdinalFromAddress(t, replicas[0].Address) - for _, ep := range replicas[1:] { - epOrdinal := extractOrdinalFromAddress(t, ep.Address) - require.Equal(t, ordinal, epOrdinal, "all replicas for series %d should have same ordinal", i) - } - - // Track which ordinal this series went to - seriesByOrdinal[ordinal][i] = struct{}{} - } - - // Verify 1: Series are distributed across BOTH ordinals (not just one) - for ord, series := range seriesByOrdinal { - t.Logf("Ordinal %d received %d series", ord, len(series)) - require.Greater(t, len(series), 0, "ordinal %d should receive some series", ord) - } - - // Verify 2: Same ordinal across different AZs receives the SAME series - // Group endpoints by ordinal - endpointsByOrdinal := make(map[int][]string) - for addr := range seriesByEndpoint { - ord := extractOrdinalFromAddress(t, addr) - endpointsByOrdinal[ord] = append(endpointsByOrdinal[ord], addr) - } - - for ord, addrs := range endpointsByOrdinal { - if len(addrs) < 2 { - continue - } - // All endpoints with the same ordinal should have received the exact same series - referenceSeries := seriesByEndpoint[addrs[0]] - for _, addr := range addrs[1:] { - otherSeries := seriesByEndpoint[addr] - require.Equal(t, len(referenceSeries), len(otherSeries), - "endpoints with ordinal %d should have same number of series", ord) - for seriesIdx := range referenceSeries { - _, ok := otherSeries[seriesIdx] - require.True(t, ok, - "series %d should be on all endpoints with ordinal %d", seriesIdx, ord) - } - } - t.Logf("Verified: All %d endpoints with ordinal %d have identical %d series", - len(addrs), ord, len(referenceSeries)) - } - - // Verify 3: Different ordinals receive DIFFERENT series (no overlap) - ordinalList := make([]int, 0, len(seriesByOrdinal)) - for ord := range seriesByOrdinal { - ordinalList = append(ordinalList, ord) - } - if len(ordinalList) >= 2 { - series1 := seriesByOrdinal[ordinalList[0]] - series2 := seriesByOrdinal[ordinalList[1]] - for seriesIdx := range series1 { - _, overlap := series2[seriesIdx] - require.False(t, overlap, - "series %d should not be on both ordinal %d and ordinal %d", - seriesIdx, ordinalList[0], ordinalList[1]) - } - t.Logf("Verified: Ordinals %d and %d have no overlapping series", ordinalList[0], ordinalList[1]) - } -} - -func TestAlignedOrdinalShardingValidation(t *testing.T) { - t.Parallel() - - endpoints := make([]Endpoint, 0, 15) - azs := []string{"az-a", "az-b", "az-c"} - for _, az := range azs { - for ord := 0; ord < 5; ord++ { - endpoints = append(endpoints, makeK8sEndpoint("pod-"+az, ord, az)) - } - } - - baseRing, err := newAlignedKetamaHashring(endpoints, SectionsPerNode, 3) - require.NoError(t, err) - - // Test shard size exceeding available ordinals - cfg := ShuffleShardingConfig{ - ShardSize: 10, // Only 5 ordinals available - AlignedOrdinalSharding: true, + expectError: false, + }, + "multiple AZs, different counts, stops at first missing shard > 0": { + inputEndpoints: []Endpoint{ep1a, ep0b, ep0a, ep1b, ep2a, ep0c}, + expectedResult: [][]Endpoint{ + {ep0a}, + {ep0b}, + {ep0c}, + }, + expectError: false, + }, + "error if shard 0 missing in any AZ": { + inputEndpoints: []Endpoint{ep1a, ep2a, ep1b}, + expectedResult: nil, + expectError: true, + errorContains: "missing endpoint with shard 0", + }, + "error if shard 0 missing in only one AZ": { + inputEndpoints: []Endpoint{ep0a, ep1a, ep1b}, + expectedResult: nil, + expectError: true, + errorContains: `AZ "zone-b" is missing endpoint with shard 0`, + }, + "error on duplicate shard within an AZ": { + inputEndpoints: []Endpoint{ep0a, ep1a, ep0b, duplicateEp0a}, + expectedResult: nil, + expectError: true, + errorContains: "duplicate endpoint shard 0 for address " + duplicateEp0a.Address + " in AZ zone-a", + }, + "AZ sorting check": { + inputEndpoints: []Endpoint{ep0b, ep0c, ep0a}, + expectedResult: [][]Endpoint{ + {ep0a}, + {ep0b}, + {ep0c}, + }, + expectError: false, + }, + "multiple AZs, stops correctly when next shard missing everywhere": { + inputEndpoints: []Endpoint{ep1a, ep0b, ep0a, ep1b, ep0c, ep1c}, + expectedResult: [][]Endpoint{ + {ep0a, ep1a}, + {ep0b, ep1b}, + {ep0c, ep1c}, + }, + expectError: false, + }, } - shardRing, err := newShuffleShardHashring(baseRing, cfg, 3, prometheus.NewRegistry(), "test-validation") - require.NoError(t, err) - - _, err = shardRing.getTenantShardAligned("test-tenant") - require.Error(t, err) - require.Contains(t, err.Error(), "exceeds available common ordinals") -} -// Helper function to extract ordinal from K8s-style address. -func extractOrdinalFromAddress(t *testing.T, address string) int { - t.Helper() - // Address format: pod-az-N.svc.test.svc.cluster.local:10901 - parts := strings.Split(address, ".") - require.Greater(t, len(parts), 0) - podPart := parts[0] // pod-az-N - lastDash := strings.LastIndex(podPart, "-") - require.Greater(t, lastDash, 0) - ordinalStr := podPart[lastDash+1:] - var ordinal int - _, err := fmt.Sscanf(ordinalStr, "%d", &ordinal) - require.NoError(t, err) - return ordinal -} + for tcName, tc := range testCases { + t.Run(tcName, func(t *testing.T) { + result, err := groupByAZ(tc.inputEndpoints) -// Helper function to extract unique ordinals from a shard. -func extractOrdinalsFromShard(t *testing.T, shard Hashring) []int { - t.Helper() - nodes := shard.Nodes() - ordinalSet := make(map[int]struct{}) - for _, node := range nodes { - ordinalSet[extractOrdinalFromAddress(t, node.Address)] = struct{}{} - } - ordinals := make([]int, 0, len(ordinalSet)) - for ord := range ordinalSet { - ordinals = append(ordinals, ord) - } - // Sort for consistent comparison - for i := 0; i < len(ordinals); i++ { - for j := i + 1; j < len(ordinals); j++ { - if ordinals[i] > ordinals[j] { - ordinals[i], ordinals[j] = ordinals[j], ordinals[i] + if tc.expectError { + testutil.NotOk(t, err) + if tc.errorContains != "" { + testutil.Assert(t, strings.Contains(err.Error(), tc.errorContains), "Expected error message to contain '%s', but got: %v", tc.errorContains, err) + } + testutil.Assert(t, result == nil, "Expected nil result on error, got: %v", result) + } else { + testutil.Ok(t, err) + testutil.Equals(t, tc.expectedResult, result) + + // Verify outer slice (AZs) is sorted alphabetically. + if err == nil && len(result) > 1 { + azOrderCorrect := sort.SliceIsSorted(result, func(i, j int) bool { + return result[i][0].AZ < result[j][0].AZ + }) + testutil.Assert(t, azOrderCorrect, "Outer slice is not sorted by AZ") + } } - } + }) } - return ordinals } diff --git a/pkg/receive/multitsdb.go b/pkg/receive/multitsdb.go index 8de78754abf..9c91be3725f 100644 --- a/pkg/receive/multitsdb.go +++ b/pkg/receive/multitsdb.go @@ -53,7 +53,7 @@ type MultiTSDB struct { reg prometheus.Registerer tsdbOpts *tsdb.Options tenantLabelName string - labels labels.Labels + labels labelpb.Labels bucket objstore.Bucket mtx *sync.RWMutex @@ -138,7 +138,7 @@ func NewMultiTSDB( l log.Logger, reg prometheus.Registerer, tsdbOpts *tsdb.Options, - labels labels.Labels, + labels labelpb.Labels, tenantLabelName string, bucket objstore.Bucket, allowOutOfOrderUpload bool, @@ -318,22 +318,26 @@ func (l *localClient) Matches(matchers []*labels.Matcher) bool { return l.store.Matches(matchers) } -func (l *localClient) LabelSets() []labels.Labels { - return labelpb.ZLabelSetsToPromLabelSets(l.store.LabelSet()...) +func (l *localClient) LabelSets() []labelpb.Labels { + result := make([]labelpb.Labels, len(l.store.LabelSet())) + for i, ls := range l.store.LabelSet() { + result[i] = ls.GetLabels() + } + return result } func (l *localClient) TimeRange() (mint int64, maxt int64) { return l.store.TimeRange() } -func (l *localClient) TSDBInfos() []infopb.TSDBInfo { +func (l *localClient) TSDBInfos() []*infopb.TSDBInfo { labelsets := l.store.LabelSet() if len(labelsets) == 0 { - return []infopb.TSDBInfo{} + return []*infopb.TSDBInfo{} } mint, maxt := l.store.TimeRange() - return []infopb.TSDBInfo{ + return []*infopb.TSDBInfo{ { Labels: labelsets[0], MinTime: mint, @@ -346,7 +350,7 @@ func (l *localClient) String() string { mint, maxt := l.store.TimeRange() return fmt.Sprintf( "LabelSets: %v MinTime: %d MaxTime: %d", - labelpb.PromLabelSetsToStringN(l.LabelSets(), 500), mint, maxt, + labelpb.LabelSetsToStringN(l.LabelSets(), 500), mint, maxt, ) } @@ -835,7 +839,7 @@ func (t *MultiTSDB) startTSDB(logger log.Logger, tenantID string, tenant *tenant reg := prometheus.WrapRegistererWith(prometheus.Labels{"tenant": tenantID}, t.reg) reg = NewUnRegisterer(reg) - initialLset := labelpb.ExtendSortedLabels(t.labels, labels.FromStrings(t.tenantLabelName, tenantID)) + initialLset := labelpb.ExtendSortedLabels(t.labels, labelpb.FromStrings(t.tenantLabelName, tenantID)) lset := t.extractTenantsLabels(tenantID, initialLset) dataDir := t.defaultTenantDataDir(tenantID) @@ -893,7 +897,7 @@ func (t *MultiTSDB) startTSDB(logger log.Logger, tenantID string, tenant *tenant reg, dataDir, tenantBucket, - func() labels.Labels { return lset }, + func() labelpb.Labels { return lset }, metadata.ReceiveSource, nil, t.allowOutOfOrderUpload, @@ -981,7 +985,7 @@ func (t *MultiTSDB) SetHashringConfig(cfg []HashringConfig) error { if t.tenants[tenantID] != nil { updatedTenants = append(updatedTenants, tenantID) - lset := labelpb.ExtendSortedLabels(t.labels, labels.FromStrings(t.tenantLabelName, tenantID)) + lset := labelpb.ExtendSortedLabels(t.labels, labelpb.FromStrings(t.tenantLabelName, tenantID)) lset = labelpb.ExtendSortedLabels(hc.ExternalLabels, lset) if t.tenants[tenantID].ship != nil { @@ -1154,7 +1158,7 @@ func (u *UnRegisterer) MustRegister(cs ...prometheus.Collector) { // extractTenantsLabels extracts tenant's external labels from hashring configs. // If one tenant appears in multiple hashring configs, // only the external label set from the first hashring config is applied. -func (t *MultiTSDB) extractTenantsLabels(tenantID string, initialLset labels.Labels) labels.Labels { +func (t *MultiTSDB) extractTenantsLabels(tenantID string, initialLset labelpb.Labels) labelpb.Labels { for _, hc := range t.hashringConfigs { for _, tenant := range hc.Tenants { if tenant != tenantID { diff --git a/pkg/receive/multitsdb_test.go b/pkg/receive/multitsdb_test.go index 2c46607b6dd..da12ff5aadc 100644 --- a/pkg/receive/multitsdb_test.go +++ b/pkg/receive/multitsdb_test.go @@ -37,6 +37,7 @@ import ( "github.com/thanos-io/thanos/pkg/store" "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" + thanostestutil "github.com/thanos-io/thanos/pkg/testutil" ) func TestMultiTSDB(t *testing.T) { @@ -53,7 +54,7 @@ func TestMultiTSDB(t *testing.T) { NoLockfile: true, MaxExemplars: 100, EnableExemplarStorage: true, - }, labels.FromStrings("replica", "01"), "tenant_id", nil, false, metadata.NoneFunc) + }, labelpb.FromStrings("replica", "01"), "tenant_id", nil, false, metadata.NoneFunc) defer func() { testutil.Ok(t, m.Close()) }() testutil.Ok(t, m.Flush()) @@ -132,7 +133,7 @@ func TestMultiTSDB(t *testing.T) { RetentionDuration: (6 * time.Hour).Milliseconds(), NoLockfile: true, }, - labels.FromStrings("replica", "01"), + labelpb.FromStrings("replica", "01"), "tenant_id", nil, false, @@ -173,7 +174,7 @@ func TestMultiTSDB(t *testing.T) { MaxBlockDuration: (2 * time.Hour).Milliseconds(), RetentionDuration: (6 * time.Hour).Milliseconds(), NoLockfile: true, - }, labels.FromStrings("replica", "01"), "tenant_id", nil, false, metadata.NoneFunc) + }, labelpb.FromStrings("replica", "01"), "tenant_id", nil, false, metadata.NoneFunc) defer func() { testutil.Ok(t, m.Close()) }() testutil.Ok(t, m.Flush()) @@ -191,12 +192,22 @@ func TestMultiTSDB(t *testing.T) { var ( expectedFooResp = &storepb.Series{ - Labels: []labelpb.ZLabel{{Name: "a", Value: "1"}, {Name: "b", Value: "2"}, {Name: "replica", Value: "01"}, {Name: "tenant_id", Value: "foo"}}, - Chunks: []storepb.AggrChunk{{MinTime: 1, MaxTime: 3, Raw: &storepb.Chunk{Data: []byte("\000\003\002@\003L\235\2354X\315\001\330\r\257Mui\251\327:U"), Hash: 9768694233508509040}}}, + Labels: labelpb.Labels{ + {Name: "a", Value: "1"}, + {Name: "b", Value: "2"}, + {Name: "replica", Value: "01"}, + {Name: "tenant_id", Value: "foo"}, + }, + Chunks: []*storepb.AggrChunk{{MinTime: 1, MaxTime: 3, Raw: &storepb.Chunk{Data: []byte("\000\003\002@\003L\235\2354X\315\001\330\r\257Mui\251\327:U"), Hash: 9768694233508509040}}}, } expectedBarResp = &storepb.Series{ - Labels: []labelpb.ZLabel{{Name: "a", Value: "1"}, {Name: "b", Value: "2"}, {Name: "replica", Value: "01"}, {Name: "tenant_id", Value: "bar"}}, - Chunks: []storepb.AggrChunk{{MinTime: 1, MaxTime: 3, Raw: &storepb.Chunk{Data: []byte("\000\003\002@4i\223\263\246\213\032\001\330\035i\337\322\352\323S\256t\270"), Hash: 2304287992246504442}}}, + Labels: labelpb.Labels{ + {Name: "a", Value: "1"}, + {Name: "b", Value: "2"}, + {Name: "replica", Value: "01"}, + {Name: "tenant_id", Value: "bar"}, + }, + Chunks: []*storepb.AggrChunk{{MinTime: 1, MaxTime: 3, Raw: &storepb.Chunk{Data: []byte("\000\003\002@4i\223\263\246\213\032\001\330\035i\337\322\352\323S\256t\270"), Hash: 2304287992246504442}}}, } ) @@ -236,12 +247,12 @@ Outer: if !ok { break Outer } - testutil.Equals(t, expectedFooResp, r) + thanostestutil.ProtoEquals(t, expectedFooResp, r) case r, ok := <-respBar: if !ok { break Outer } - testutil.Equals(t, expectedBarResp, r) + thanostestutil.ProtoEquals(t, expectedBarResp, r) } } testutil.Ok(t, err) @@ -251,7 +262,7 @@ func getResponses(storeClient store.Client, respCh chan<- *storepb.Series) error sc, err := storeClient.Series(context.Background(), &storepb.SeriesRequest{ MinTime: 0, MaxTime: 10, - Matchers: []storepb.LabelMatcher{{Name: "a", Value: ".*", Type: storepb.LabelMatcher_RE}}, + Matchers: []*storepb.LabelMatcher{{Name: "a", Value: ".*", Type: storepb.LabelMatcher_RE}}, }) if err != nil { return err @@ -274,9 +285,9 @@ func getResponses(storeClient store.Client, respCh chan<- *storepb.Series) error } var ( - expectedFooRespExemplars = []exemplarspb.ExemplarData{ + expectedFooRespExemplars = []*exemplarspb.ExemplarData{ { - SeriesLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "a", Value: "1"}, {Name: "b", Value: "2"}, {Name: "replica", Value: "01"}, {Name: "tenant_id", Value: "foo"}}}, + SeriesLabels: labelpb.LabelSetFromStrings("a", "1", "b", "2", "replica", "01", "tenant_id", "foo"), Exemplars: []*exemplarspb.Exemplar{ {Value: 1, Ts: 1}, {Value: 2.1212, Ts: 2}, @@ -284,13 +295,13 @@ var ( }, }, } - expectedBarRespExemplars = []exemplarspb.ExemplarData{ + expectedBarRespExemplars = []*exemplarspb.ExemplarData{ { - SeriesLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "a", Value: "1"}, {Name: "b", Value: "2"}, {Name: "replica", Value: "01"}, {Name: "tenant_id", Value: "bar"}}}, + SeriesLabels: labelpb.LabelSetFromStrings("a", "1", "b", "2", "replica", "01", "tenant_id", "bar"), Exemplars: []*exemplarspb.Exemplar{ - {Value: 11, Ts: 1, Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "traceID", Value: "abc"}}}}, - {Value: 22.1212, Ts: 2, Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "traceID", Value: "def"}}}}, - {Value: 33.1313, Ts: 3, Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "traceID", Value: "ghi"}}}}, + {Value: 11, Ts: 1, Labels: labelpb.LabelSetFromStrings("traceID", "abc")}, + {Value: 22.1212, Ts: 2, Labels: labelpb.LabelSetFromStrings("traceID", "def")}, + {Value: 33.1313, Ts: 3, Labels: labelpb.LabelSetFromStrings("traceID", "ghi")}, }, }, } @@ -298,8 +309,8 @@ var ( func testMultiTSDBExemplars(t *testing.T, m *MultiTSDB) { g := &errgroup.Group{} - respFoo := make(chan []exemplarspb.ExemplarData) - respBar := make(chan []exemplarspb.ExemplarData) + respFoo := make(chan []*exemplarspb.ExemplarData) + respBar := make(chan []*exemplarspb.ExemplarData) for i := 0; i < 100; i++ { s := m.TSDBExemplars() testutil.Assert(t, len(s) == 2) @@ -362,7 +373,7 @@ type exemplarsServer struct { ctx context.Context - Data []exemplarspb.ExemplarData + Data []*exemplarspb.ExemplarData Warnings []string Size int64 @@ -373,7 +384,7 @@ func newExemplarsServer(ctx context.Context) *exemplarsServer { } func (e *exemplarsServer) Send(r *exemplarspb.ExemplarsResponse) error { - e.Size += int64(r.Size()) + e.Size += int64(r.SizeVT()) if r.GetWarning() != "" { e.Warnings = append(e.Warnings, r.GetWarning()) @@ -381,7 +392,7 @@ func (e *exemplarsServer) Send(r *exemplarspb.ExemplarsResponse) error { } if r.GetData() != nil { - e.Data = append(e.Data, *r.GetData()) + e.Data = append(e.Data, r.GetData()) return nil } @@ -393,13 +404,13 @@ func (s *exemplarsServer) Context() context.Context { return s.ctx } -func checkExemplarsResponse(t *testing.T, expected, data []exemplarspb.ExemplarData) { +func checkExemplarsResponse(t *testing.T, expected, data []*exemplarspb.ExemplarData) { testutil.Equals(t, len(expected), len(data)) for i := range data { - testutil.Equals(t, expected[i].SeriesLabels, data[i].SeriesLabels) + thanostestutil.ProtoEquals(t, expected[i].SeriesLabels, data[i].SeriesLabels) testutil.Equals(t, len(expected[i].Exemplars), len(data[i].Exemplars)) for j := range data[i].Exemplars { - testutil.Equals(t, *expected[i].Exemplars[j], *data[i].Exemplars[j]) + thanostestutil.ProtoEquals(t, expected[i].Exemplars[j], data[i].Exemplars[j]) } } } @@ -437,7 +448,7 @@ func TestMultiTSDBPrune(t *testing.T) { MaxBlockDuration: (2 * time.Hour).Milliseconds(), RetentionDuration: (6 * time.Hour).Milliseconds(), }, - labels.FromStrings("replica", "test"), + labelpb.FromStrings("replica", "test"), "tenant_id", test.bucket, false, @@ -512,7 +523,7 @@ func TestMultiTSDBRecreatePrunedTenant(t *testing.T) { MaxBlockDuration: (2 * time.Hour).Milliseconds(), RetentionDuration: (6 * time.Hour).Milliseconds(), }, - labels.FromStrings("replica", "test"), + labelpb.FromStrings("replica", "test"), "tenant_id", objstore.NewInMemBucket(), false, @@ -541,7 +552,7 @@ func TestMultiTSDBAddNewTenant(t *testing.T) { MaxBlockDuration: (2 * time.Hour).Milliseconds(), RetentionDuration: (6 * time.Hour).Milliseconds(), }, - labels.FromStrings("replica", "test"), + labelpb.FromStrings("replica", "test"), "tenant_id", objstore.NewInMemBucket(), false, @@ -616,7 +627,7 @@ func TestAlignedHeadFlush(t *testing.T) { MaxBlockDuration: (2 * time.Hour).Milliseconds(), RetentionDuration: (6 * time.Hour).Milliseconds(), }, - labels.FromStrings("replica", "test"), + labelpb.FromStrings("replica", "test"), "tenant_id", test.bucket, false, @@ -692,7 +703,7 @@ func TestMultiTSDBStats(t *testing.T) { MaxBlockDuration: (2 * time.Hour).Milliseconds(), RetentionDuration: (6 * time.Hour).Milliseconds(), }, - labels.FromStrings("replica", "test"), + labelpb.FromStrings("replica", "test"), "tenant_id", nil, false, @@ -723,7 +734,7 @@ func TestMultiTSDBWithNilStore(t *testing.T) { MaxBlockDuration: (2 * time.Hour).Milliseconds(), RetentionDuration: (6 * time.Hour).Milliseconds(), }, - labels.FromStrings("replica", "test"), + labelpb.FromStrings("replica", "test"), "tenant_id", nil, false, @@ -766,7 +777,7 @@ func TestProxyLabelValues(t *testing.T) { MaxBlockDuration: 5 * time.Minute.Milliseconds(), NoLockfile: true, }, - labels.FromStrings("replica", "01"), + labelpb.FromStrings("replica", "01"), "tenant_id", nil, false, @@ -837,7 +848,7 @@ func queryLabelValues(ctx context.Context, m *MultiTSDB) error { clients[0] = &slowClient{clients[0]} } return clients - }, component.Store, labels.EmptyLabels(), 1*time.Minute, store.LazyRetrieval) + }, component.Store, labelpb.EmptyLabels(), 1*time.Minute, store.LazyRetrieval) req := &storepb.LabelValuesRequest{ Label: labels.MetricName, @@ -859,7 +870,7 @@ func BenchmarkMultiTSDB(b *testing.B) { MaxBlockDuration: (2 * time.Hour).Milliseconds(), RetentionDuration: (6 * time.Hour).Milliseconds(), NoLockfile: true, - }, labels.FromStrings("replica", "test"), + }, labelpb.FromStrings("replica", "test"), "tenant_id", nil, false, @@ -962,7 +973,7 @@ func TestMultiTSDBBlockedTenantUploads(t *testing.T) { MaxBlockDuration: (2 * time.Hour).Milliseconds(), RetentionDuration: (6 * time.Hour).Milliseconds(), }, - labels.FromStrings("replica", "test"), + labelpb.FromStrings("replica", "test"), "tenant_id", bucket, false, @@ -1063,7 +1074,7 @@ func TestMultiTSDBNoUploadTenantsPrefix(t *testing.T) { MaxBlockDuration: (2 * time.Hour).Milliseconds(), RetentionDuration: (6 * time.Hour).Milliseconds(), }, - labels.FromStrings("replica", "test"), + labelpb.FromStrings("replica", "test"), "tenant_id", bucket, false, @@ -1113,7 +1124,7 @@ func TestNoUploadTenantsRetentionStillWorks(t *testing.T) { MaxBlockDuration: (2 * time.Hour).Milliseconds(), RetentionDuration: (6 * time.Hour).Milliseconds(), }, - labels.FromStrings("replica", "test"), + labelpb.FromStrings("replica", "test"), "tenant_id", bucket, false, @@ -1158,7 +1169,7 @@ func TestTenantBucketPrefixInUpload(t *testing.T) { MaxBlockDuration: (2 * time.Hour).Milliseconds(), RetentionDuration: (6 * time.Hour).Milliseconds(), }, - labels.FromStrings("replica", "test"), + labelpb.FromStrings("replica", "test"), "tenant_id", bucket, false, @@ -1262,7 +1273,7 @@ func TestMultiTSDBSkipsLostAndFound(t *testing.T) { MaxBlockDuration: (2 * time.Hour).Milliseconds(), RetentionDuration: (6 * time.Hour).Milliseconds(), }, - labels.FromStrings("replica", "test"), + labelpb.FromStrings("replica", "test"), "tenant_id", nil, false, @@ -1289,7 +1300,7 @@ func TestMultiTSDBCompactionDelayInterval(t *testing.T) { MinBlockDuration: (2 * time.Hour).Milliseconds(), MaxBlockDuration: (2 * time.Hour).Milliseconds(), RetentionDuration: (6 * time.Hour).Milliseconds(), - }, labels.FromStrings("replica", "test"), "tenant_id", nil, false, metadata.NoneFunc, + }, labelpb.FromStrings("replica", "test"), "tenant_id", nil, false, metadata.NoneFunc, WithCompactionDelayInterval(interval)) t.Cleanup(func() { testutil.Ok(t, m.Close()) diff --git a/pkg/receive/readiness_integration_test.go b/pkg/receive/readiness_integration_test.go index a1b8c9d7f8a..59f56d66d0d 100644 --- a/pkg/receive/readiness_integration_test.go +++ b/pkg/receive/readiness_integration_test.go @@ -104,7 +104,7 @@ func testReadinessWithGRPCServer(t *testing.T, enableReadiness bool) { time.Sleep(200 * time.Millisecond) // Create client connection - conn, err := grpc.Dial(addr, grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient(addr, grpc.WithTransportCredentials(insecure.NewCredentials())) testutil.Ok(t, err) defer conn.Close() diff --git a/pkg/receive/readiness_test.go b/pkg/receive/readiness_test.go index 5b7fe69fd98..c4ccc035e4a 100644 --- a/pkg/receive/readiness_test.go +++ b/pkg/receive/readiness_test.go @@ -82,7 +82,7 @@ func TestReadinessInterceptors(t *testing.T) { // Wait for server to start time.Sleep(100 * time.Millisecond) - conn, err := grpc.Dial(addr, grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient(addr, grpc.WithTransportCredentials(insecure.NewCredentials())) testutil.Ok(t, err) defer conn.Close() diff --git a/pkg/receive/receive_test.go b/pkg/receive/receive_test.go index 1ab909fd5fb..aab10d05e0d 100644 --- a/pkg/receive/receive_test.go +++ b/pkg/receive/receive_test.go @@ -50,7 +50,7 @@ func TestAddingExternalLabelsForTenants(t *testing.T) { { Endpoints: []Endpoint{{Address: "node1"}}, Tenants: []string{"tenant1"}, - ExternalLabels: labels.FromStrings("name1", "value1"), + ExternalLabels: labelpb.FromStrings("name1", "value1"), }, }, expectedExternalLabelSets: []labels.Labels{ @@ -63,11 +63,11 @@ func TestAddingExternalLabelsForTenants(t *testing.T) { { Endpoints: []Endpoint{{Address: "node1"}}, Tenants: []string{"tenant1"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name1": "value1", - "name2": "value2", - "name3": "value3", - }), + ExternalLabels: labelpb.FromStrings( + "name1", "value1", + "name2", "value2", + "name3", "value3", + ), }, }, expectedExternalLabelSets: []labels.Labels{ @@ -93,11 +93,9 @@ func TestAddingExternalLabelsForTenants(t *testing.T) { name: "Multiple tenants - One label", cfg: []HashringConfig{ { - Endpoints: []Endpoint{{Address: "node1"}}, - Tenants: []string{"tenant1", "tenant2", "tenant3"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name1": "value1", - }), + Endpoints: []Endpoint{{Address: "node1"}}, + Tenants: []string{"tenant1", "tenant2", "tenant3"}, + ExternalLabels: labelpb.FromStrings("name1", "value1"), }, }, expectedExternalLabelSets: []labels.Labels{ @@ -112,11 +110,11 @@ func TestAddingExternalLabelsForTenants(t *testing.T) { { Endpoints: []Endpoint{{Address: "node1"}}, Tenants: []string{"tenant1", "tenant2", "tenant3"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name3": "value3", - "name2": "value2", - "name1": "value1", - }), + ExternalLabels: labelpb.FromStrings( + "name3", "value3", + "name2", "value2", + "name1", "value1", + ), }, }, expectedExternalLabelSets: []labels.Labels{ @@ -134,20 +132,20 @@ func TestAddingExternalLabelsForTenants(t *testing.T) { { Endpoints: []Endpoint{{Address: "node1"}}, Tenants: []string{"tenant1", "tenant2", "tenant3"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name1": "value1", - "name2": "value2", - "name3": "value3", - }), + ExternalLabels: labelpb.FromStrings( + "name1", "value1", + "name2", "value2", + "name3", "value3", + ), }, { Endpoints: []Endpoint{{Address: "node2"}}, Tenants: []string{"tenant4", "tenant5", "tenant6"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name6": "value6", - "name5": "value5", - "name4": "value4", - }), + ExternalLabels: labelpb.FromStrings( + "name4", "value4", + "name5", "value5", + "name6", "value6", + ), }, }, expectedExternalLabelSets: []labels.Labels{ @@ -171,20 +169,20 @@ func TestAddingExternalLabelsForTenants(t *testing.T) { { Endpoints: []Endpoint{{Address: "node1"}}, Tenants: []string{"tenant1", "tenant2", "tenant3"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name3": "value3", - "name2": "value2", - "name1": "value1", - }), + ExternalLabels: labelpb.FromStrings( + "name1", "value1", + "name2", "value2", + "name3", "value3", + ), }, { Endpoints: []Endpoint{{Address: "node2"}}, Tenants: []string{"tenant4", "tenant5", "tenant1"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name4": "value4", - "name5": "value5", - "name6": "value6", - }), + ExternalLabels: labelpb.FromStrings( + "name4", "value4", + "name5", "value5", + "name6", "value6", + ), }, }, expectedExternalLabelSets: []labels.Labels{ @@ -245,11 +243,11 @@ func TestLabelSetsOfTenantsWhenAddingTenants(t *testing.T) { { Endpoints: []Endpoint{{Address: "node1"}}, Tenants: []string{"tenant1", "tenant2", "tenant3"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name1": "value1", - "name2": "value2", - "name3": "value3", - }), + ExternalLabels: labelpb.FromStrings( + "name1", "value1", + "name2", "value2", + "name3", "value3", + ), }, } initialExpectedExternalLabelSets := []labels.Labels{ @@ -265,11 +263,11 @@ func TestLabelSetsOfTenantsWhenAddingTenants(t *testing.T) { { Endpoints: []Endpoint{{Address: "node1"}}, Tenants: []string{"tenant1", "tenant2", "tenant3", "tenant4", "tenant5"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name1": "value1", - "name2": "value2", - "name3": "value3", - }), + ExternalLabels: labelpb.FromStrings( + "name1", "value1", + "name2", "value2", + "name3", "value3", + ), }, } changedExpectedExternalLabelSets := []labels.Labels{ @@ -356,20 +354,20 @@ func TestLabelSetsOfTenantsWhenChangingLabels(t *testing.T) { { Endpoints: []Endpoint{{Address: "node1"}}, Tenants: []string{"tenant1", "tenant2", "tenant3"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name1": "value1", - "name2": "value2", - "name3": "value3", - }), + ExternalLabels: labelpb.FromStrings( + "name1", "value1", + "name2", "value2", + "name3", "value3", + ), }, { Endpoints: []Endpoint{{Address: "node2"}}, Tenants: []string{"tenant4", "tenant5", "tenant6"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name6": "value6", - "name5": "value5", - "name4": "value4", - }), + ExternalLabels: labelpb.FromStrings( + "name4", "value4", + "name5", "value5", + "name6", "value6", + ), }, } initialExpectedExternalLabelSets := []labels.Labels{ @@ -398,22 +396,22 @@ func TestLabelSetsOfTenantsWhenChangingLabels(t *testing.T) { { Endpoints: []Endpoint{{Address: "node1"}}, Tenants: []string{"tenant1", "tenant2", "tenant3"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name1": "value1", - "name2": "value2", - "name3": "value3", - "name4": "value4", - }), + ExternalLabels: labelpb.FromStrings( + "name1", "value1", + "name2", "value2", + "name3", "value3", + "name4", "value4", + ), }, { Endpoints: []Endpoint{{Address: "node2"}}, Tenants: []string{"tenant4", "tenant5", "tenant6"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name4": "value4", - "name5": "value5", - "name6": "value6", - "name7": "value7", - }), + ExternalLabels: labelpb.FromStrings( + "name4", "value4", + "name5", "value5", + "name6", "value6", + "name7", "value7", + ), }, }, changedExpectedExternalLabelSets: []labels.Labels{ @@ -437,18 +435,18 @@ func TestLabelSetsOfTenantsWhenChangingLabels(t *testing.T) { { Endpoints: []Endpoint{{Address: "node1"}}, Tenants: []string{"tenant1", "tenant2", "tenant3"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name1": "value1", - "name2": "value2", - }), + ExternalLabels: labelpb.FromStrings( + "name1", "value1", + "name2", "value2", + ), }, { Endpoints: []Endpoint{{Address: "node2"}}, Tenants: []string{"tenant4", "tenant5", "tenant6"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name4": "value4", - "name5": "value5", - }), + ExternalLabels: labelpb.FromStrings( + "name4", "value4", + "name5", "value5", + ), }, }, changedExpectedExternalLabelSets: []labels.Labels{ @@ -493,20 +491,20 @@ func TestLabelSetsOfTenantsWhenChangingLabels(t *testing.T) { { Endpoints: []Endpoint{{Address: "node1"}}, Tenants: []string{"tenant1", "tenant2", "tenant3"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name1": "value3", - "name2": "value2", - "name3": "value3", - }), + ExternalLabels: labelpb.FromStrings( + "name1", "value3", + "name2", "value2", + "name3", "value3", + ), }, { Endpoints: []Endpoint{{Address: "node2"}}, Tenants: []string{"tenant4", "tenant5", "tenant6"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name4": "value6", - "name5": "value5", - "name6": "value6", - }), + ExternalLabels: labelpb.FromStrings( + "name4", "value6", + "name5", "value5", + "name6", "value6", + ), }, }, changedExpectedExternalLabelSets: []labels.Labels{ @@ -588,20 +586,20 @@ func TestAddingLabelsWhenTenantAppearsInMultipleHashrings(t *testing.T) { { Endpoints: []Endpoint{{Address: "node1"}}, Tenants: []string{"tenant1", "tenant2", "tenant3"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name3": "value3", - "name2": "value2", - "name1": "value1", - }), + ExternalLabels: labelpb.FromStrings( + "name1", "value1", + "name2", "value2", + "name3", "value3", + ), }, { Endpoints: []Endpoint{{Address: "node2"}}, Tenants: []string{"tenant4", "tenant5", "tenant1"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name4": "value4", - "name5": "value5", - "name6": "value6", - }), + ExternalLabels: labelpb.FromStrings( + "name4", "value4", + "name5", "value5", + "name6", "value6", + ), }, } initialExpectedExternalLabelSets := []labels.Labels{ @@ -628,21 +626,21 @@ func TestAddingLabelsWhenTenantAppearsInMultipleHashrings(t *testing.T) { { Endpoints: []Endpoint{{Address: "node1"}}, Tenants: []string{"tenant1", "tenant2", "tenant3"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name1": "value1", - "name2": "value2", - "name3": "value3", - "name4": "value4", - }), + ExternalLabels: labelpb.FromStrings( + "name1", "value1", + "name2", "value2", + "name3", "value3", + "name4", "value4", + ), }, { Endpoints: []Endpoint{{Address: "node2"}}, Tenants: []string{"tenant4", "tenant5", "tenant1"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name4": "value4", - "name5": "value5", - "name6": "value6", - }), + ExternalLabels: labelpb.FromStrings( + "name4", "value4", + "name5", "value5", + "name6", "value6", + ), }, }, changedExpectedExternalLabelSets: []labels.Labels{ @@ -664,21 +662,21 @@ func TestAddingLabelsWhenTenantAppearsInMultipleHashrings(t *testing.T) { { Endpoints: []Endpoint{{Address: "node1"}}, Tenants: []string{"tenant1", "tenant2", "tenant3"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name1": "value1", - "name2": "value2", - "name3": "value3", - }), + ExternalLabels: labelpb.FromStrings( + "name1", "value1", + "name2", "value2", + "name3", "value3", + ), }, { Endpoints: []Endpoint{{Address: "node2"}}, Tenants: []string{"tenant4", "tenant5", "tenant1"}, - ExternalLabels: labels.FromMap(map[string]string{ - "name4": "value4", - "name5": "value5", - "name6": "value6", - "name7": "value7", - }), + ExternalLabels: labelpb.FromStrings( + "name4", "value4", + "name5", "value5", + "name6", "value6", + "name7", "value7", + ), }, }, changedExpectedExternalLabelSets: []labels.Labels{ @@ -758,11 +756,11 @@ func TestReceiverLabelsNotOverwrittenByExternalLabels(t *testing.T) { { Endpoints: []Endpoint{{Address: "node1"}}, Tenants: []string{"tenant1"}, - ExternalLabels: labels.FromMap(map[string]string{ - "replica": "0", - "tenant_id": "tenant2", - "name3": "value3", - }), + ExternalLabels: labelpb.FromStrings( + "name3", "value3", + "replica", "0", + "tenant_id", "tenant2", + ), }, } expectedExternalLabelSets := []labels.Labels{ @@ -814,7 +812,7 @@ func initializeMultiTSDB(dir string) *MultiTSDB { MaxBlockDuration: (2 * time.Hour).Milliseconds(), RetentionDuration: (6 * time.Hour).Milliseconds(), }, - labels.FromStrings("replica", "test"), + labelpb.FromStrings("replica", "test"), "tenant_id", bucket, false, @@ -833,13 +831,21 @@ func setupSetsOfExpectedAndActualStoreClientLabelSets( for i := 0; i < len(actualStoreClients); i++ { testStore := store.TSDBStore{} - testStore.SetExtLset(expectedExternalLabelSets[i]) + testStore.SetExtLset(labelpb.FromPromLabels(expectedExternalLabelSets[i])) - expectedClientLabelSets := labelpb.ZLabelSetsToPromLabelSets(testStore.LabelSet()...) - setOfExpectedClientLabelSets = append(setOfExpectedClientLabelSets, expectedClientLabelSets) + lsets := testStore.LabelSet() + expectedClientLabelSets := make([]labels.Labels, len(lsets)) + for j, ls := range lsets { + expectedClientLabelSets[j] = ls.PromLabels() + } + setOfExpectedClientLabelSets[i] = expectedClientLabelSets - actualClientLabelSets := actualStoreClients[i].LabelSets() - setOfActualClientLabelSets = append(setOfActualClientLabelSets, actualClientLabelSets) + actualLabelSets := actualStoreClients[i].LabelSets() + actualClientLabelSets := make([]labels.Labels, len(actualLabelSets)) + for j, ls := range actualLabelSets { + actualClientLabelSets[j] = labelpb.ToPromLabels(ls) + } + setOfActualClientLabelSets[i] = actualClientLabelSets } return setOfExpectedClientLabelSets, setOfActualClientLabelSets diff --git a/pkg/receive/rendezvous_hashring.go b/pkg/receive/rendezvous_hashring.go new file mode 100644 index 00000000000..220ad26f864 --- /dev/null +++ b/pkg/receive/rendezvous_hashring.go @@ -0,0 +1,108 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +package receive + +import ( + "encoding/binary" + "fmt" + + "github.com/cespare/xxhash" + "github.com/pkg/errors" + + "github.com/thanos-io/thanos/pkg/store/labelpb" + "github.com/thanos-io/thanos/pkg/store/storepb/prompb" +) + +// rendezvousHashring distributes series across shards using rendezvous (highest random weight) hashing. +// For each series, it computes hash(seriesKey, shard) for every shard and picks the shard with the +// highest hash value. This avoids virtual nodes entirely while providing good distribution. +type rendezvousHashring struct { + azEndpoints [][]Endpoint // [azIndex][shardIndex] → Endpoint + sortedAZs []string + numShards int + replicationFactor uint64 + flatEndpoints []Endpoint +} + +func newRendezvousHashring(endpoints []Endpoint, replicationFactor uint64) (*rendezvousHashring, error) { + if replicationFactor == 0 { + return nil, errors.New("replication factor cannot be zero") + } + + groupedEndpoints, err := groupByAZ(endpoints) + if err != nil { + return nil, errors.Wrap(err, "failed to group endpoints by AZ") + } + + numAZs := len(groupedEndpoints) + if numAZs == 0 { + return nil, errors.New("no endpoint groups found after grouping by AZ") + } + if uint64(numAZs) != replicationFactor { + return nil, fmt.Errorf("number of AZs (%d) must equal replication factor (%d)", numAZs, replicationFactor) + } + + numShards := len(groupedEndpoints[0]) + if numShards == 0 { + return nil, errors.New("AZ groups are empty after grouping") + } + + // Build sorted AZ names from groupedEndpoints (already sorted by groupByAZ). + sortedAZs := make([]string, numAZs) + for i := range groupedEndpoints { + sortedAZs[i] = groupedEndpoints[i][0].AZ + } + + // Build flat endpoint list: all AZ0 endpoints, then AZ1, etc. + flatEndpoints := make([]Endpoint, 0, numAZs*numShards) + for azIdx := 0; azIdx < numAZs; azIdx++ { + flatEndpoints = append(flatEndpoints, groupedEndpoints[azIdx]...) + } + + return &rendezvousHashring{ + azEndpoints: groupedEndpoints, + sortedAZs: sortedAZs, + numShards: numShards, + replicationFactor: replicationFactor, + flatEndpoints: flatEndpoints, + }, nil +} + +func (r *rendezvousHashring) GetN(tenant string, ts *prompb.TimeSeries, n uint64) (Endpoint, error) { + if n >= r.replicationFactor { + return Endpoint{}, &insufficientNodesError{have: r.replicationFactor, want: n + 1} + } + + seriesKey := labelpb.HashWithPrefix(tenant, ts.Labels) + + // Rendezvous hashing: for each shard, compute hash(seriesKey, shard), pick the max. + // buf is a fixed-size stack array: 8 bytes seriesKey + 2 bytes shard (little-endian). + bestShard := 0 + bestHash := uint64(0) + + var buf [10]byte + binary.LittleEndian.PutUint64(buf[:8], seriesKey) + + for shard := 0; shard < r.numShards; shard++ { + binary.LittleEndian.PutUint16(buf[8:], uint16(shard)) + h := xxhash.Sum64(buf[:]) + if shard == 0 || h > bestHash { + bestHash = h + bestShard = shard + } + } + + // n selects the AZ (replica index). + return r.azEndpoints[n][bestShard], nil +} + +func (r *rendezvousHashring) Get(tenant string, ts *prompb.TimeSeries) (Endpoint, error) { + return r.GetN(tenant, ts, 0) +} + +func (r *rendezvousHashring) Nodes() []Endpoint { + return r.flatEndpoints +} + +func (r *rendezvousHashring) Close() {} diff --git a/pkg/receive/rendezvous_hashring_test.go b/pkg/receive/rendezvous_hashring_test.go new file mode 100644 index 00000000000..abe36bb896c --- /dev/null +++ b/pkg/receive/rendezvous_hashring_test.go @@ -0,0 +1,593 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +package receive + +import ( + "fmt" + "math" + "sort" + "strings" + "testing" + + "github.com/prometheus/client_golang/prometheus" + "github.com/stretchr/testify/require" + + "github.com/thanos-io/thanos/pkg/store/labelpb" + "github.com/thanos-io/thanos/pkg/store/storepb/prompb" +) + +// makeK8sEndpoint creates an endpoint with K8s-style DNS name. +func makeK8sEndpoint(podName string, shard int, az string) Endpoint { + return Endpoint{ + Address: fmt.Sprintf("%s-%d.svc.test.svc.cluster.local:10901", podName, shard), + AZ: az, + Shard: shard, + } +} + +// extractShardFromAddress extracts shard number from K8s-style address. +func extractShardFromAddress(t *testing.T, address string) int { + t.Helper() + // Address format: pod-az-N.svc.test.svc.cluster.local:10901 + parts := strings.Split(address, ".") + require.Greater(t, len(parts), 0) + podPart := parts[0] // pod-az-N + lastDash := strings.LastIndex(podPart, "-") + require.Greater(t, lastDash, 0) + shardStr := podPart[lastDash+1:] + var shard int + _, err := fmt.Sscanf(shardStr, "%d", &shard) + require.NoError(t, err) + return shard +} + +// extractShardsFromSubring extracts unique shards from a subring. +func extractShardsFromSubring(t *testing.T, subring Hashring) []int { + t.Helper() + nodes := subring.Nodes() + shardSet := make(map[int]struct{}) + for _, node := range nodes { + shardSet[extractShardFromAddress(t, node.Address)] = struct{}{} + } + shards := make([]int, 0, len(shardSet)) + for s := range shardSet { + shards = append(shards, s) + } + sort.Ints(shards) + return shards +} + +func TestRendezvousHashringConstructor(t *testing.T) { + t.Parallel() + + ep0a := Endpoint{Address: podDNS("pod", 0), AZ: "zone-a", Shard: 0} + ep1a := Endpoint{Address: podDNS("pod", 1), AZ: "zone-a", Shard: 1} + ep0b := Endpoint{Address: podDNS("pod", 0), AZ: "zone-b", Shard: 0} + ep1b := Endpoint{Address: podDNS("pod", 1), AZ: "zone-b", Shard: 1} + ep0c := Endpoint{Address: podDNS("pod", 0), AZ: "zone-c", Shard: 0} + ep1c := Endpoint{Address: podDNS("pod", 1), AZ: "zone-c", Shard: 1} + duplicateEp0a := Endpoint{Address: podDNS("anotherpod", 0), AZ: "zone-a", Shard: 0} + + testCases := map[string]struct { + endpoints []Endpoint + replicationFactor uint64 + expectError bool + errorContains string + }{ + "valid 2 AZs, RF=2": { + endpoints: []Endpoint{ep1a, ep0b, ep0a, ep1b}, + replicationFactor: 2, + }, + "valid 3 AZs, RF=3": { + endpoints: []Endpoint{ep1a, ep0b, ep0a, ep1b, ep0c, ep1c}, + replicationFactor: 3, + }, + "error: empty input": { + endpoints: []Endpoint{}, + replicationFactor: 1, + expectError: true, + errorContains: "no endpoints provided", + }, + "error: RF=0": { + endpoints: []Endpoint{ep0a, ep0b}, + replicationFactor: 0, + expectError: true, + errorContains: "replication factor cannot be zero", + }, + "error: duplicate shard": { + endpoints: []Endpoint{ep0a, ep1a, ep0b, duplicateEp0a}, + replicationFactor: 2, + expectError: true, + errorContains: "duplicate endpoint", + }, + "error: missing shard 0": { + endpoints: []Endpoint{ep1a, ep1b}, + replicationFactor: 2, + expectError: true, + errorContains: "missing endpoint with shard 0", + }, + "error: AZ count != RF (too few AZs)": { + endpoints: []Endpoint{ep0a, ep1a}, + replicationFactor: 2, + expectError: true, + errorContains: "number of AZs (1) must equal replication factor (2)", + }, + "error: AZ count != RF (too many AZs)": { + endpoints: []Endpoint{ep0a, ep1a, ep0b, ep1b, ep0c, ep1c}, + replicationFactor: 2, + expectError: true, + errorContains: "number of AZs (3) must equal replication factor (2)", + }, + "unbalanced AZs uses common subset": { + endpoints: []Endpoint{ep0a, ep1a, ep0b}, + replicationFactor: 2, + }, + } + + for name, tc := range testCases { + t.Run(name, func(t *testing.T) { + ring, err := newRendezvousHashring(tc.endpoints, tc.replicationFactor) + if tc.expectError { + require.Error(t, err) + require.Nil(t, ring) + if tc.errorContains != "" { + require.Contains(t, err.Error(), tc.errorContains) + } + } else { + require.NoError(t, err) + require.NotNil(t, ring) + } + }) + } +} + +func TestRendezvousHashringGetN(t *testing.T) { + t.Parallel() + + ep0a := Endpoint{Address: podDNS("pod", 0), AZ: "zone-a", Shard: 0} + ep1a := Endpoint{Address: podDNS("pod", 1), AZ: "zone-a", Shard: 1} + ep0b := Endpoint{Address: podDNS("pod", 0), AZ: "zone-b", Shard: 0} + ep1b := Endpoint{Address: podDNS("pod", 1), AZ: "zone-b", Shard: 1} + ep0c := Endpoint{Address: podDNS("pod", 0), AZ: "zone-c", Shard: 0} + ep1c := Endpoint{Address: podDNS("pod", 1), AZ: "zone-c", Shard: 1} + + ts := &prompb.TimeSeries{ + Labels: labelpb.Labels{{Name: "test", Value: "replica-routing"}}, + } + + t.Run("2 AZs RF=2, replicas have same shard", func(t *testing.T) { + ring, err := newRendezvousHashring([]Endpoint{ep1a, ep0b, ep0a, ep1b}, 2) + require.NoError(t, err) + + r0, err := ring.GetN("tenant1", ts, 0) + require.NoError(t, err) + r1, err := ring.GetN("tenant1", ts, 1) + require.NoError(t, err) + + require.Equal(t, r0.Shard, r1.Shard, "replicas should have same shard") + require.NotEqual(t, r0.AZ, r1.AZ, "replicas should be in different AZs") + }) + + t.Run("3 AZs RF=3, replicas have same shard", func(t *testing.T) { + ring, err := newRendezvousHashring([]Endpoint{ep1a, ep0b, ep0a, ep1b, ep0c, ep1c}, 3) + require.NoError(t, err) + + r0, err := ring.GetN("tenant1", ts, 0) + require.NoError(t, err) + r1, err := ring.GetN("tenant1", ts, 1) + require.NoError(t, err) + r2, err := ring.GetN("tenant1", ts, 2) + require.NoError(t, err) + + require.Equal(t, r0.Shard, r1.Shard) + require.Equal(t, r1.Shard, r2.Shard) + + azs := map[string]struct{}{r0.AZ: {}, r1.AZ: {}, r2.AZ: {}} + require.Len(t, azs, 3, "replicas should span all 3 AZs") + }) + + t.Run("error: n >= replicationFactor", func(t *testing.T) { + ring, err := newRendezvousHashring([]Endpoint{ep1a, ep0b, ep0a, ep1b}, 2) + require.NoError(t, err) + + _, err = ring.GetN("tenant1", ts, 2) + require.Error(t, err) + require.Contains(t, err.Error(), "insufficient nodes") + }) +} + +func TestRendezvousHashringSameShardAcrossAZs(t *testing.T) { + t.Parallel() + + // Create 3 AZs with 20 shards each. + var endpoints []Endpoint + for i := 0; i < 20; i++ { + endpoints = append(endpoints, Endpoint{Address: podDNS("pod", i), AZ: "zone-a", Shard: i}) + } + for i := 0; i < 20; i++ { + endpoints = append(endpoints, Endpoint{Address: podDNS("pod", i), AZ: "zone-b", Shard: i}) + } + for i := 0; i < 20; i++ { + endpoints = append(endpoints, Endpoint{Address: podDNS("pod", i), AZ: "zone-c", Shard: i}) + } + + ring, err := newRendezvousHashring(endpoints, 3) + require.NoError(t, err) + + // For many series, verify all replicas go to the same shard. + for i := 0; i < 500; i++ { + ts := &prompb.TimeSeries{ + Labels: labelpb.Labels{ + {Name: "__name__", Value: "test_metric"}, + {Name: "series", Value: fmt.Sprintf("series-%d", i)}, + }, + } + + r0, err := ring.GetN("tenant1", ts, 0) + require.NoError(t, err) + r1, err := ring.GetN("tenant1", ts, 1) + require.NoError(t, err) + r2, err := ring.GetN("tenant1", ts, 2) + require.NoError(t, err) + + require.Equal(t, r0.Shard, r1.Shard, "series %d: shard mismatch between AZ0 and AZ1", i) + require.Equal(t, r1.Shard, r2.Shard, "series %d: shard mismatch between AZ1 and AZ2", i) + + azs := map[string]struct{}{r0.AZ: {}, r1.AZ: {}, r2.AZ: {}} + require.Len(t, azs, 3, "series %d: replicas should span all 3 AZs", i) + } +} + +func TestRendezvousHashringDistribution(t *testing.T) { + t.Parallel() + + numShards := 10 + var endpoints []Endpoint + for i := 0; i < numShards; i++ { + endpoints = append(endpoints, Endpoint{Address: podDNS("pod", i), AZ: "zone-a", Shard: i}) + endpoints = append(endpoints, Endpoint{Address: podDNS("pod", i), AZ: "zone-b", Shard: i}) + endpoints = append(endpoints, Endpoint{Address: podDNS("pod", i), AZ: "zone-c", Shard: i}) + } + + ring, err := newRendezvousHashring(endpoints, 3) + require.NoError(t, err) + + shardCounts := make(map[int]int) + numSeries := 10000 + for i := 0; i < numSeries; i++ { + ts := &prompb.TimeSeries{ + Labels: labelpb.Labels{ + {Name: "__name__", Value: "test_metric"}, + {Name: "instance", Value: fmt.Sprintf("instance-%d", i)}, + }, + } + + ep, err := ring.Get("tenant1", ts) + require.NoError(t, err) + shardCounts[ep.Shard]++ + } + + // Expect all shards to receive some series. + require.Len(t, shardCounts, numShards, "all shards should receive some series") + + // Check uniformity: each shard should get roughly numSeries/numShards. + expected := float64(numSeries) / float64(numShards) + for shard, count := range shardCounts { + deviation := math.Abs(float64(count)-expected) / expected + require.Less(t, deviation, 0.30, + "shard %d has %d series (expected ~%.0f), deviation %.1f%%", + shard, count, expected, deviation*100) + } +} + +func TestRendezvousShuffleShardingBasic(t *testing.T) { + t.Parallel() + + // Create 3 AZs with 5 shards each. + endpoints := make([]Endpoint, 0, 15) + azs := []string{"az-a", "az-b", "az-c"} + for _, az := range azs { + for ord := 0; ord < 5; ord++ { + endpoints = append(endpoints, makeK8sEndpoint("pod-"+az, ord, az)) + } + } + + baseRing, err := newRendezvousHashring(endpoints, 3) + require.NoError(t, err) + + cfg := ShuffleShardingConfig{ + ShardSize: 6, + } + shardRing, err := newShuffleShardHashring(baseRing, cfg, 3, prometheus.NewRegistry(), "test-rendezvous") + require.NoError(t, err) + + tenant := "test-tenant" + shard, err := shardRing.getTenantShardRendezvous(tenant) + require.NoError(t, err) + + // Verify we got the right number of nodes (6 total / 3 AZs = 2 shards per AZ → 6 endpoints). + nodes := shard.Nodes() + require.Len(t, nodes, 6, "expected 6 endpoints (2 shards * 3 AZs)") + + // Extract shards from each AZ and verify they're the same. + shardsByAZ := make(map[string][]int) + for _, node := range nodes { + shardsByAZ[node.AZ] = append(shardsByAZ[node.AZ], extractShardFromAddress(t, node.Address)) + } + + require.Len(t, shardsByAZ, 3, "expected 3 AZs") + for az, shards := range shardsByAZ { + require.Len(t, shards, 2, "AZ %s should have 2 shards", az) + } + + // All AZs should have the same shards. + var referenceShards []int + for _, shards := range shardsByAZ { + if referenceShards == nil { + referenceShards = shards + } else { + require.ElementsMatch(t, referenceShards, shards, + "all AZs should have the same shards") + } + } +} + +func TestRendezvousShuffleShardingConsistency(t *testing.T) { + t.Parallel() + + endpoints := make([]Endpoint, 0, 15) + azs := []string{"az-a", "az-b", "az-c"} + for _, az := range azs { + for ord := 0; ord < 5; ord++ { + endpoints = append(endpoints, makeK8sEndpoint("pod-"+az, ord, az)) + } + } + + baseRing, err := newRendezvousHashring(endpoints, 3) + require.NoError(t, err) + + cfg := ShuffleShardingConfig{ + ShardSize: 6, + } + shardRing, err := newShuffleShardHashring(baseRing, cfg, 3, prometheus.NewRegistry(), "test-consistency") + require.NoError(t, err) + + tenant := "consistent-tenant" + var firstShards []int + + for trial := 0; trial < 10; trial++ { + shard, err := shardRing.getTenantShardRendezvous(tenant) + require.NoError(t, err) + currentShards := extractShardsFromSubring(t, shard) + if firstShards == nil { + firstShards = currentShards + } else { + require.Equal(t, firstShards, currentShards, + "same tenant should always get same shards") + } + } +} + +func TestRendezvousShuffleShardingDifferentTenants(t *testing.T) { + t.Parallel() + + endpoints := make([]Endpoint, 0, 30) + azs := []string{"az-a", "az-b", "az-c"} + for _, az := range azs { + for ord := 0; ord < 10; ord++ { + endpoints = append(endpoints, makeK8sEndpoint("pod-"+az, ord, az)) + } + } + + baseRing, err := newRendezvousHashring(endpoints, 3) + require.NoError(t, err) + + cfg := ShuffleShardingConfig{ + ShardSize: 9, + } + shardRing, err := newShuffleShardHashring(baseRing, cfg, 3, prometheus.NewRegistry(), "test-diff-tenants") + require.NoError(t, err) + + tenantShards := make(map[string][]int) + numTenants := 20 + + for i := 0; i < numTenants; i++ { + tenant := fmt.Sprintf("tenant-%d", i) + shard, err := shardRing.getTenantShardRendezvous(tenant) + require.NoError(t, err) + tenantShards[tenant] = extractShardsFromSubring(t, shard) + } + + uniqueSets := make(map[string]int) + for _, shards := range tenantShards { + key := fmt.Sprintf("%v", shards) + uniqueSets[key]++ + } + + require.Greater(t, len(uniqueSets), 1, "different tenants should get different shard sets") +} + +func TestRendezvousShuffleShardingPreservesAlignment(t *testing.T) { + t.Parallel() + + endpoints := make([]Endpoint, 0, 15) + azs := []string{"az-a", "az-b", "az-c"} + for _, az := range azs { + for ord := 0; ord < 5; ord++ { + endpoints = append(endpoints, makeK8sEndpoint("pod-"+az, ord, az)) + } + } + + baseRing, err := newRendezvousHashring(endpoints, 3) + require.NoError(t, err) + + cfg := ShuffleShardingConfig{ + ShardSize: 6, + } + shardRing, err := newShuffleShardHashring(baseRing, cfg, 3, prometheus.NewRegistry(), "test-preserves") + require.NoError(t, err) + + tenant := "alignment-test-tenant" + + for i := 0; i < 100; i++ { + ts := &prompb.TimeSeries{ + Labels: labelpb.Labels{ + {Name: "series", Value: fmt.Sprintf("series-%d", i)}, + }, + } + + var replicas []Endpoint + for n := uint64(0); n < 3; n++ { + ep, err := shardRing.GetN(tenant, ts, n) + require.NoError(t, err) + replicas = append(replicas, ep) + } + + // All replicas should have the same shard but different AZs. + shardsSeen := make(map[int]struct{}) + azsSeen := make(map[string]struct{}) + for _, ep := range replicas { + shardsSeen[extractShardFromAddress(t, ep.Address)] = struct{}{} + azsSeen[ep.AZ] = struct{}{} + } + + require.Len(t, shardsSeen, 1, "all replicas should have the same shard for series %d", i) + require.Len(t, azsSeen, 3, "replicas should span all 3 AZs for series %d", i) + } +} + +func TestRendezvousShuffleShardingDataDistribution(t *testing.T) { + t.Parallel() + + endpoints := make([]Endpoint, 0, 15) + azs := []string{"az-a", "az-b", "az-c"} + for _, az := range azs { + for ord := 0; ord < 5; ord++ { + endpoints = append(endpoints, makeK8sEndpoint("pod-"+az, ord, az)) + } + } + + baseRing, err := newRendezvousHashring(endpoints, 3) + require.NoError(t, err) + + cfg := ShuffleShardingConfig{ + ShardSize: 6, + } + shardRing, err := newShuffleShardHashring(baseRing, cfg, 3, prometheus.NewRegistry(), "test-distribution") + require.NoError(t, err) + + tenant := "distribution-test-tenant" + + shard, err := shardRing.getTenantShardRendezvous(tenant) + require.NoError(t, err) + selectedShards := extractShardsFromSubring(t, shard) + require.Len(t, selectedShards, 2, "tenant should have exactly 2 shards") + + seriesByShard := make(map[int]map[int]struct{}) + for _, ord := range selectedShards { + seriesByShard[ord] = make(map[int]struct{}) + } + + seriesByEndpoint := make(map[string]map[int]struct{}) + + numSeries := 1000 + for i := 0; i < numSeries; i++ { + ts := &prompb.TimeSeries{ + Labels: labelpb.Labels{ + {Name: "series", Value: fmt.Sprintf("series-%d", i)}, + {Name: "__name__", Value: "test_metric"}, + }, + } + + var replicas []Endpoint + for n := uint64(0); n < 3; n++ { + ep, err := shardRing.GetN(tenant, ts, n) + require.NoError(t, err) + replicas = append(replicas, ep) + + if seriesByEndpoint[ep.Address] == nil { + seriesByEndpoint[ep.Address] = make(map[int]struct{}) + } + seriesByEndpoint[ep.Address][i] = struct{}{} + } + + // All replicas should have the same shard. + primaryShard := extractShardFromAddress(t, replicas[0].Address) + for _, ep := range replicas[1:] { + epShard := extractShardFromAddress(t, ep.Address) + require.Equal(t, primaryShard, epShard, "all replicas for series %d should have same shard", i) + } + + seriesByShard[primaryShard][i] = struct{}{} + } + + // Both shards should receive series. + for ord, series := range seriesByShard { + require.Greater(t, len(series), 0, "shard %d should receive some series", ord) + } + + // Same shard across different AZs should receive the same series. + endpointsByShard := make(map[int][]string) + for addr := range seriesByEndpoint { + ord := extractShardFromAddress(t, addr) + endpointsByShard[ord] = append(endpointsByShard[ord], addr) + } + + for ord, addrs := range endpointsByShard { + if len(addrs) < 2 { + continue + } + referenceSeries := seriesByEndpoint[addrs[0]] + for _, addr := range addrs[1:] { + otherSeries := seriesByEndpoint[addr] + require.Equal(t, len(referenceSeries), len(otherSeries), + "endpoints with shard %d should have same number of series", ord) + for seriesIdx := range referenceSeries { + _, ok := otherSeries[seriesIdx] + require.True(t, ok, "series %d should be on all endpoints with shard %d", seriesIdx, ord) + } + } + } + + // Different shards should receive different series. + shardList := make([]int, 0, len(seriesByShard)) + for ord := range seriesByShard { + shardList = append(shardList, ord) + } + if len(shardList) >= 2 { + series1 := seriesByShard[shardList[0]] + series2 := seriesByShard[shardList[1]] + for seriesIdx := range series1 { + _, overlap := series2[seriesIdx] + require.False(t, overlap, + "series %d should not be on both shard %d and shard %d", + seriesIdx, shardList[0], shardList[1]) + } + } +} + +func TestRendezvousShuffleShardingValidation(t *testing.T) { + t.Parallel() + + endpoints := make([]Endpoint, 0, 15) + azs := []string{"az-a", "az-b", "az-c"} + for _, az := range azs { + for ord := 0; ord < 5; ord++ { + endpoints = append(endpoints, makeK8sEndpoint("pod-"+az, ord, az)) + } + } + + baseRing, err := newRendezvousHashring(endpoints, 3) + require.NoError(t, err) + + cfg := ShuffleShardingConfig{ + ShardSize: 30, // 30 / 3 AZs = 10 per-AZ, but only 5 shards available + } + shardRing, err := newShuffleShardHashring(baseRing, cfg, 3, prometheus.NewRegistry(), "test-validation") + require.NoError(t, err) + + _, err = shardRing.getTenantShardRendezvous("test-tenant") + require.Error(t, err) + require.Contains(t, err.Error(), "exceeds available common shards") +} diff --git a/pkg/receive/tenant_attribution.go b/pkg/receive/tenant_attribution.go index d130ca6dcf9..29bbc28460c 100644 --- a/pkg/receive/tenant_attribution.go +++ b/pkg/receive/tenant_attribution.go @@ -15,7 +15,7 @@ import ( "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/prometheus/prometheus/model/labels" + "github.com/thanos-io/thanos/pkg/store/labelpb" "gopkg.in/yaml.v2" ) @@ -132,7 +132,7 @@ func NewTenantAttributorFromContent( // GetTenantFromLabels returns the tenant for the given labels based on rules. // First matching rule wins. Returns defaultTenant if no rule matches. -func (ta *TenantAttributor) GetTenantFromLabels(lbls labels.Labels) string { +func (ta *TenantAttributor) GetTenantFromLabels(lbls labelpb.Labels) string { for _, rule := range ta.rules { if rule.Filter.MatchLabels(lbls) { return rule.Tenant @@ -308,7 +308,7 @@ type Filter interface { // TagsFilter matches labels against certain conditions. type TagsFilter interface { fmt.Stringer - MatchLabels(lbls labels.Labels) bool + MatchLabels(lbls labelpb.Labels) bool } // TagsFilterOptions provide a set of tag filter options. @@ -389,11 +389,11 @@ func (f *tagsFilter) String() string { } // MatchLabels checks if the labels match the filter. -func (f *tagsFilter) MatchLabels(lbls labels.Labels) bool { +func (f *tagsFilter) MatchLabels(lbls labelpb.Labels) bool { return f.matchLabelsSimple(lbls) } -func (f *tagsFilter) matchLabelsSimple(lbls labels.Labels) bool { +func (f *tagsFilter) matchLabelsSimple(lbls labelpb.Labels) bool { if len(f.tagFilters) == 0 { return true } diff --git a/pkg/receive/tenant_attribution_test.go b/pkg/receive/tenant_attribution_test.go index 3d24394eaa9..b55dae0b173 100644 --- a/pkg/receive/tenant_attribution_test.go +++ b/pkg/receive/tenant_attribution_test.go @@ -9,6 +9,8 @@ import ( "github.com/prometheus/prometheus/model/labels" "github.com/stretchr/testify/require" + + "github.com/thanos-io/thanos/pkg/store/labelpb" ) func TestNewFilterFromFilterValueInvalidPattern(t *testing.T) { @@ -524,7 +526,7 @@ func TestTagsFilterMatchLabels(t *testing.T) { require.NoError(t, err) lbls := labels.FromMap(tc.labels) - require.Equal(t, tc.expectedMatch, filter.MatchLabels(lbls), + require.Equal(t, tc.expectedMatch, filter.MatchLabels(labelpb.FromPromLabels(lbls)), fmt.Sprintf("filter: %s, labels: %v", tc.filterStr, tc.labels)) }) } diff --git a/pkg/receive/writecapnp/marshal.go b/pkg/receive/writecapnp/marshal.go index efc1a8ef038..4e7895545ad 100644 --- a/pkg/receive/writecapnp/marshal.go +++ b/pkg/receive/writecapnp/marshal.go @@ -12,7 +12,7 @@ import ( "github.com/thanos-io/thanos/pkg/store/storepb/prompb" ) -func Marshal(tenant string, tsreq []prompb.TimeSeries) ([]byte, error) { +func Marshal(tenant string, tsreq []*prompb.TimeSeries) ([]byte, error) { wr, err := Build(tenant, tsreq) if err != nil { return nil, err @@ -21,7 +21,7 @@ func Marshal(tenant string, tsreq []prompb.TimeSeries) ([]byte, error) { return wr.Message().Marshal() } -func MarshalPacked(tenant string, tsreq []prompb.TimeSeries) ([]byte, error) { +func MarshalPacked(tenant string, tsreq []*prompb.TimeSeries) ([]byte, error) { wr, err := Build(tenant, tsreq) if err != nil { return nil, err @@ -30,7 +30,7 @@ func MarshalPacked(tenant string, tsreq []prompb.TimeSeries) ([]byte, error) { return wr.Message().MarshalPacked() } -func Build(tenant string, tsreq []prompb.TimeSeries) (WriteRequest, error) { +func Build(tenant string, tsreq []*prompb.TimeSeries) (WriteRequest, error) { arena := capnp.SingleSegment(nil) _, seg, err := capnp.NewMessage(arena) if err != nil { @@ -46,7 +46,7 @@ func Build(tenant string, tsreq []prompb.TimeSeries) (WriteRequest, error) { return wr, nil } -func BuildInto(wr WriteRequest, tenant string, tsreq []prompb.TimeSeries) error { +func BuildInto(wr WriteRequest, tenant string, tsreq []*prompb.TimeSeries) error { if err := wr.SetTenant(tenant); err != nil { return errors.Wrap(err, "set tenant") } @@ -102,7 +102,7 @@ func marshalSymbols(builder *symbolsBuilder, symbols Symbols) error { return symbols.SetData(data) } -func marshalLabels(lbls Label_List, pbLbls []labelpb.ZLabel, symbols *symbolsBuilder) error { +func marshalLabels(lbls Label_List, pbLbls labelpb.Labels, symbols *symbolsBuilder) error { for i, pbLbl := range pbLbls { lbl := lbls.At(i) lbl.SetName(symbols.addEntry(pbLbl.Name)) @@ -111,7 +111,7 @@ func marshalLabels(lbls Label_List, pbLbls []labelpb.ZLabel, symbols *symbolsBui return nil } -func marshalSamples(ts TimeSeries, pbSamples []prompb.Sample) error { +func marshalSamples(ts TimeSeries, pbSamples []*prompb.Sample) error { samples, err := ts.NewSamples(int32(len(pbSamples))) if err != nil { return err @@ -125,7 +125,7 @@ func marshalSamples(ts TimeSeries, pbSamples []prompb.Sample) error { return nil } -func marshalHistograms(ts TimeSeries, pbHistograms []prompb.Histogram) error { +func marshalHistograms(ts TimeSeries, pbHistograms []*prompb.Histogram) error { if len(pbHistograms) == 0 { return nil } @@ -141,7 +141,7 @@ func marshalHistograms(ts TimeSeries, pbHistograms []prompb.Histogram) error { return nil } -func marshalHistogram(histogram Histogram, h prompb.Histogram) error { +func marshalHistogram(histogram Histogram, h *prompb.Histogram) error { histogram.SetResetHint(Histogram_ResetHint(h.ResetHint)) switch h.Count.(type) { case *prompb.Histogram_CountInt: @@ -205,7 +205,7 @@ func marshalHistogram(histogram Histogram, h prompb.Histogram) error { return nil } -func marshalSpans(spans BucketSpan_List, pbSpans []prompb.BucketSpan) error { +func marshalSpans(spans BucketSpan_List, pbSpans []*prompb.BucketSpan) error { for j, s := range pbSpans { span := spans.At(j) span.SetOffset(s.Offset) @@ -214,7 +214,7 @@ func marshalSpans(spans BucketSpan_List, pbSpans []prompb.BucketSpan) error { return nil } -func marshalExemplars(ts TimeSeries, pbExemplars []prompb.Exemplar, symbols *symbolsBuilder) error { +func marshalExemplars(ts TimeSeries, pbExemplars []*prompb.Exemplar, symbols *symbolsBuilder) error { if len(pbExemplars) == 0 { return nil } diff --git a/pkg/receive/writecapnp/marshal_bench_test.go b/pkg/receive/writecapnp/marshal_bench_test.go index 2b29426daf0..045f2bd3554 100644 --- a/pkg/receive/writecapnp/marshal_bench_test.go +++ b/pkg/receive/writecapnp/marshal_bench_test.go @@ -22,20 +22,20 @@ func BenchmarkMarshalWriteRequest(b *testing.B) { numClusters = 3 numPods = 2 ) - series := make([]prompb.TimeSeries, 0, numSeries) + series := make([]*prompb.TimeSeries, 0, numSeries) for i := 0; i < numSeries; i++ { - lbls := make([]labelpb.ZLabel, 0, numClusters*numPods) + lbls := make(labelpb.Labels, 0, numClusters*numPods) for j := 0; j < numClusters; j++ { for k := 0; k < numPods; k++ { - lbls = append(lbls, labelpb.ZLabel{ + lbls = append(lbls, &labelpb.Label{ Name: fmt.Sprintf("cluster-%d", j), Value: fmt.Sprintf("pod-%d", k), }) } } - series = append(series, prompb.TimeSeries{ + series = append(series, &prompb.TimeSeries{ Labels: lbls, - Samples: []prompb.Sample{ + Samples: []*prompb.Sample{ { Value: 1, Timestamp: 2, @@ -48,7 +48,7 @@ func BenchmarkMarshalWriteRequest(b *testing.B) { Timeseries: series, } var ( - protoBytes, err = wreq.Marshal() + protoBytes, err = wreq.MarshalVT() capnprotoBytes, paddedErr = Marshal(wreq.Tenant, wreq.Timeseries) capnprotoBytesPacked, packedErr = MarshalPacked(wreq.Tenant, wreq.Timeseries) ) @@ -58,7 +58,7 @@ func BenchmarkMarshalWriteRequest(b *testing.B) { b.Run("marshal_proto", func(b *testing.B) { for i := 0; i < b.N; i++ { var err error - _, err = wreq.Marshal() + _, err = wreq.MarshalVT() require.NoError(b, err) } }) @@ -92,7 +92,7 @@ func BenchmarkMarshalWriteRequest(b *testing.B) { b.Run("unmarshal_proto", func(b *testing.B) { for i := 0; i < b.N; i++ { wr := storepb.WriteRequest{} - require.NoError(b, wr.Unmarshal(protoBytes)) + require.NoError(b, wr.UnmarshalVT(protoBytes)) } }) b.Run("unmarshal", func(b *testing.B) { diff --git a/pkg/receive/writecapnp/marshal_test.go b/pkg/receive/writecapnp/marshal_test.go index bffc7a6d6a2..537ed2ea923 100644 --- a/pkg/receive/writecapnp/marshal_test.go +++ b/pkg/receive/writecapnp/marshal_test.go @@ -40,34 +40,28 @@ func TestMarshalWriteRequest(t *testing.T) { wreq := storepb.WriteRequest{ Tenant: "example-tenant", - Timeseries: []prompb.TimeSeries{ + Timeseries: []*prompb.TimeSeries{ { - Labels: []labelpb.ZLabel{ - {Name: "__name__", Value: "up"}, - {Name: "job", Value: "prometheus"}, - }, - Samples: []prompb.Sample{ + Labels: labelpb.FromStrings("__name__", "up", "job", "prometheus"), + Samples: []*prompb.Sample{ {Timestamp: 1, Value: 1}, {Timestamp: 2, Value: 2}, }, - Histograms: []prompb.Histogram{ + Histograms: []*prompb.Histogram{ prompb.HistogramToHistogramProto(1, testHistogram), prompb.FloatHistogramToHistogramProto(2, tsdbutil.GenerateTestFloatHistogram(2)), }, - Exemplars: []prompb.Exemplar{ + Exemplars: []*prompb.Exemplar{ { - Labels: []labelpb.ZLabel{{Name: "traceID", Value: "1234"}}, + Labels: labelpb.FromStrings("traceID", "1234"), Value: 10, Timestamp: 14, }, }, }, { - Labels: []labelpb.ZLabel{ - {Name: "__name__", Value: "up"}, - {Name: "job", Value: "thanos"}, - }, - Samples: []prompb.Sample{ + Labels: labelpb.FromStrings("__name__", "up", "job", "thanos"), + Samples: []*prompb.Sample{ {Timestamp: 3, Value: 3}, {Timestamp: 4, Value: 4}, }, @@ -133,7 +127,7 @@ func TestMarshalWriteRequest(t *testing.T) { }) t.Run("test_exemplars", func(t *testing.T) { for i, ex := range expected.Exemplars { - require.Equal(t, labelpb.ZLabelsToPromLabels(ex.Labels), actual.Exemplars[i].Labels) + require.Equal(t, labelpb.ToPromLabels(ex.Labels), actual.Exemplars[i].Labels) require.Equal(t, ex.Timestamp, actual.Exemplars[i].Ts) require.Equal(t, ex.Value, actual.Exemplars[i].Value) } @@ -146,22 +140,18 @@ func TestMarshalWriteRequest(t *testing.T) { func TestMarshalWithMultipleHistogramSeries(t *testing.T) { wreq := storepb.WriteRequest{ Tenant: "example-tenant", - Timeseries: []prompb.TimeSeries{ + Timeseries: []*prompb.TimeSeries{ { - Labels: []labelpb.ZLabel{ - {Name: "job", Value: "prometheus-1"}, - }, - Histograms: []prompb.Histogram{ + Labels: labelpb.FromStrings("job", "prometheus-1"), + Histograms: []*prompb.Histogram{ prompb.HistogramToHistogramProto(1, &histogram.Histogram{}), prompb.HistogramToHistogramProto(1, tsdbutil.GenerateTestHistogram(1)), prompb.FloatHistogramToHistogramProto(2, tsdbutil.GenerateTestFloatHistogram(2)), }, }, { - Labels: []labelpb.ZLabel{ - {Name: "job", Value: "prometheus-2"}, - }, - Histograms: []prompb.Histogram{ + Labels: labelpb.FromStrings("job", "prometheus-2"), + Histograms: []*prompb.Histogram{ prompb.HistogramToHistogramProto(1, tsdbutil.GenerateTestHistogram(1)), prompb.FloatHistogramToHistogramProto(2, tsdbutil.GenerateTestFloatHistogram(2)), prompb.HistogramToHistogramProto(1, &histogram.Histogram{}), diff --git a/pkg/receive/writer.go b/pkg/receive/writer.go index d17fd6453cc..61cc3557c37 100644 --- a/pkg/receive/writer.go +++ b/pkg/receive/writer.go @@ -10,6 +10,8 @@ import ( "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/pkg/errors" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/exemplar" "github.com/prometheus/prometheus/model/histogram" @@ -56,23 +58,32 @@ type WriterOptions struct { } type Writer struct { - logger log.Logger - multiTSDB TenantStorage - opts *WriterOptions + logger log.Logger + multiTSDB TenantStorage + opts *WriterOptions + commitDuration prometheus.Histogram } -func NewWriter(logger log.Logger, multiTSDB TenantStorage, opts *WriterOptions) *Writer { - if opts == nil { +func NewWriter(logger log.Logger, multiTSDB TenantStorage, opts *WriterOptions, reg prometheus.Registerer) *Writer { + if opts == + nil { opts = &WriterOptions{} } return &Writer{ logger: logger, multiTSDB: multiTSDB, opts: opts, + commitDuration: promauto.With(reg).NewHistogram(prometheus.HistogramOpts{ + Namespace: "thanos", + Subsystem: "receive", + Name: "writer_commit_duration_seconds", + Help: "Duration of TSDB commit calls in seconds.", + Buckets: prometheus.ExponentialBuckets(0.001, 2, 16), + }), } } -func (r *Writer) Write(ctx context.Context, tenantID string, wreq []prompb.TimeSeries) error { +func (r *Writer) Write(ctx context.Context, tenantID string, wreq []*prompb.TimeSeries) error { tLogger := log.With(r.logger, "tenant", tenantID) s, err := r.multiTSDB.TenantAppendable(tenantID) @@ -102,31 +113,28 @@ func (r *Writer) Write(ctx context.Context, tenantID string, wreq []prompb.TimeS // Check if time series labels are valid. If not, skip the time series // and report the error. if err := labelpb.ValidateLabels(t.Labels); err != nil { - lset := &labelpb.ZLabelSet{Labels: t.Labels} + lset := &labelpb.LabelSet{Labels: t.Labels} errorTracker.addLabelsError(err, lset, tLogger) continue } - lset := labelpb.ZLabelsToPromLabels(t.Labels) + lset := labelpb.ToPromLabels(t.Labels) // Check if the TSDB has cached reference for those labels. - ref, lset = getRef.GetRef(lset, lset.Hash()) - if ref == 0 { - // If not, copy labels, as TSDB will hold those strings long term. Given no - // copy unmarshal we don't want to keep memory for whole protobuf, only for labels. - labelpb.ReAllocZLabelsStrings(&t.Labels, r.opts.Intern) - lset = labelpb.ZLabelsToPromLabels(t.Labels) + // When ref is 0 (series unknown), GetRef returns empty labels, + // so we must keep the original lset for the Append call. + cachedRef, cachedLset := getRef.GetRef(lset, lset.Hash()) + ref = cachedRef + if ref != 0 { + lset = cachedLset } // Append as many valid samples as possible, but keep track of the errors. for _, s := range t.Samples { ref, err = app.Append(ref, lset, s.Timestamp, s.Value) - errorTracker.addSampleError(err, tLogger, lset, s.Timestamp, s.Value) + errorTracker.addSampleError(err, tLogger, labelpb.Labels(t.Labels), s.Timestamp, s.Value) } - b := labels.ScratchBuilder{} - b.Labels() - for _, hp := range t.Histograms { var ( h *histogram.Histogram @@ -140,14 +148,14 @@ func (r *Writer) Write(ctx context.Context, tenantID string, wreq []prompb.TimeS } ref, err = app.AppendHistogram(ref, lset, hp.Timestamp, h, fh) - errorTracker.addHistogramError(err, tLogger, lset, hp.Timestamp) + errorTracker.addHistogramError(err, tLogger, labelpb.Labels(t.Labels), hp.Timestamp) } // Current implementation of app.AppendExemplar doesn't create a new series, so it must be already present. // We drop the exemplars in case the series doesn't exist. if ref != 0 && len(t.Exemplars) > 0 { for _, ex := range t.Exemplars { - exLset := labelpb.ZLabelsToPromLabels(ex.Labels) + exLset := labelpb.ToPromLabels(ex.Labels) exLogger := log.With(tLogger, "exemplarLset", exLset, "exemplar", ex.String()) if _, err = app.AppendExemplar(ref, lset, exemplar.Exemplar{ @@ -163,8 +171,10 @@ func (r *Writer) Write(ctx context.Context, tenantID string, wreq []prompb.TimeS } errs := errorTracker.collectErrors(tLogger) + commitStart := time.Now() if err := app.Commit(); err != nil { errs.Add(errors.Wrap(err, "commit samples")) } + r.commitDuration.Observe(time.Since(commitStart).Seconds()) return errs.ErrOrNil() } diff --git a/pkg/receive/writer_errors.go b/pkg/receive/writer_errors.go index 75592be1756..8b609256604 100644 --- a/pkg/receive/writer_errors.go +++ b/pkg/receive/writer_errors.go @@ -4,11 +4,12 @@ package receive import ( + "fmt" + "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/pkg/errors" "github.com/prometheus/prometheus/model/exemplar" - "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/thanos-io/thanos/pkg/store/labelpb" ) @@ -28,7 +29,7 @@ type writeErrorTracker struct { numExemplarsLabelLength int } -func (a *writeErrorTracker) addLabelsError(err error, lset *labelpb.ZLabelSet, logger log.Logger) { +func (a *writeErrorTracker) addLabelsError(err error, lset *labelpb.LabelSet, logger log.Logger) { if err == nil { return } @@ -48,7 +49,7 @@ func (a *writeErrorTracker) addLabelsError(err error, lset *labelpb.ZLabelSet, l } } -func (a *writeErrorTracker) addSampleError(err error, tLogger log.Logger, lset labels.Labels, t int64, v float64) { +func (a *writeErrorTracker) addSampleError(err error, tLogger log.Logger, lset fmt.Stringer, t int64, v float64) { if err == nil { return } @@ -72,7 +73,7 @@ func (a *writeErrorTracker) addSampleError(err error, tLogger log.Logger, lset l } } -func (a *writeErrorTracker) addHistogramError(err error, tLogger log.Logger, lset labels.Labels, timestamp int64) { +func (a *writeErrorTracker) addHistogramError(err error, tLogger log.Logger, lset fmt.Stringer, timestamp int64) { if err == nil { return } diff --git a/pkg/receive/writer_test.go b/pkg/receive/writer_test.go index 434512c694d..1f8e0ceaf53 100644 --- a/pkg/receive/writer_test.go +++ b/pkg/receive/writer_test.go @@ -16,7 +16,6 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/exemplar" - "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb" "github.com/prometheus/prometheus/tsdb/tsdbutil" @@ -33,24 +32,24 @@ func TestWriter(t *testing.T) { t.Parallel() now := model.Now() - lbls := []labelpb.ZLabel{{Name: "__name__", Value: "test"}} + lbls := labelpb.FromStrings("__name__", "test") tests := map[string]struct { reqs []*prompb.WriteRequest expectedErr error - expectedIngested []prompb.TimeSeries + expectedIngested []*prompb.TimeSeries maxExemplars int64 opts *WriterOptions }{ "should error out on series with no labels": { reqs: []*prompb.WriteRequest{ { - Timeseries: []prompb.TimeSeries{ + Timeseries: []*prompb.TimeSeries{ { - Samples: []prompb.Sample{{Value: 1, Timestamp: 10}}, + Samples: []*prompb.Sample{{Value: 1, Timestamp: 10}}, }, { - Labels: []labelpb.ZLabel{{Name: "__name__", Value: ""}}, - Samples: []prompb.Sample{{Value: 1, Timestamp: 10}}, + Labels: labelpb.FromStrings("__name__", ""), + Samples: []*prompb.Sample{{Value: 1, Timestamp: 10}}, }, }, }, @@ -60,29 +59,29 @@ func TestWriter(t *testing.T) { "should succeed on series with valid labels": { reqs: []*prompb.WriteRequest{ { - Timeseries: []prompb.TimeSeries{ + Timeseries: []*prompb.TimeSeries{ { - Labels: append(lbls, labelpb.ZLabel{Name: "a", Value: "1"}, labelpb.ZLabel{Name: "b", Value: "2"}), - Samples: []prompb.Sample{{Value: 1, Timestamp: 10}}, + Labels: append(lbls, &labelpb.Label{Name: "a", Value: "1"}, &labelpb.Label{Name: "b", Value: "2"}), + Samples: []*prompb.Sample{{Value: 1, Timestamp: 10}}, }, }, }, }, expectedErr: nil, - expectedIngested: []prompb.TimeSeries{ + expectedIngested: []*prompb.TimeSeries{ { - Labels: append(lbls, labelpb.ZLabel{Name: "a", Value: "1"}, labelpb.ZLabel{Name: "b", Value: "2"}), - Samples: []prompb.Sample{{Value: 1, Timestamp: 10}}, + Labels: append(lbls, &labelpb.Label{Name: "a", Value: "1"}, &labelpb.Label{Name: "b", Value: "2"}), + Samples: []*prompb.Sample{{Value: 1, Timestamp: 10}}, }, }, }, "should error out and skip series with out-of-order labels": { reqs: []*prompb.WriteRequest{ { - Timeseries: []prompb.TimeSeries{ + Timeseries: []*prompb.TimeSeries{ { - Labels: append(lbls, labelpb.ZLabel{Name: "a", Value: "1"}, labelpb.ZLabel{Name: "b", Value: "1"}, labelpb.ZLabel{Name: "Z", Value: "1"}, labelpb.ZLabel{Name: "b", Value: "2"}), - Samples: []prompb.Sample{{Value: 1, Timestamp: 10}}, + Labels: append(lbls, &labelpb.Label{Name: "a", Value: "1"}, &labelpb.Label{Name: "b", Value: "1"}, &labelpb.Label{Name: "Z", Value: "1"}, &labelpb.Label{Name: "b", Value: "2"}), + Samples: []*prompb.Sample{{Value: 1, Timestamp: 10}}, }, }, }, @@ -92,10 +91,10 @@ func TestWriter(t *testing.T) { "should error out and skip series with duplicate labels": { reqs: []*prompb.WriteRequest{ { - Timeseries: []prompb.TimeSeries{ + Timeseries: []*prompb.TimeSeries{ { - Labels: append(lbls, labelpb.ZLabel{Name: "a", Value: "1"}, labelpb.ZLabel{Name: "b", Value: "1"}, labelpb.ZLabel{Name: "b", Value: "2"}, labelpb.ZLabel{Name: "z", Value: "1"}), - Samples: []prompb.Sample{{Value: 1, Timestamp: 10}}, + Labels: append(lbls, &labelpb.Label{Name: "a", Value: "1"}, &labelpb.Label{Name: "b", Value: "1"}, &labelpb.Label{Name: "b", Value: "2"}, &labelpb.Label{Name: "z", Value: "1"}), + Samples: []*prompb.Sample{{Value: 1, Timestamp: 10}}, }, }, }, @@ -105,46 +104,46 @@ func TestWriter(t *testing.T) { "should error out and skip series with out-of-order labels; accept series with valid labels": { reqs: []*prompb.WriteRequest{ { - Timeseries: []prompb.TimeSeries{ + Timeseries: []*prompb.TimeSeries{ { - Labels: append(lbls, labelpb.ZLabel{Name: "A", Value: "1"}, labelpb.ZLabel{Name: "b", Value: "2"}), - Samples: []prompb.Sample{{Value: 1, Timestamp: 10}}, + Labels: append(lbls, &labelpb.Label{Name: "A", Value: "1"}, &labelpb.Label{Name: "b", Value: "2"}), + Samples: []*prompb.Sample{{Value: 1, Timestamp: 10}}, }, { - Labels: append(lbls, labelpb.ZLabel{Name: "c", Value: "1"}, labelpb.ZLabel{Name: "d", Value: "2"}), - Samples: []prompb.Sample{{Value: 1, Timestamp: 10}}, + Labels: append(lbls, &labelpb.Label{Name: "c", Value: "1"}, &labelpb.Label{Name: "d", Value: "2"}), + Samples: []*prompb.Sample{{Value: 1, Timestamp: 10}}, }, { - Labels: append(lbls, labelpb.ZLabel{Name: "E", Value: "1"}, labelpb.ZLabel{Name: "f", Value: "2"}), - Samples: []prompb.Sample{{Value: 1, Timestamp: 10}}, + Labels: append(lbls, &labelpb.Label{Name: "E", Value: "1"}, &labelpb.Label{Name: "f", Value: "2"}), + Samples: []*prompb.Sample{{Value: 1, Timestamp: 10}}, }, }, }, }, expectedErr: errors.Wrapf(labelpb.ErrOutOfOrderLabels, "add 2 series"), - expectedIngested: []prompb.TimeSeries{ + expectedIngested: []*prompb.TimeSeries{ { - Labels: append(lbls, labelpb.ZLabel{Name: "c", Value: "1"}, labelpb.ZLabel{Name: "d", Value: "2"}), - Samples: []prompb.Sample{{Value: 1, Timestamp: 10}}, + Labels: append(lbls, &labelpb.Label{Name: "c", Value: "1"}, &labelpb.Label{Name: "d", Value: "2"}), + Samples: []*prompb.Sample{{Value: 1, Timestamp: 10}}, }, }, }, "should succeed when sample timestamp is NOT too far in the future": { reqs: []*prompb.WriteRequest{ { - Timeseries: []prompb.TimeSeries{ + Timeseries: []*prompb.TimeSeries{ { Labels: lbls, - Samples: []prompb.Sample{{Value: 1, Timestamp: int64(now)}}, + Samples: []*prompb.Sample{{Value: 1, Timestamp: int64(now)}}, }, }, }, }, expectedErr: nil, - expectedIngested: []prompb.TimeSeries{ + expectedIngested: []*prompb.TimeSeries{ { Labels: lbls, - Samples: []prompb.Sample{{Value: 1, Timestamp: int64(now)}}, + Samples: []*prompb.Sample{{Value: 1, Timestamp: int64(now)}}, }, }, opts: &WriterOptions{TooFarInFutureTimeWindow: 30 * int64(time.Second)}, @@ -152,11 +151,11 @@ func TestWriter(t *testing.T) { "should error out when sample timestamp is too far in the future": { reqs: []*prompb.WriteRequest{ { - Timeseries: []prompb.TimeSeries{ + Timeseries: []*prompb.TimeSeries{ { Labels: lbls, // A sample with a very large timestamp in year 5138 (milliseconds) - Samples: []prompb.Sample{{Value: 1, Timestamp: 99999999999999}}, + Samples: []*prompb.Sample{{Value: 1, Timestamp: 99999999999999}}, }, }, }, @@ -166,19 +165,19 @@ func TestWriter(t *testing.T) { }, "should succeed on valid series with exemplars": { reqs: []*prompb.WriteRequest{{ - Timeseries: []prompb.TimeSeries{ + Timeseries: []*prompb.TimeSeries{ { Labels: lbls, // Ingesting an exemplar requires a sample to create the series first. - Samples: []prompb.Sample{{Value: 1, Timestamp: 10}}, - Exemplars: []prompb.Exemplar{ + Samples: []*prompb.Sample{{Value: 1, Timestamp: 10}}, + Exemplars: []*prompb.Exemplar{ { - Labels: []labelpb.ZLabel{{Name: "traceID", Value: "123"}}, + Labels: labelpb.FromStrings("traceID", "123"), Value: 111, Timestamp: 11, }, { - Labels: []labelpb.ZLabel{{Name: "traceID", Value: "234"}}, + Labels: labelpb.FromStrings("traceID", "234"), Value: 112, Timestamp: 12, }, @@ -192,14 +191,14 @@ func TestWriter(t *testing.T) { "should error out on valid series with out of order exemplars": { reqs: []*prompb.WriteRequest{ { - Timeseries: []prompb.TimeSeries{ + Timeseries: []*prompb.TimeSeries{ { Labels: lbls, // Ingesting an exemplar requires a sample to create the series first. - Samples: []prompb.Sample{{Value: 1, Timestamp: 10}}, - Exemplars: []prompb.Exemplar{ + Samples: []*prompb.Sample{{Value: 1, Timestamp: 10}}, + Exemplars: []*prompb.Exemplar{ { - Labels: []labelpb.ZLabel{{Name: "traceID", Value: "123"}}, + Labels: labelpb.FromStrings("traceID", "123"), Value: 111, Timestamp: 11, }, @@ -208,12 +207,12 @@ func TestWriter(t *testing.T) { }, }, { - Timeseries: []prompb.TimeSeries{ + Timeseries: []*prompb.TimeSeries{ { Labels: lbls, - Exemplars: []prompb.Exemplar{ + Exemplars: []*prompb.Exemplar{ { - Labels: []labelpb.ZLabel{{Name: "traceID", Value: "1234"}}, + Labels: labelpb.FromStrings("traceID", "1234"), Value: 111, Timestamp: 10, }, @@ -228,14 +227,14 @@ func TestWriter(t *testing.T) { "should error out when exemplar label length exceeds the limit": { reqs: []*prompb.WriteRequest{ { - Timeseries: []prompb.TimeSeries{ + Timeseries: []*prompb.TimeSeries{ { Labels: lbls, // Ingesting an exemplar requires a sample to create the series first. - Samples: []prompb.Sample{{Value: 1, Timestamp: 10}}, - Exemplars: []prompb.Exemplar{ + Samples: []*prompb.Sample{{Value: 1, Timestamp: 10}}, + Exemplars: []*prompb.Exemplar{ { - Labels: []labelpb.ZLabel{{Name: strings.Repeat("a", exemplar.ExemplarMaxLabelSetLength), Value: "1"}}, + Labels: labelpb.FromStrings(strings.Repeat("a", exemplar.ExemplarMaxLabelSetLength), "1"), Value: 111, Timestamp: 11, }, @@ -250,10 +249,10 @@ func TestWriter(t *testing.T) { "should succeed on histogram with valid labels": { reqs: []*prompb.WriteRequest{ { - Timeseries: []prompb.TimeSeries{ + Timeseries: []*prompb.TimeSeries{ { - Labels: append(lbls, labelpb.ZLabel{Name: "a", Value: "1"}, labelpb.ZLabel{Name: "b", Value: "2"}), - Histograms: []prompb.Histogram{ + Labels: append(lbls, &labelpb.Label{Name: "a", Value: "1"}, &labelpb.Label{Name: "b", Value: "2"}), + Histograms: []*prompb.Histogram{ prompb.HistogramToHistogramProto(10, tsdbutil.GenerateTestHistogram(0)), }, }, @@ -261,10 +260,10 @@ func TestWriter(t *testing.T) { }, }, expectedErr: nil, - expectedIngested: []prompb.TimeSeries{ + expectedIngested: []*prompb.TimeSeries{ { - Labels: append(lbls, labelpb.ZLabel{Name: "a", Value: "1"}, labelpb.ZLabel{Name: "b", Value: "2"}), - Histograms: []prompb.Histogram{ + Labels: append(lbls, &labelpb.Label{Name: "a", Value: "1"}, &labelpb.Label{Name: "b", Value: "2"}), + Histograms: []*prompb.Histogram{ prompb.HistogramToHistogramProto(10, tsdbutil.GenerateTestHistogram(0)), }, }, @@ -273,10 +272,10 @@ func TestWriter(t *testing.T) { "should succeed on float histogram with valid labels": { reqs: []*prompb.WriteRequest{ { - Timeseries: []prompb.TimeSeries{ + Timeseries: []*prompb.TimeSeries{ { - Labels: append(lbls, labelpb.ZLabel{Name: "a", Value: "1"}, labelpb.ZLabel{Name: "b", Value: "2"}), - Histograms: []prompb.Histogram{ + Labels: append(lbls, &labelpb.Label{Name: "a", Value: "1"}, &labelpb.Label{Name: "b", Value: "2"}), + Histograms: []*prompb.Histogram{ prompb.FloatHistogramToHistogramProto(10, tsdbutil.GenerateTestFloatHistogram(1)), }, }, @@ -284,10 +283,10 @@ func TestWriter(t *testing.T) { }, }, expectedErr: nil, - expectedIngested: []prompb.TimeSeries{ + expectedIngested: []*prompb.TimeSeries{ { - Labels: append(lbls, labelpb.ZLabel{Name: "a", Value: "1"}, labelpb.ZLabel{Name: "b", Value: "2"}), - Histograms: []prompb.Histogram{ + Labels: append(lbls, &labelpb.Label{Name: "a", Value: "1"}, &labelpb.Label{Name: "b", Value: "2"}), + Histograms: []*prompb.Histogram{ prompb.FloatHistogramToHistogramProto(10, tsdbutil.GenerateTestFloatHistogram(1)), }, }, @@ -296,20 +295,20 @@ func TestWriter(t *testing.T) { "should error out on valid histograms with out of order histogram": { reqs: []*prompb.WriteRequest{ { - Timeseries: []prompb.TimeSeries{ + Timeseries: []*prompb.TimeSeries{ { - Labels: append(lbls, labelpb.ZLabel{Name: "a", Value: "1"}, labelpb.ZLabel{Name: "b", Value: "2"}), - Histograms: []prompb.Histogram{ + Labels: append(lbls, &labelpb.Label{Name: "a", Value: "1"}, &labelpb.Label{Name: "b", Value: "2"}), + Histograms: []*prompb.Histogram{ prompb.HistogramToHistogramProto(10, tsdbutil.GenerateTestHistogram(0)), }, }, }, }, { - Timeseries: []prompb.TimeSeries{ + Timeseries: []*prompb.TimeSeries{ { - Labels: append(lbls, labelpb.ZLabel{Name: "a", Value: "1"}, labelpb.ZLabel{Name: "b", Value: "2"}), - Histograms: []prompb.Histogram{ + Labels: append(lbls, &labelpb.Label{Name: "a", Value: "1"}, &labelpb.Label{Name: "b", Value: "2"}), + Histograms: []*prompb.Histogram{ prompb.HistogramToHistogramProto(9, tsdbutil.GenerateTestHistogram(0)), }, }, @@ -317,10 +316,10 @@ func TestWriter(t *testing.T) { }, }, expectedErr: errors.Wrapf(storage.ErrOutOfOrderSample, "add 1 samples"), - expectedIngested: []prompb.TimeSeries{ + expectedIngested: []*prompb.TimeSeries{ { - Labels: append(lbls, labelpb.ZLabel{Name: "a", Value: "1"}, labelpb.ZLabel{Name: "b", Value: "2"}), - Histograms: []prompb.Histogram{ + Labels: append(lbls, &labelpb.Label{Name: "a", Value: "1"}, &labelpb.Label{Name: "b", Value: "2"}), + Histograms: []*prompb.Histogram{ prompb.HistogramToHistogramProto(10, tsdbutil.GenerateTestHistogram(0)), }, }, @@ -333,7 +332,7 @@ func TestWriter(t *testing.T) { t.Run("proto_writer", func(t *testing.T) { logger, m, app := setupMultitsdb(t, testData.maxExemplars) - w := NewWriter(logger, m, testData.opts) + w := NewWriter(logger, m, testData.opts, prometheus.NewRegistry()) for idx, req := range testData.reqs { err := w.Write(context.Background(), tenancy.DefaultTenant, req.Timeseries) @@ -384,16 +383,17 @@ func TestWriter(t *testing.T) { } } -func assertWrittenData(t *testing.T, app Appendable, expectedIngested []prompb.TimeSeries) { +func assertWrittenData(t *testing.T, app Appendable, expectedIngested []*prompb.TimeSeries) { // On each expected series, assert we have a ref available. a, err := app.Appender(context.Background()) testutil.Ok(t, err) gr := a.(storage.GetRef) for _, ts := range expectedIngested { - l := labelpb.ZLabelsToPromLabels(ts.Labels) - ref, _ := gr.GetRef(l, l.Hash()) - testutil.Assert(t, ref != 0, fmt.Sprintf("appender should have reference to series %v", ts)) + l := labelpb.ToPromLabels(ts.Labels) + hash := l.Hash() + ref, _ := gr.GetRef(l, hash) + testutil.Assert(t, ref != 0, fmt.Sprintf("appender should have reference to series %v, hash: %d", ts, hash)) } } @@ -410,7 +410,7 @@ func setupMultitsdb(t *testing.T, maxExemplars int64) (log.Logger, *MultiTSDB, A EnableExemplarStorage: true, EnableNativeHistograms: true, }, - labels.FromStrings("replica", "01"), + labelpb.FromStrings("replica", "01"), "tenant_id", nil, false, @@ -475,7 +475,7 @@ func benchmarkWriter(b *testing.B, labelsNum int, seriesNum int, generateHistogr EnableExemplarStorage: true, EnableNativeHistograms: generateHistograms, }, - labels.FromStrings("replica", "01"), + labelpb.FromStrings("replica", "01"), "tenant_id", nil, false, @@ -504,7 +504,7 @@ func benchmarkWriter(b *testing.B, labelsNum int, seriesNum int, generateHistogr } b.Run("without interning", func(b *testing.B) { - w := NewWriter(logger, m, &WriterOptions{Intern: false}) + w := NewWriter(logger, m, &WriterOptions{Intern: false}, prometheus.NewRegistry()) b.ReportAllocs() b.ResetTimer() @@ -515,7 +515,7 @@ func benchmarkWriter(b *testing.B, labelsNum int, seriesNum int, generateHistogr }) b.Run("with interning", func(b *testing.B) { - w := NewWriter(logger, m, &WriterOptions{Intern: true}) + w := NewWriter(logger, m, &WriterOptions{Intern: true}, prometheus.NewRegistry()) b.ReportAllocs() b.ResetTimer() @@ -532,26 +532,26 @@ func benchmarkWriter(b *testing.B, labelsNum int, seriesNum int, generateHistogr // duplicates without error (see comment https://github.com/prometheus/prometheus/blob/release-2.37/tsdb/head_append.go#L316). // This also means the sample won't be appended, which means the overhead of appending additional samples to head is not // reflected in the benchmark, but should still capture the performance of receive writer. -func generateLabelsAndSeries(numLabels int, numSeries int, generateHistograms bool) []prompb.TimeSeries { +func generateLabelsAndSeries(numLabels int, numSeries int, generateHistograms bool) []*prompb.TimeSeries { // Generate some labels first. - l := make([]labelpb.ZLabel, 0, numLabels) - l = append(l, labelpb.ZLabel{Name: "__name__", Value: "test"}) + l := make(labelpb.Labels, 0, numLabels) + l = append(l, &labelpb.Label{Name: "__name__", Value: "test"}) for i := 0; i < numLabels; i++ { - l = append(l, labelpb.ZLabel{Name: fmt.Sprintf("label_%s", string(rune('a'+i))), Value: fmt.Sprintf("%d", i)}) + l = append(l, &labelpb.Label{Name: fmt.Sprintf("label_%s", string(rune('a'+i))), Value: fmt.Sprintf("%d", i)}) } - ts := make([]prompb.TimeSeries, numSeries) + ts := make([]*prompb.TimeSeries, numSeries) for j := 0; j < numSeries; j++ { - ts[j] = prompb.TimeSeries{ + ts[j] = &prompb.TimeSeries{ Labels: l, } if generateHistograms { - ts[j].Histograms = []prompb.Histogram{prompb.HistogramToHistogramProto(10, tsdbutil.GenerateTestHistogram(0))} + ts[j].Histograms = []*prompb.Histogram{prompb.HistogramToHistogramProto(10, tsdbutil.GenerateTestHistogram(0))} continue } - ts[j].Samples = []prompb.Sample{{Value: 1, Timestamp: 10}} + ts[j].Samples = []*prompb.Sample{{Value: 1, Timestamp: 10}} } return ts diff --git a/pkg/relabel/builder.go b/pkg/relabel/builder.go new file mode 100644 index 00000000000..00f8df90e23 --- /dev/null +++ b/pkg/relabel/builder.go @@ -0,0 +1,119 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +package relabel + +import ( + "slices" + "strings" + + "github.com/thanos-io/thanos/pkg/store/labelpb" +) + +// builder allows modifying Labels by adding and removing labels +// from a base set, producing a new sorted result. +// This mimics the Prometheus labels.Builder which is not necessary except for +// here, in the relabel package, thus it is not exported. +type builder struct { + base labelpb.Labels + del []string + add []*labelpb.Label +} + +func newBuilder(base labelpb.Labels) *builder { + return &builder{ + base: base, + del: make([]string, 0, 5), + add: make([]*labelpb.Label, 0, 5), + } +} + +func (b *builder) Del(ns ...string) *builder { + for _, n := range ns { + for i, a := range b.add { + if a.Name == n { + b.add = append(b.add[:i], b.add[i+1:]...) + } + } + b.del = append(b.del, n) + } + return b +} + +// Set adds or updates a label. A value of "" deletes the label. +func (b *builder) Set(n, v string) *builder { + if v == "" { + return b.Del(n) + } + for i, a := range b.add { + if a.Name == n { + b.add[i].Value = v + return b + } + } + b.add = append(b.add, &labelpb.Label{Name: n, Value: v}) + return b +} + +// Get returns the value for the label with the given name, reflecting +// any pending adds/deletes that haven't been materialized yet. +func (b *builder) Get(name string) string { + for _, a := range b.add { + if a.Name == name { + return a.Value + } + } + if slices.Contains(b.del, name) { + return "" + } + return b.base.Get(name) +} + +// Range calls f on each label in the effective set (base minus deletes, +// plus adds). Order is not guaranteed. The set is snapshotted before +// iteration so mutations via Set/Del inside f are safe. +func (b *builder) Range(f func(l *labelpb.Label)) { + adds := b.add // snapshot, since things may be 'added' during iteration + for _, l := range b.base { + if slices.Contains(b.del, l.Name) || containsName(adds, l.Name) { + continue + } + f(l) + } + for _, l := range adds { + f(l) + } +} + +// Labels returns the new sorted label set with all modifications applied. +func (b *builder) Labels() labelpb.Labels { + if len(b.del) == 0 && len(b.add) == 0 { + return b.base + } + + expectedSize := len(b.base) + len(b.add) - len(b.del) + if expectedSize < 1 { + expectedSize = 1 + } + res := make(labelpb.Labels, 0, expectedSize) + for _, l := range b.base { + if slices.Contains(b.del, l.Name) || containsName(b.add, l.Name) { + continue + } + res = append(res, l) + } + if len(b.add) > 0 { + res = append(res, b.add...) + slices.SortFunc(res, func(a, b *labelpb.Label) int { return strings.Compare(a.Name, b.Name) }) + } + return res +} + +func containsName(ls []*labelpb.Label, name string) bool { + for _, l := range ls { + if l.Name == name { + return true + } + } + return false +} diff --git a/pkg/relabel/builder_test.go b/pkg/relabel/builder_test.go new file mode 100644 index 00000000000..79014839662 --- /dev/null +++ b/pkg/relabel/builder_test.go @@ -0,0 +1,224 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +package relabel + +import ( + "strconv" + "testing" + + "github.com/stretchr/testify/require" + "github.com/thanos-io/thanos/pkg/store/labelpb" +) + +func TestBuilder(t *testing.T) { + for i, tc := range []struct { + base labelpb.Labels + del []string + set [][2]string + want labelpb.Labels + }{ + { + base: labelpb.FromStrings("aaa", "111"), + want: labelpb.FromStrings("aaa", "111"), + }, + { + base: nil, + set: [][2]string{{"aaa", "444"}, {"bbb", "555"}, {"ccc", "666"}}, + want: labelpb.FromStrings("aaa", "444", "bbb", "555", "ccc", "666"), + }, + { + base: labelpb.FromStrings("aaa", "111", "bbb", "222", "ccc", "333"), + set: [][2]string{{"aaa", "444"}, {"bbb", "555"}, {"ccc", "666"}}, + want: labelpb.FromStrings("aaa", "444", "bbb", "555", "ccc", "666"), + }, + { + base: labelpb.FromStrings("aaa", "111", "bbb", "222", "ccc", "333"), + del: []string{"bbb"}, + want: labelpb.FromStrings("aaa", "111", "ccc", "333"), + }, + { + set: [][2]string{{"aaa", "111"}, {"bbb", "222"}, {"ccc", "333"}}, + del: []string{"bbb"}, + want: labelpb.FromStrings("aaa", "111", "ccc", "333"), + }, + { + base: labelpb.FromStrings("aaa", "111"), + set: [][2]string{{"bbb", "222"}}, + want: labelpb.FromStrings("aaa", "111", "bbb", "222"), + }, + { + base: labelpb.FromStrings("aaa", "111"), + set: [][2]string{{"bbb", "222"}, {"bbb", "333"}}, + want: labelpb.FromStrings("aaa", "111", "bbb", "333"), + }, + { + base: labelpb.FromStrings("aaa", "111", "bbb", "222", "ccc", "333"), + del: []string{"bbb"}, + set: [][2]string{{"ddd", "444"}}, + want: labelpb.FromStrings("aaa", "111", "ccc", "333", "ddd", "444"), + }, + { + base: labelpb.FromStrings("aaa", "111", "bbb", "222", "ccc", "333"), + set: [][2]string{{"bbb", ""}}, + want: labelpb.FromStrings("aaa", "111", "ccc", "333"), + }, + } { + t.Run(strconv.Itoa(i), func(t *testing.T) { + b := newBuilder(tc.base) + for _, s := range tc.set { + b.Set(s[0], s[1]) + } + b.Del(tc.del...) + require.True(t, labelpb.Equal(tc.want, b.Labels()), + "expected %s but got %s", tc.want, b.Labels()) + }) + } + + t.Run("set_after_del", func(t *testing.T) { + b := newBuilder(labelpb.FromStrings("aaa", "111")) + b.Del("bbb") + b.Set("bbb", "222") + require.True(t, labelpb.Equal(labelpb.FromStrings("aaa", "111", "bbb", "222"), b.Labels())) + require.Equal(t, "222", b.Get("bbb")) + }) + + t.Run("del_nonexistent", func(t *testing.T) { + b := newBuilder(labelpb.FromStrings("aaa", "111")) + b.Del("zzz") + require.True(t, labelpb.Equal(labelpb.FromStrings("aaa", "111"), b.Labels())) + }) + + t.Run("no_modifications_returns_base", func(t *testing.T) { + base := labelpb.FromStrings("aaa", "111") + b := newBuilder(base) + got := b.Labels() + require.True(t, labelpb.Equal(base, got)) + require.True(t, &base[0] == &got[0]) + }) +} + +func TestBuilderGet(t *testing.T) { + base := labelpb.FromStrings("aaa", "111", "bbb", "222", "ccc", "333") + b := newBuilder(base) + + require.Equal(t, "111", b.Get("aaa")) + require.Equal(t, "222", b.Get("bbb")) + require.Equal(t, "", b.Get("zzz")) + + b.Set("ddd", "444") + require.Equal(t, "444", b.Get("ddd")) + + b.Set("bbb", "999") + require.Equal(t, "999", b.Get("bbb")) + + b.Del("aaa") + require.Equal(t, "", b.Get("aaa")) +} + +func TestBuilderRange(t *testing.T) { + t.Run("iterates_effective_set", func(t *testing.T) { + b := newBuilder(labelpb.FromStrings("aaa", "111", "bbb", "222", "ccc", "333")) + b.Del("bbb") + b.Set("ddd", "444") + + got := map[string]string{} + b.Range(func(l *labelpb.Label) { + got[l.Name] = l.Value + }) + require.Equal(t, map[string]string{ + "aaa": "111", "ccc": "333", "ddd": "444", + }, got) + }) + + t.Run("set_override_visible", func(t *testing.T) { + b := newBuilder(labelpb.FromStrings("aaa", "111")) + b.Set("aaa", "999") + + got := map[string]string{} + b.Range(func(l *labelpb.Label) { + got[l.Name] = l.Value + }) + require.Equal(t, map[string]string{"aaa": "999"}, got) + }) + + t.Run("del_during_range", func(t *testing.T) { + b := newBuilder(labelpb.FromStrings("aaa", "111", "bbb", "222", "ccc", "333")) + b.Range(func(l *labelpb.Label) { + if l.Name == "bbb" { + b.Del(l.Name) + } + }) + want := labelpb.FromStrings("aaa", "111", "ccc", "333") + require.True(t, labelpb.Equal(want, b.Labels()), + "expected %s but got %s", want, b.Labels()) + }) + + t.Run("set_during_range_not_visited", func(t *testing.T) { + b := newBuilder(labelpb.FromStrings("aaa", "111")) + var visited []string + b.Range(func(l *labelpb.Label) { + visited = append(visited, l.Name) + if l.Name == "aaa" { + b.Set("zzz", "999") + } + }) + require.Equal(t, []string{"aaa"}, visited) + require.Equal(t, "999", b.Get("zzz")) + }) + + t.Run("empty_builder", func(t *testing.T) { + b := newBuilder(nil) + count := 0 + b.Range(func(l *labelpb.Label) { count++ }) + require.Equal(t, 0, count) + }) +} + +var benchmarkBuilderResult labelpb.Labels + +func BenchmarkBuilder(b *testing.B) { + benchLabels := [][2]string{ + {"job", "node"}, + {"instance", "123.123.1.211:9090"}, + {"path", "/api/v1/namespaces//deployments/"}, + {"method", "GET"}, + {"namespace", "system"}, + {"status", "500"}, + {"prometheus", "prometheus-core-1"}, + {"datacenter", "eu-west-1"}, + {"pod_name", "abcdef-99999-defee"}, + } + + b.Run("set_from_empty", func(b *testing.B) { + b.ReportAllocs() + for i := 0; i < b.N; i++ { + bldr := newBuilder(nil) + for _, l := range benchLabels { + bldr.Set(l[0], l[1]) + } + benchmarkBuilderResult = bldr.Labels() + } + }) + + b.Run("del_and_set", func(b *testing.B) { + base := labelpb.FromStrings( + "datacenter", "eu-west-1", + "instance", "123.123.1.211:9090", + "job", "node", + "method", "GET", + "namespace", "system", + "path", "/api/v1/namespaces//deployments/", + "pod_name", "abcdef-99999-defee", + "prometheus", "prometheus-core-1", + "status", "500", + ) + b.ReportAllocs() + for i := 0; i < b.N; i++ { + bldr := newBuilder(base) + bldr.Del("method", "status") + bldr.Set("new_label", "new_value") + benchmarkBuilderResult = bldr.Labels() + } + }) +} diff --git a/pkg/relabel/relabel.go b/pkg/relabel/relabel.go new file mode 100644 index 00000000000..9ba723c5276 --- /dev/null +++ b/pkg/relabel/relabel.go @@ -0,0 +1,141 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +package relabel + +import ( + "crypto/md5" + "encoding/binary" + "fmt" + "strconv" + "strings" + + "github.com/thanos-io/thanos/pkg/unique" + + "github.com/prometheus/common/model" + "github.com/prometheus/prometheus/model/relabel" + "github.com/thanos-io/thanos/pkg/store/labelpb" +) + +// Process returns a relabeled version of the given label set. The relabel configurations +// are applied in order of input. +// There are circumstances where Process will modify the input label. +// If you want to avoid issues with the input label set being modified, at the cost of +// higher memory usage, you can use lbls.Copy(). +// If a label set is dropped, EmptyLabels and false is returned. +// Note! this is a clone of the Prometheus relabel.Process function, +// introduced for efficencey reasons. +func Process(lbls labelpb.Labels, cfgs ...*relabel.Config) (ret labelpb.Labels, keep bool) { + lb := newBuilder(lbls) + for _, cfg := range cfgs { + if !relabelWithConfig(cfg, lb) { + return labelpb.EmptyLabels(), false + } + } + return lb.Labels(), true +} + +func relabelWithConfig(cfg *relabel.Config, lb *builder) (keep bool) { + var va [16]string + values := va[:0] + if len(cfg.SourceLabels) > cap(values) { + values = make([]string, 0, len(cfg.SourceLabels)) + } + for _, ln := range cfg.SourceLabels { + values = append(values, lb.Get(string(ln))) + } + val := strings.Join(values, cfg.Separator) + + switch cfg.Action { + case relabel.Drop: + if cfg.Regex.MatchString(val) { + return false + } + case relabel.Keep: + if !cfg.Regex.MatchString(val) { + return false + } + case relabel.DropEqual: + if lb.Get(cfg.TargetLabel) == val { + return false + } + case relabel.KeepEqual: + if lb.Get(cfg.TargetLabel) != val { + return false + } + case relabel.Replace: + indexes := cfg.Regex.FindStringSubmatchIndex(val) + // If there is no match no replacement must take place. + if indexes == nil { + break + } + target := model.LabelName(cfg.Regex.ExpandString([]byte{}, cfg.TargetLabel, val, indexes)) + if !target.IsValid() { + break + } + res := cfg.Regex.ExpandString([]byte{}, cfg.Replacement, val, indexes) + if len(res) == 0 { + lb.Del(string(target)) + break + } + name := string(target) + value := string(res) + // Only intern and set if the value actually changed; avoids contention on unique's global map. + if lb.Get(name) != value { + name = unique.Make(name).Value() + value = unique.Make(value).Value() + lb.Set(name, value) + } + case relabel.Lowercase: + value := strings.ToLower(val) + // Only intern and set if the value actually changed; avoids contention on unique's global map. + if lb.Get(cfg.TargetLabel) != value { + value = unique.Make(value).Value() + lb.Set(cfg.TargetLabel, value) + } + case relabel.Uppercase: + value := strings.ToUpper(val) + // Only intern and set if the value actually changed; avoids contention on unique's global map. + if lb.Get(cfg.TargetLabel) != value { + value = unique.Make(value).Value() + lb.Set(cfg.TargetLabel, value) + } + case relabel.HashMod: + hash := md5.Sum([]byte(val)) + // Use only the last 8 bytes of the hash to give the same result as earlier versions of this code. + mod := binary.BigEndian.Uint64(hash[8:]) % cfg.Modulus + value := strconv.FormatUint(mod, 10) + // Only intern and set if the value actually changed; avoids contention on unique's global map. + if lb.Get(cfg.TargetLabel) != value { + value = unique.Make(value).Value() + lb.Set(cfg.TargetLabel, value) + } + case relabel.LabelMap: + lb.Range(func(l *labelpb.Label) { + if cfg.Regex.MatchString(l.Name) { + name := cfg.Regex.ReplaceAllString(l.Name, cfg.Replacement) + // Only intern and set if the value actually changed; avoids contention on unique's global map. + if name != l.Name { + name = unique.Make(name).Value() + lb.Set(name, l.Value) + } + } + }) + case relabel.LabelDrop: + lb.Range(func(l *labelpb.Label) { + if cfg.Regex.MatchString(l.Name) { + lb.Del(l.Name) + } + }) + case relabel.LabelKeep: + lb.Range(func(l *labelpb.Label) { + if !cfg.Regex.MatchString(l.Name) { + lb.Del(l.Name) + } + }) + default: + panic(fmt.Errorf("relabel: unknown relabel action type %q", cfg.Action)) + } + + return true +} diff --git a/pkg/relabel/relabel_test.go b/pkg/relabel/relabel_test.go new file mode 100644 index 00000000000..d71727bdeb9 --- /dev/null +++ b/pkg/relabel/relabel_test.go @@ -0,0 +1,829 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Copyright 2015 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package relabel + +import ( + "strconv" + "testing" + + "github.com/prometheus/common/model" + "github.com/prometheus/prometheus/model/relabel" + "github.com/stretchr/testify/require" + "gopkg.in/yaml.v2" + + "github.com/thanos-io/thanos/pkg/store/labelpb" +) + +func TestRelabel(t *testing.T) { + tests := []struct { + input labelpb.Labels + relabel []*relabel.Config + output labelpb.Labels + drop bool + }{ + { + input: labelpb.FromMap(map[string]string{ + "a": "foo", + "b": "bar", + "c": "baz", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp("f(.*)"), + TargetLabel: "d", + Separator: ";", + Replacement: "ch${1}-ch${1}", + Action: relabel.Replace, + }, + }, + output: labelpb.FromMap(map[string]string{ + "a": "foo", + "b": "bar", + "c": "baz", + "d": "choo-choo", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "foo", + "b": "bar", + "c": "baz", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"a", "b"}, + Regex: relabel.MustNewRegexp("f(.*);(.*)r"), + TargetLabel: "a", + Separator: ";", + Replacement: "b${1}${2}m", // boobam + Action: relabel.Replace, + }, + { + SourceLabels: model.LabelNames{"c", "a"}, + Regex: relabel.MustNewRegexp("(b).*b(.*)ba(.*)"), + TargetLabel: "d", + Separator: ";", + Replacement: "$1$2$2$3", + Action: relabel.Replace, + }, + }, + output: labelpb.FromMap(map[string]string{ + "a": "boobam", + "b": "bar", + "c": "baz", + "d": "boooom", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "foo", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp(".*o.*"), + Action: relabel.Drop, + }, { + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp("f(.*)"), + TargetLabel: "d", + Separator: ";", + Replacement: "ch$1-ch$1", + Action: relabel.Replace, + }, + }, + drop: true, + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "foo", + "b": "bar", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp(".*o.*"), + Action: relabel.Drop, + }, + }, + drop: true, + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "abc", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp(".*(b).*"), + TargetLabel: "d", + Separator: ";", + Replacement: "$1", + Action: relabel.Replace, + }, + }, + output: labelpb.FromMap(map[string]string{ + "a": "abc", + "d": "b", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "foo", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp("no-match"), + Action: relabel.Drop, + }, + }, + output: labelpb.FromMap(map[string]string{ + "a": "foo", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "foo", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp("f|o"), + Action: relabel.Drop, + }, + }, + output: labelpb.FromMap(map[string]string{ + "a": "foo", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "foo", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp("no-match"), + Action: relabel.Keep, + }, + }, + drop: true, + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "foo", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp("f.*"), + Action: relabel.Keep, + }, + }, + output: labelpb.FromMap(map[string]string{ + "a": "foo", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "boo", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp("f"), + TargetLabel: "b", + Replacement: "bar", + Action: relabel.Replace, + }, + }, + output: labelpb.FromMap(map[string]string{ + "a": "boo", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "foo", + "f": "baz", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp("(f).*"), + TargetLabel: "$1", + Replacement: "$2", + Action: relabel.Replace, + }, + }, + output: labelpb.FromMap(map[string]string{ + "a": "foo", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "foo", + "b": "bar", + "c": "baz", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"c"}, + TargetLabel: "d", + Separator: ";", + Action: relabel.HashMod, + Modulus: 1000, + }, + }, + output: labelpb.FromMap(map[string]string{ + "a": "foo", + "b": "bar", + "c": "baz", + "d": "976", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "foo\nbar", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"a"}, + TargetLabel: "b", + Separator: ";", + Action: relabel.HashMod, + Modulus: 1000, + }, + }, + output: labelpb.FromMap(map[string]string{ + "a": "foo\nbar", + "b": "734", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "foo", + "b1": "bar", + "b2": "baz", + }), + relabel: []*relabel.Config{ + { + Regex: relabel.MustNewRegexp("(b.*)"), + Replacement: "bar_${1}", + Action: relabel.LabelMap, + }, + }, + output: labelpb.FromMap(map[string]string{ + "a": "foo", + "b1": "bar", + "b2": "baz", + "bar_b1": "bar", + "bar_b2": "baz", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "foo", + "__meta_my_bar": "aaa", + "__meta_my_baz": "bbb", + "__meta_other": "ccc", + }), + relabel: []*relabel.Config{ + { + Regex: relabel.MustNewRegexp("__meta_(my.*)"), + Replacement: "${1}", + Action: relabel.LabelMap, + }, + }, + output: labelpb.FromMap(map[string]string{ + "a": "foo", + "__meta_my_bar": "aaa", + "__meta_my_baz": "bbb", + "__meta_other": "ccc", + "my_bar": "aaa", + "my_baz": "bbb", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "some-name-value", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp("some-([^-]+)-([^,]+)"), + Action: relabel.Replace, + Replacement: "${2}", + TargetLabel: "${1}", + }, + }, + output: labelpb.FromMap(map[string]string{ + "a": "some-name-value", + "name": "value", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "some-name-value", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp("some-([^-]+)-([^,]+)"), + Action: relabel.Replace, + Replacement: "${3}", + TargetLabel: "${1}", + }, + }, + output: labelpb.FromMap(map[string]string{ + "a": "some-name-value", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "some-name-0", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp("some-([^-]+)-([^,]+)"), + Action: relabel.Replace, + Replacement: "${1}", + TargetLabel: "${3}", + }, + { + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp("some-([^-]+)-([^,]+)"), + Action: relabel.Replace, + Replacement: "${1}", + TargetLabel: "${3}", + }, + { + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp("some-([^-]+)(-[^,]+)"), + Action: relabel.Replace, + Replacement: "${1}", + TargetLabel: "${3}", + }, + }, + output: labelpb.FromMap(map[string]string{ + "a": "some-name-0", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "__meta_sd_tags": "path:/secret,job:some-job,label:foo=bar", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"__meta_sd_tags"}, + Regex: relabel.MustNewRegexp("(?:.+,|^)path:(/[^,]+).*"), + Action: relabel.Replace, + Replacement: "${1}", + TargetLabel: "__metrics_path__", + }, + { + SourceLabels: model.LabelNames{"__meta_sd_tags"}, + Regex: relabel.MustNewRegexp("(?:.+,|^)job:([^,]+).*"), + Action: relabel.Replace, + Replacement: "${1}", + TargetLabel: "job", + }, + { + SourceLabels: model.LabelNames{"__meta_sd_tags"}, + Regex: relabel.MustNewRegexp("(?:.+,|^)label:([^=]+)=([^,]+).*"), + Action: relabel.Replace, + Replacement: "${2}", + TargetLabel: "${1}", + }, + }, + output: labelpb.FromMap(map[string]string{ + "__meta_sd_tags": "path:/secret,job:some-job,label:foo=bar", + "__metrics_path__": "/secret", + "job": "some-job", + "foo": "bar", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "__meta_kubernetes_pod_container_port_name": "foo", + "__meta_kubernetes_pod_annotation_XXX_metrics_port": "9091", + }), + relabel: []*relabel.Config{ + { + Regex: relabel.MustNewRegexp("^__meta_kubernetes_pod_container_port_name$"), + Action: relabel.LabelDrop, + }, + { + SourceLabels: model.LabelNames{"__meta_kubernetes_pod_annotation_XXX_metrics_port"}, + Regex: relabel.MustNewRegexp("(.+)"), + Action: relabel.Replace, + Replacement: "metrics", + TargetLabel: "__meta_kubernetes_pod_container_port_name", + }, + { + SourceLabels: model.LabelNames{"__meta_kubernetes_pod_container_port_name"}, + Regex: relabel.MustNewRegexp("^metrics$"), + Action: relabel.Keep, + }, + }, + output: labelpb.FromMap(map[string]string{ + "__meta_kubernetes_pod_annotation_XXX_metrics_port": "9091", + "__meta_kubernetes_pod_container_port_name": "metrics", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "foo", + "b1": "bar", + "b2": "baz", + }), + relabel: []*relabel.Config{ + { + Regex: relabel.MustNewRegexp("(b.*)"), + Action: relabel.LabelKeep, + }, + }, + output: labelpb.FromMap(map[string]string{ + "b1": "bar", + "b2": "baz", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "a": "foo", + "b1": "bar", + "b2": "baz", + }), + relabel: []*relabel.Config{ + { + Regex: relabel.MustNewRegexp("(b.*)"), + Action: relabel.LabelDrop, + }, + }, + output: labelpb.FromMap(map[string]string{ + "a": "foo", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "foo": "bAr123Foo", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"foo"}, + Action: relabel.Uppercase, + TargetLabel: "foo_uppercase", + }, + { + SourceLabels: model.LabelNames{"foo"}, + Action: relabel.Lowercase, + TargetLabel: "foo_lowercase", + }, + }, + output: labelpb.FromMap(map[string]string{ + "foo": "bAr123Foo", + "foo_lowercase": "bar123foo", + "foo_uppercase": "BAR123FOO", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "__tmp_port": "1234", + "__port1": "1234", + "__port2": "5678", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"__tmp_port"}, + Action: relabel.KeepEqual, + TargetLabel: "__port1", + }, + }, + output: labelpb.FromMap(map[string]string{ + "__tmp_port": "1234", + "__port1": "1234", + "__port2": "5678", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "__tmp_port": "1234", + "__port1": "1234", + "__port2": "5678", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"__tmp_port"}, + Action: relabel.DropEqual, + TargetLabel: "__port1", + }, + }, + drop: true, + }, + { + input: labelpb.FromMap(map[string]string{ + "__tmp_port": "1234", + "__port1": "1234", + "__port2": "5678", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"__tmp_port"}, + Action: relabel.DropEqual, + TargetLabel: "__port2", + }, + }, + output: labelpb.FromMap(map[string]string{ + "__tmp_port": "1234", + "__port1": "1234", + "__port2": "5678", + }), + }, + { + input: labelpb.FromMap(map[string]string{ + "__tmp_port": "1234", + "__port1": "1234", + "__port2": "5678", + }), + relabel: []*relabel.Config{ + { + SourceLabels: model.LabelNames{"__tmp_port"}, + Action: relabel.KeepEqual, + TargetLabel: "__port2", + }, + }, + drop: true, + }, + } + + for i, test := range tests { + t.Run(strconv.Itoa(i), func(t *testing.T) { + for _, cfg := range test.relabel { + if cfg.Action == "" { + cfg.Action = relabel.DefaultRelabelConfig.Action + } + if cfg.Separator == "" { + cfg.Separator = relabel.DefaultRelabelConfig.Separator + } + if cfg.Regex.Regexp == nil || cfg.Regex.String() == "" { + cfg.Regex = relabel.DefaultRelabelConfig.Regex + } + if cfg.Replacement == "" { + cfg.Replacement = relabel.DefaultRelabelConfig.Replacement + } + require.NoError(t, cfg.Validate()) + } + + res, keep := Process(test.input, test.relabel...) + require.Equal(t, !test.drop, keep) + if keep { + require.Truef(t, labelpb.Equal(test.output, res), + "expected %s but got %s", test.output, res) + } + }) + } +} + +func TestRelabelValidate(t *testing.T) { + tests := []struct { + config relabel.Config + expected string + }{ + { + config: relabel.Config{}, + expected: `relabel action cannot be empty`, + }, + { + config: relabel.Config{ + Action: relabel.Replace, + }, + expected: `requires 'target_label' value`, + }, + { + config: relabel.Config{ + Action: relabel.Lowercase, + }, + expected: `requires 'target_label' value`, + }, + { + config: relabel.Config{ + Action: relabel.Lowercase, + Replacement: relabel.DefaultRelabelConfig.Replacement, + TargetLabel: "${3}", + }, + expected: `"${3}" is invalid 'target_label'`, + }, + { + config: relabel.Config{ + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp("some-([^-]+)-([^,]+)"), + Action: relabel.Replace, + Replacement: "${1}", + TargetLabel: "${3}", + }, + }, + { + config: relabel.Config{ + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp("some-([^-]+)-([^,]+)"), + Action: relabel.Replace, + Replacement: "${1}", + TargetLabel: "0${3}", + }, + expected: `"0${3}" is invalid 'target_label'`, + }, + { + config: relabel.Config{ + SourceLabels: model.LabelNames{"a"}, + Regex: relabel.MustNewRegexp("some-([^-]+)-([^,]+)"), + Action: relabel.Replace, + Replacement: "${1}", + TargetLabel: "-${3}", + }, + expected: `"-${3}" is invalid 'target_label' for replace action`, + }, + } + for i, test := range tests { + t.Run(strconv.Itoa(i), func(t *testing.T) { + err := test.config.Validate() + if test.expected == "" { + require.NoError(t, err) + } else { + require.ErrorContains(t, err, test.expected) + } + }) + } +} + +func BenchmarkRelabel(b *testing.B) { + tests := []struct { + name string + lbls labelpb.Labels + config string + cfgs []*relabel.Config + }{ + { + name: "example", + config: ` + - source_labels: [job, __meta_dns_name] + regex: "(.*)some-[regex]" + target_label: job + replacement: foo-${1} + # action defaults to 'replace' + - source_labels: [abc] + target_label: cde + - replacement: static + target_label: abc + - regex: + replacement: static + target_label: abc`, + lbls: labelpb.FromStrings("__meta_dns_name", "example-some-x.com", "abc", "def", "job", "foo"), + }, + { + name: "kubernetes", + config: ` + - source_labels: + - __meta_kubernetes_pod_container_port_name + regex: .*-metrics + action: keep + - source_labels: + - __meta_kubernetes_pod_label_name + action: drop + regex: "" + - source_labels: + - __meta_kubernetes_pod_phase + regex: Succeeded|Failed + action: drop + - source_labels: + - __meta_kubernetes_pod_annotation_prometheus_io_scrape + regex: "false" + action: drop + - source_labels: + - __meta_kubernetes_pod_annotation_prometheus_io_scheme + target_label: __scheme__ + regex: (https?) + replacement: $1 + action: replace + - source_labels: + - __meta_kubernetes_pod_annotation_prometheus_io_path + target_label: __metrics_path__ + regex: (.+) + replacement: $1 + action: replace + - source_labels: + - __address__ + - __meta_kubernetes_pod_annotation_prometheus_io_port + target_label: __address__ + regex: (.+?)(\:\d+)?;(\d+) + replacement: $1:$3 + action: replace + - regex: __meta_kubernetes_pod_annotation_prometheus_io_param_(.+) + replacement: __param_$1 + action: labelmap + - regex: __meta_kubernetes_pod_label_prometheus_io_label_(.+) + action: labelmap + - regex: __meta_kubernetes_pod_annotation_prometheus_io_label_(.+) + action: labelmap + - source_labels: + - __meta_kubernetes_namespace + - __meta_kubernetes_pod_label_name + separator: / + target_label: job + replacement: $1 + action: replace + - source_labels: + - __meta_kubernetes_namespace + target_label: namespace + action: replace + - source_labels: + - __meta_kubernetes_pod_name + target_label: pod + action: replace + - source_labels: + - __meta_kubernetes_pod_container_name + target_label: container + action: replace + - source_labels: + - __meta_kubernetes_pod_name + - __meta_kubernetes_pod_container_name + - __meta_kubernetes_pod_container_port_name + separator: ':' + target_label: instance + action: replace + - target_label: cluster + replacement: dev-us-central-0 + - source_labels: + - __meta_kubernetes_namespace + regex: hosted-grafana + action: drop + - source_labels: + - __address__ + target_label: __tmp_hash + modulus: 3 + action: hashmod + - source_labels: + - __tmp_hash + regex: ^0$ + action: keep + - regex: __tmp_hash + action: labeldrop`, + lbls: labelpb.FromStrings( + "__address__", "10.132.183.40:80", + "__meta_kubernetes_namespace", "loki-boltdb-shipper", + "__meta_kubernetes_pod_annotation_promtail_loki_boltdb_shipper_hash", "50523b9759094a144adcec2eae0aa4ad", + "__meta_kubernetes_pod_annotationpresent_promtail_loki_boltdb_shipper_hash", "true", + "__meta_kubernetes_pod_container_init", "false", + "__meta_kubernetes_pod_container_name", "promtail", + "__meta_kubernetes_pod_container_port_name", "http-metrics", + "__meta_kubernetes_pod_container_port_number", "80", + "__meta_kubernetes_pod_container_port_protocol", "TCP", + "__meta_kubernetes_pod_controller_kind", "DaemonSet", + "__meta_kubernetes_pod_controller_name", "promtail-loki-boltdb-shipper", + "__meta_kubernetes_pod_host_ip", "10.128.0.178", + "__meta_kubernetes_pod_ip", "10.132.183.40", + "__meta_kubernetes_pod_label_controller_revision_hash", "555b77cd7d", + "__meta_kubernetes_pod_label_name", "promtail-loki-boltdb-shipper", + "__meta_kubernetes_pod_label_pod_template_generation", "45", + "__meta_kubernetes_pod_labelpresent_controller_revision_hash", "true", + "__meta_kubernetes_pod_labelpresent_name", "true", + "__meta_kubernetes_pod_labelpresent_pod_template_generation", "true", + "__meta_kubernetes_pod_name", "promtail-loki-boltdb-shipper-jgtr7", + "__meta_kubernetes_pod_node_name", "gke-dev-us-central-0-main-n2s8-2-14d53341-9hkr", + "__meta_kubernetes_pod_phase", "Running", + "__meta_kubernetes_pod_ready", "true", + "__meta_kubernetes_pod_uid", "4c586419-7f6c-448d-aeec-ca4fa5b05e60", + "__metrics_path__", "/metrics", + "__scheme__", "http", + "__scrape_interval__", "15s", + "__scrape_timeout__", "10s", + "job", "kubernetes-pods"), + }, + } + for i := range tests { + err := yaml.UnmarshalStrict([]byte(tests[i].config), &tests[i].cfgs) + require.NoError(b, err) + } + for _, tt := range tests { + b.Run(tt.name, func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, _ = Process(tt.lbls, tt.cfgs...) + } + }) + } +} diff --git a/pkg/rules/manager.go b/pkg/rules/manager.go index 9a802ce10af..8fde24b42fa 100644 --- a/pkg/rules/manager.go +++ b/pkg/rules/manager.go @@ -14,12 +14,11 @@ import ( "sync" "time" - "github.com/gogo/protobuf/proto" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/model/rulefmt" "github.com/prometheus/prometheus/rules" + "google.golang.org/protobuf/types/known/timestamppb" "gopkg.in/yaml.v3" "github.com/thanos-io/thanos/pkg/errutil" @@ -40,13 +39,12 @@ type Group struct { func (g Group) toProto() *rulespb.RuleGroup { ret := &rulespb.RuleGroup{ - Name: g.Name(), - File: g.OriginalFile, - Interval: g.Interval().Seconds(), - Limit: int64(g.Limit()), - PartialResponseStrategy: g.PartialResponseStrategy, - // UTC needed due to https://github.com/gogo/protobuf/issues/519. - LastEvaluation: g.GetLastEvaluation().UTC(), + Name: g.Name(), + File: g.OriginalFile, + Interval: g.Interval().Seconds(), + Limit: int64(g.Limit()), + PartialResponseStrategy: g.PartialResponseStrategy, + LastEvaluation: timestamppb.New(g.GetLastEvaluation()), EvaluationDurationSeconds: g.GetEvaluationTime().Seconds(), } @@ -65,26 +63,24 @@ func (g Group) toProto() *rulespb.RuleGroup { Query: rule.Query().String(), DurationSeconds: rule.HoldDuration().Seconds(), KeepFiringForSeconds: rule.KeepFiringFor().Seconds(), - Labels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(rule.Labels())}, - Annotations: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(rule.Annotations())}, + Labels: &labelpb.LabelSet{Labels: labelpb.FromPromLabels(rule.Labels())}, + Annotations: &labelpb.LabelSet{Labels: labelpb.FromPromLabels(rule.Annotations())}, Alerts: ActiveAlertsToProto(g.PartialResponseStrategy, rule), Health: string(rule.Health()), LastError: lastError, EvaluationDurationSeconds: rule.GetEvaluationDuration().Seconds(), - // UTC needed due to https://github.com/gogo/protobuf/issues/519. - LastEvaluation: rule.GetEvaluationTimestamp().UTC(), + LastEvaluation: timestamppb.New(rule.GetEvaluationTimestamp()), }}}) case *rules.RecordingRule: ret.Rules = append(ret.Rules, &rulespb.Rule{ Result: &rulespb.Rule_Recording{Recording: &rulespb.RecordingRule{ Name: rule.Name(), Query: rule.Query().String(), - Labels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(rule.Labels())}, + Labels: &labelpb.LabelSet{Labels: labelpb.FromPromLabels(rule.Labels())}, Health: string(rule.Health()), LastError: lastError, EvaluationDurationSeconds: rule.GetEvaluationDuration().Seconds(), - // UTC needed due to https://github.com/gogo/protobuf/issues/519. - LastEvaluation: rule.GetEvaluationTimestamp().UTC(), + LastEvaluation: timestamppb.New(rule.GetEvaluationTimestamp()), }}}) default: // We cannot do much, let's panic, API will recover. @@ -98,14 +94,12 @@ func ActiveAlertsToProto(s storepb.PartialResponseStrategy, a *rules.AlertingRul active := a.ActiveAlerts() ret := make([]*rulespb.AlertInstance, len(active)) for i, ruleAlert := range active { - // UTC needed due to https://github.com/gogo/protobuf/issues/519. - activeAt := ruleAlert.ActiveAt.UTC() ret[i] = &rulespb.AlertInstance{ PartialResponseStrategy: s, - Labels: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(ruleAlert.Labels)}, - Annotations: labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(ruleAlert.Annotations)}, + Labels: &labelpb.LabelSet{Labels: labelpb.FromPromLabels(ruleAlert.Labels)}, + Annotations: &labelpb.LabelSet{Labels: labelpb.FromPromLabels(ruleAlert.Annotations)}, State: rulespb.AlertState(ruleAlert.State), - ActiveAt: &activeAt, + ActiveAt: timestamppb.New(ruleAlert.ActiveAt), Value: strconv.FormatFloat(ruleAlert.Value, 'e', -1, 64), } } @@ -115,9 +109,11 @@ func ActiveAlertsToProto(s storepb.PartialResponseStrategy, a *rules.AlertingRul // Manager is a partial response strategy and proto compatible Manager. // Manager also implements rulespb.Rules gRPC service. type Manager struct { + rulespb.UnimplementedRulesServer + workDir string mgrs map[storepb.PartialResponseStrategy]*rules.Manager - extLset labels.Labels + extLset labelpb.Labels mtx sync.RWMutex ruleFiles map[string]string @@ -132,7 +128,7 @@ func NewManager( dataDir string, baseOpts rules.ManagerOptions, queryFuncCreator func(partialResponseStrategy storepb.PartialResponseStrategy) rules.QueryFunc, - extLset labels.Labels, + extLset labelpb.Labels, externalURL string, ) *Manager { m := &Manager{ @@ -384,7 +380,7 @@ func (m *Manager) Update(evalInterval time.Duration, files []string) error { continue } // We add external labels in `pkg/alert.Queue`. - if err := mgr.Update(evalInterval, fs, m.extLset, m.externalURL, nil); err != nil { + if err := mgr.Update(evalInterval, fs, labelpb.ToPromLabels(m.extLset), m.externalURL, nil); err != nil { // TODO(bwplotka): Prometheus logs all error details. Fix it upstream to have consistent error handling. errs.Add(errors.Wrapf(err, "strategy %s, update rules", s)) continue @@ -402,14 +398,12 @@ func (m *Manager) Rules(r *rulespb.RulesRequest, s rulespb.Rules_RulesServer) (e pgs := make([]*rulespb.RuleGroup, 0, len(groups)) for _, g := range groups { - // UTC needed due to https://github.com/gogo/protobuf/issues/519. - g.LastEvaluation = g.LastEvaluation.UTC() if r.Type == rulespb.RulesRequest_ALL { pgs = append(pgs, g) continue } - filtered := proto.Clone(g).(*rulespb.RuleGroup) + filtered := g.CloneVT() filtered.Rules = nil for _, rule := range g.Rules { if rule.GetAlert() != nil && r.Type == rulespb.RulesRequest_ALERT { diff --git a/pkg/rules/manager_test.go b/pkg/rules/manager_test.go index 114edd5b2f8..c283611e593 100644 --- a/pkg/rules/manager_test.go +++ b/pkg/rules/manager_test.go @@ -30,6 +30,7 @@ import ( "github.com/thanos-io/thanos/pkg/extprom" "github.com/thanos-io/thanos/pkg/runutil" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" ) @@ -105,7 +106,7 @@ groups: return promql.Vector{}, nil } }, - labels.FromStrings("replica", "1"), + labelpb.FromStrings("replica", "1"), "http://localhost", ) testutil.Ok(t, thanosRuleMgr.Update(1*time.Second, []string{filepath.Join(dir, "rule.yaml")})) @@ -199,7 +200,7 @@ groups: return nil, nil } }, - labels.FromStrings("replica", "1"), + labelpb.FromStrings("replica", "1"), "http://localhost", ) err = thanosRuleMgr.Update(10*time.Second, []string{ @@ -346,7 +347,7 @@ func TestManager_Rules(t *testing.T) { return nil, nil } }, - labels.FromStrings("replica", "test1"), + labelpb.FromStrings("replica", "test1"), "http://localhost", ) testutil.Ok(t, thanosRuleMgr.Update(60*time.Second, []string{ @@ -386,7 +387,7 @@ groups: return nil, nil } }, - labels.EmptyLabels(), + labelpb.EmptyLabels(), "http://localhost", ) @@ -444,7 +445,7 @@ groups: }, nil } }, - labels.EmptyLabels(), + labelpb.EmptyLabels(), "http://localhost", ) thanosRuleMgr.Run() diff --git a/pkg/rules/prometheus.go b/pkg/rules/prometheus.go index ab1bd73ad29..77b6096c550 100644 --- a/pkg/rules/prometheus.go +++ b/pkg/rules/prometheus.go @@ -7,8 +7,6 @@ import ( "net/url" "strings" - "github.com/prometheus/prometheus/model/labels" - "github.com/thanos-io/thanos/pkg/promclient" "github.com/thanos-io/thanos/pkg/rules/rulespb" "github.com/thanos-io/thanos/pkg/store/labelpb" @@ -16,14 +14,16 @@ import ( // Prometheus implements rulespb.Rules gRPC that allows to fetch rules from Prometheus HTTP api/v1/rules endpoint. type Prometheus struct { + rulespb.UnimplementedRulesServer + base *url.URL client *promclient.Client - extLabels func() labels.Labels + extLabels func() labelpb.Labels } // NewPrometheus creates new rules.Prometheus. -func NewPrometheus(base *url.URL, client *promclient.Client, extLabels func() labels.Labels) *Prometheus { +func NewPrometheus(base *url.URL, client *promclient.Client, extLabels func() labelpb.Labels) *Prometheus { return &Prometheus{ base: base, client: client, @@ -53,11 +53,15 @@ func (p *Prometheus) Rules(r *rulespb.RulesRequest, s rulespb.Rules_RulesServer) return nil } -// extLset has to be sorted. -func enrichRulesWithExtLabels(groups []*rulespb.RuleGroup, extLset labels.Labels) { +// ext has to be sorted. +func enrichRulesWithExtLabels(groups []*rulespb.RuleGroup, ext labelpb.Labels) { for _, g := range groups { for _, r := range g.Rules { - r.SetLabels(labelpb.ExtendSortedLabels(r.GetLabels(), extLset)) + if rec := r.GetRecording(); rec != nil { + rec.Labels = &labelpb.LabelSet{Labels: labelpb.ExtendSortedLabels(rec.GetLabels().GetLabels(), ext)} + } else if alert := r.GetAlert(); alert != nil { + alert.Labels = &labelpb.LabelSet{Labels: labelpb.ExtendSortedLabels(alert.GetLabels().GetLabels(), ext)} + } } } } diff --git a/pkg/rules/prometheus_test.go b/pkg/rules/prometheus_test.go index 8493e633356..d8e398f6734 100644 --- a/pkg/rules/prometheus_test.go +++ b/pkg/rules/prometheus_test.go @@ -12,10 +12,10 @@ import ( "testing" "github.com/go-kit/log" - "github.com/prometheus/prometheus/model/labels" "github.com/efficientgo/core/testutil" "github.com/thanos-io/thanos/pkg/promclient" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/testutil/e2eutil" ) @@ -42,8 +42,8 @@ rule_files: u, err := url.Parse(fmt.Sprintf("http://%s", p.Addr())) testutil.Ok(t, err) - promRules := NewPrometheus(u, promclient.NewDefaultClient(), func() labels.Labels { - return labels.FromStrings("replica", "test1") + promRules := NewPrometheus(u, promclient.NewDefaultClient(), func() labelpb.Labels { + return labelpb.FromStrings("replica", "test1") }) testRulesAgainstExamples(t, filepath.Join(root, "examples/alerts"), promRules, true) } diff --git a/pkg/rules/proxy.go b/pkg/rules/proxy.go index 8f4451c3b00..5bf5ff0291c 100644 --- a/pkg/rules/proxy.go +++ b/pkg/rules/proxy.go @@ -22,6 +22,8 @@ import ( // Proxy implements rulespb.Rules gRPC that fanouts requests to given rulespb.Rules and deduplication on the way. type Proxy struct { + rulespb.UnimplementedRulesServer + logger log.Logger rules func() []rulespb.RulesClient } diff --git a/pkg/rules/rules.go b/pkg/rules/rules.go index f0ca6997071..a30aab1d225 100644 --- a/pkg/rules/rules.go +++ b/pkg/rules/rules.go @@ -16,6 +16,7 @@ import ( "github.com/thanos-io/thanos/pkg/extpromql" "github.com/thanos-io/thanos/pkg/rules/rulespb" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/tracing" ) @@ -142,8 +143,7 @@ func filterRulesByMatchers(ruleGroups []*rulespb.RuleGroup, matcherSets [][]*lab ruleCount := 0 for _, r := range g.Rules { // Filter rules based on matcher. - rl := r.GetLabels() - if matches(matcherSets, rl) { + if matches(matcherSets, r.GetLabels()) { g.Rules[ruleCount] = r ruleCount++ } @@ -162,25 +162,24 @@ func filterRulesByMatchers(ruleGroups []*rulespb.RuleGroup, matcherSets [][]*lab } // matches returns whether the non-templated labels satisfy all the matchers in matcherSets. -func matches(matcherSets [][]*labels.Matcher, l labels.Labels) bool { +func matches(matcherSets [][]*labels.Matcher, l labelpb.Labels) bool { if len(matcherSets) == 0 { return true } - b := labels.NewBuilder(labels.EmptyLabels()) labelTemplate := template.New("label") - l.Range(func(label labels.Label) { + nonTemplated := make(labelpb.Labels, 0, len(l)) + for _, label := range l { t, err := labelTemplate.Parse(label.Value) // Label value is non-templated if it is one node of type NodeText. if err == nil && len(t.Root.Nodes) == 1 && t.Root.Nodes[0].Type() == parse.NodeText { - b.Set(label.Name, label.Value) + nonTemplated = append(nonTemplated, label) } - }) - nonTemplatedLabels := b.Labels() + } for _, matchers := range matcherSets { for _, m := range matchers { - if v := nonTemplatedLabels.Get(m.Name); !m.Matches(v) { + if v := nonTemplated.Get(m.Name); !m.Matches(v) { return false } } @@ -236,11 +235,14 @@ func dedupRules(rules []*rulespb.Rule, replicaLabels map[string]struct{}) []*rul } func removeReplicaLabels(r *rulespb.Rule, replicaLabels map[string]struct{}) { - b := labels.NewBuilder(r.GetLabels()) - for k := range replicaLabels { - b.Del(k) + ls := r.GetLabels() + filtered := make(labelpb.Labels, 0, len(ls)) + for _, l := range ls { + if _, ok := replicaLabels[l.Name]; !ok { + filtered = append(filtered, l) + } } - r.SetLabels(b.Labels()) + r.SetLabels(filtered) } func dedupGroups(groups []*rulespb.RuleGroup) []*rulespb.RuleGroup { diff --git a/pkg/rules/rules_test.go b/pkg/rules/rules_test.go index c4b3a5c7604..a73da8fdcff 100644 --- a/pkg/rules/rules_test.go +++ b/pkg/rules/rules_test.go @@ -11,14 +11,15 @@ import ( "time" "golang.org/x/exp/slices" + "google.golang.org/protobuf/types/known/timestamppb" "github.com/efficientgo/core/testutil" - "github.com/gogo/protobuf/proto" "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/util/annotations" "github.com/thanos-io/thanos/pkg/rules/rulespb" "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" + thanostestutil "github.com/thanos-io/thanos/pkg/testutil" "github.com/thanos-io/thanos/pkg/testutil/custom" ) @@ -166,7 +167,7 @@ func testRulesAgainstExamples(t *testing.T, dir string, server rulespb.RulesServ if tcase.requestedType != rulespb.RulesRequest_ALL { expectedForType = make([]*rulespb.RuleGroup, len(expected)) for i, g := range expected { - expectedForType[i] = proto.Clone(g).(*rulespb.RuleGroup) + expectedForType[i] = g.CloneVT() expectedForType[i].Rules = nil for _, r := range g.Rules { @@ -212,13 +213,13 @@ func testRulesAgainstExamples(t *testing.T, dir string, server rulespb.RulesServ } // Mask nondeterministic fields. got[i].EvaluationDurationSeconds = 0 - got[i].LastEvaluation = time.Time{} + got[i].LastEvaluation = nil t.Run(got[i].Name+" "+path.Base(got[i].File), func(t *testing.T) { - testutil.Equals(t, expectedForType[i], got[i]) + thanostestutil.ProtoEquals(t, expectedForType[i], got[i]) }) } - testutil.Equals(t, expectedForType, got) + thanostestutil.ProtoEquals(t, expectedForType, got) }) } } @@ -285,156 +286,108 @@ func TestDedupRules(t *testing.T) { name: "rule labels", rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("a", "1")}), }, want: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("a", "1")}), }, }, { name: "rule expression", rules: []*rulespb.Rule{ rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "a1", - Query: "up", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", + Query: "up", + Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "a1", - Query: "up", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", + Query: "up", + Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Query: "up", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", + Query: "up", + Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Query: "up", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", + Query: "up", + Labels: labelpb.LabelSetFromStrings("a", "1")}), }, want: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Query: "up", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", + Query: "up", + Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "a1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "a1", - Query: "up", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", + Query: "up", + Labels: labelpb.LabelSetFromStrings("a", "1")}), }, }, { name: "alert duration", rules: []*rulespb.Rule{ rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "a1", - Query: "up", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", + Query: "up", + Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "a1", - Query: "up", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", + Query: "up", + Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewAlertingRule(&rulespb.Alert{ Name: "a1", Query: "up", DurationSeconds: 1.0, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewAlertingRule(&rulespb.Alert{ Name: "a1", Query: "up", DurationSeconds: 1.0, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewAlertingRule(&rulespb.Alert{ Name: "a1", Query: "up", DurationSeconds: 2.0, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Labels: labelpb.LabelSetFromStrings("a", "1")}), }, want: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ Name: "a1", Query: "up", DurationSeconds: 1.0, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewAlertingRule(&rulespb.Alert{ Name: "a1", Query: "up", DurationSeconds: 2.0, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "a1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "a1", Query: "up", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a1", Query: "up", Labels: labelpb.LabelSetFromStrings("a", "1")}), }, }, { @@ -444,86 +397,51 @@ func TestDedupRules(t *testing.T) { Name: "a1", Query: "up", DurationSeconds: 1.0, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - {Name: "replica", Value: "1"}, - }}}), + Labels: labelpb.LabelSetFromStrings("a", "1", "replica", "1")}), rulespb.NewAlertingRule(&rulespb.Alert{ Name: "a1", Query: "up", DurationSeconds: 2.0, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Labels: labelpb.LabelSetFromStrings("a", "1")}), }, want: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ Name: "a1", Query: "up", DurationSeconds: 1.0, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Labels: labelpb.LabelSetFromStrings("a", "1")}), rulespb.NewAlertingRule(&rulespb.Alert{ Name: "a1", Query: "up", DurationSeconds: 2.0, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Labels: labelpb.LabelSetFromStrings("a", "1")}), }, replicaLabels: []string{"replica"}, }, { name: "replica labels", rules: []*rulespb.Rule{ - rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - {Name: "replica", Value: "3"}, - }}}), - rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - {Name: "replica", Value: "1"}, - }}}), - rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - {Name: "replica", Value: "2"}, - }}}), + rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.LabelSetFromStrings("a", "1", "replica", "3")}), + rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.LabelSetFromStrings("a", "1", "replica", "1")}), + rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.LabelSetFromStrings("a", "1", "replica", "2")}), }, want: []*rulespb.Rule{ - rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.LabelSetFromStrings("a", "1")}), }, replicaLabels: []string{"replica"}, }, { name: "ambiguous replica labels", rules: []*rulespb.Rule{ - rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - {Name: "a", Value: "1"}, - }}}), - rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - }}}), - rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - {Name: "a", Value: "2"}, - }}}), - rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - {Name: "a", Value: "1"}, - }}}), + rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.LabelSetFromStrings("replica", "1", "a", "1")}), + rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.LabelSetFromStrings("replica", "1")}), + rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.LabelSetFromStrings("replica", "1", "a", "2")}), + rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.LabelSetFromStrings("replica", "1", "a", "1")}), }, want: []*rulespb.Rule{ rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1"}), - rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), - rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "2"}, - }}}), + rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.LabelSetFromStrings("a", "1")}), + rulespb.NewRecordingRule(&rulespb.RecordingRule{Name: "a1", Labels: labelpb.LabelSetFromStrings("a", "2")}), }, replicaLabels: []string{"replica"}, }, @@ -531,40 +449,34 @@ func TestDedupRules(t *testing.T) { name: "youngest recording rule", rules: []*rulespb.Rule{ rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "a1", - Query: "up", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "2"}, - }}, - LastEvaluation: time.Unix(0, 0), + Name: "a1", + Query: "up", + Labels: labelpb.LabelSetFromStrings("replica", "2"), + LastEvaluation: timestamppb.New(time.Unix(0, 0)), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "a1", - Query: "up", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - }}, - LastEvaluation: time.Unix(1, 0), + Name: "a1", + Query: "up", + Labels: labelpb.LabelSetFromStrings("replica", "1"), + LastEvaluation: timestamppb.New(time.Unix(1, 0)), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "a1", - Query: "up", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "3"}, - }}, - LastEvaluation: time.Unix(3, 0), + Name: "a1", + Query: "up", + Labels: labelpb.LabelSetFromStrings("replica", "3"), + LastEvaluation: timestamppb.New(time.Unix(3, 0)), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ Name: "a1", Query: "up", - LastEvaluation: time.Unix(2, 0), + LastEvaluation: timestamppb.New(time.Unix(2, 0)), }), }, want: []*rulespb.Rule{ rulespb.NewRecordingRule(&rulespb.RecordingRule{ Name: "a1", Query: "up", - LastEvaluation: time.Unix(3, 0), + LastEvaluation: timestamppb.New(time.Unix(3, 0)), }), }, replicaLabels: []string{"replica"}, @@ -573,75 +485,60 @@ func TestDedupRules(t *testing.T) { name: "youngest firing alert", rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "2"}, - }}, - LastEvaluation: time.Unix(4, 0), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "2"), + LastEvaluation: timestamppb.New(time.Unix(4, 0)), }), rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "2"}, - {Name: "foo", Value: "bar"}, - }}, - LastEvaluation: time.Unix(2, 0), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "2", "foo", "bar"), + LastEvaluation: timestamppb.New(time.Unix(2, 0)), }), rulespb.NewAlertingRule(&rulespb.Alert{ Name: "a2", - LastEvaluation: time.Unix(2, 0), + LastEvaluation: timestamppb.New(time.Unix(2, 0)), State: rulespb.AlertState_PENDING, }), rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - }}, - LastEvaluation: time.Unix(3, 0), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "1"), + LastEvaluation: timestamppb.New(time.Unix(3, 0)), }), rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a2", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - }}, - LastEvaluation: time.Unix(3, 0), + Name: "a2", + Labels: labelpb.LabelSetFromStrings("replica", "1"), + LastEvaluation: timestamppb.New(time.Unix(3, 0)), State: rulespb.AlertState_PENDING, }), rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "3"}, - }}, - LastEvaluation: time.Unix(2, 0), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "3"), + LastEvaluation: timestamppb.New(time.Unix(2, 0)), State: rulespb.AlertState_FIRING, }), rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "foo", Value: "bar"}, - }}, + Name: "a1", + Labels: labelpb.LabelSetFromStrings("foo", "bar"), State: rulespb.AlertState_FIRING, - LastEvaluation: time.Unix(1, 0), + LastEvaluation: timestamppb.New(time.Unix(1, 0)), }), }, want: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ State: rulespb.AlertState_FIRING, Name: "a1", - LastEvaluation: time.Unix(2, 0), + LastEvaluation: timestamppb.New(time.Unix(2, 0)), }), rulespb.NewAlertingRule(&rulespb.Alert{ - State: rulespb.AlertState_FIRING, - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "foo", Value: "bar"}, - }}, - LastEvaluation: time.Unix(1, 0), + State: rulespb.AlertState_FIRING, + Name: "a1", + Labels: labelpb.LabelSetFromStrings("foo", "bar"), + LastEvaluation: timestamppb.New(time.Unix(1, 0)), }), rulespb.NewAlertingRule(&rulespb.Alert{ State: rulespb.AlertState_PENDING, Name: "a2", - LastEvaluation: time.Unix(3, 0), + LastEvaluation: timestamppb.New(time.Unix(3, 0)), }), }, replicaLabels: []string{"replica"}, @@ -650,52 +547,36 @@ func TestDedupRules(t *testing.T) { name: "alerts with different severity", rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - {Name: "severity", Value: "warning"}, - }}, - LastEvaluation: time.Unix(1, 0), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "1", "severity", "warning"), + LastEvaluation: timestamppb.New(time.Unix(1, 0)), }), rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - {Name: "severity", Value: "critical"}, - }}, - LastEvaluation: time.Unix(1, 0), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "1", "severity", "critical"), + LastEvaluation: timestamppb.New(time.Unix(1, 0)), }), rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "2"}, - {Name: "severity", Value: "warning"}, - }}, - LastEvaluation: time.Unix(1, 0), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "2", "severity", "warning"), + LastEvaluation: timestamppb.New(time.Unix(1, 0)), }), rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "2"}, - {Name: "severity", Value: "critical"}, - }}, - LastEvaluation: time.Unix(1, 0), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "2", "severity", "critical"), + LastEvaluation: timestamppb.New(time.Unix(1, 0)), }), }, want: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "severity", Value: "critical"}, - }}, - LastEvaluation: time.Unix(1, 0), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("severity", "critical"), + LastEvaluation: timestamppb.New(time.Unix(1, 0)), }), rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "severity", Value: "warning"}, - }}, - LastEvaluation: time.Unix(1, 0), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("severity", "warning"), + LastEvaluation: timestamppb.New(time.Unix(1, 0)), }), }, replicaLabels: []string{"replica"}, @@ -704,36 +585,26 @@ func TestDedupRules(t *testing.T) { name: "alerts with missing replica labels", rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - {Name: "label", Value: "foo"}, - }}, - LastEvaluation: time.Unix(1, 0), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "1", "label", "foo"), + LastEvaluation: timestamppb.New(time.Unix(1, 0)), }), rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "2"}, - {Name: "label", Value: "foo"}, - }}, - LastEvaluation: time.Unix(1, 0), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "2", "label", "foo"), + LastEvaluation: timestamppb.New(time.Unix(1, 0)), }), rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, - LastEvaluation: time.Unix(1, 0), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("label", "foo"), + LastEvaluation: timestamppb.New(time.Unix(1, 0)), }), }, want: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, - LastEvaluation: time.Unix(1, 0), + Name: "a1", + Labels: labelpb.LabelSetFromStrings("label", "foo"), + LastEvaluation: timestamppb.New(time.Unix(1, 0)), }), }, replicaLabels: []string{"replica"}, @@ -744,7 +615,7 @@ func TestDedupRules(t *testing.T) { for _, lbl := range tc.replicaLabels { replicaLabels[lbl] = struct{}{} } - testutil.Equals(t, tc.want, dedupRules(tc.rules, replicaLabels)) + thanostestutil.ProtoEquals(t, tc.want, dedupRules(tc.rules, replicaLabels)) }) } } @@ -961,7 +832,7 @@ func TestDedupGroups(t *testing.T) { } { t.Run(tc.name, func(t *testing.T) { t.Run(tc.name, func(t *testing.T) { - testutil.Equals(t, tc.want, dedupGroups(tc.groups)) + thanostestutil.ProtoEquals(t, tc.want, dedupGroups(tc.groups)) }) }) } @@ -1008,21 +879,14 @@ func TestFilterRules(t *testing.T) { Name: "a", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - {Name: "label", Value: "foo"}, - }}, + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "1", "label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "r1", Labels: labelpb.LabelSetFromStrings("label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r2", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "otherlabel", Value: "bar"}, - }}, + Name: "r2", Labels: labelpb.LabelSetFromStrings("otherlabel", "bar"), }), }, }, @@ -1032,21 +896,14 @@ func TestFilterRules(t *testing.T) { Name: "a", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - {Name: "label", Value: "foo"}, - }}, + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "1", "label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "r1", Labels: labelpb.LabelSetFromStrings("label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r2", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "otherlabel", Value: "bar"}, - }}, + Name: "r2", Labels: labelpb.LabelSetFromStrings("otherlabel", "bar"), }), }, }, @@ -1060,21 +917,14 @@ func TestFilterRules(t *testing.T) { Name: "a", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - {Name: "label", Value: "foo"}, - }}, + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "1", "label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "r1", Labels: labelpb.LabelSetFromStrings("label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r2", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "otherlabel", Value: "bar"}, - }}, + Name: "r2", Labels: labelpb.LabelSetFromStrings("otherlabel", "bar"), }), }, }, @@ -1084,16 +934,11 @@ func TestFilterRules(t *testing.T) { Name: "a", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - {Name: "label", Value: "foo"}, - }}, + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "1", "label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "r1", Labels: labelpb.LabelSetFromStrings("label", "foo"), }), }, }, @@ -1107,21 +952,14 @@ func TestFilterRules(t *testing.T) { Name: "a", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - {Name: "label", Value: "foo"}, - }}, + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "1", "label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "r1", Labels: labelpb.LabelSetFromStrings("label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r2", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "otherlabel", Value: "bar"}, - }}, + Name: "r2", Labels: labelpb.LabelSetFromStrings("otherlabel", "bar"), }), }, }, @@ -1136,17 +974,12 @@ func TestFilterRules(t *testing.T) { Name: "a", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - {Name: "templatedlabel", Value: "{{ $externalURL }}"}, - }}, + Name: "a1", + Labels: labelpb.LabelSetFromStrings("label", "foo", "templatedlabel", "{{ $externalURL }}"), }), rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a2", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "a2", + Labels: labelpb.LabelSetFromStrings("label", "foo"), }), }, }, @@ -1161,20 +994,14 @@ func TestFilterRules(t *testing.T) { Name: "a", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1a", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "a1a", + Labels: labelpb.LabelSetFromStrings("label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1a", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "r1a", Labels: labelpb.LabelSetFromStrings("label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1b", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "otherlabel", Value: "bar"}, - }}, + Name: "r1b", Labels: labelpb.LabelSetFromStrings("otherlabel", "bar"), }), }, }, @@ -1182,15 +1009,11 @@ func TestFilterRules(t *testing.T) { Name: "b", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1b", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "some", Value: "label"}, - }}, + Name: "a1b", + Labels: labelpb.LabelSetFromStrings("some", "label"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1b", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "r1b", Labels: labelpb.LabelSetFromStrings("label", "foo"), }), }, }, @@ -1200,15 +1023,11 @@ func TestFilterRules(t *testing.T) { Name: "a", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1a", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "a1a", + Labels: labelpb.LabelSetFromStrings("label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1a", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "r1a", Labels: labelpb.LabelSetFromStrings("label", "foo"), }), }, }, @@ -1216,9 +1035,7 @@ func TestFilterRules(t *testing.T) { Name: "b", Rules: []*rulespb.Rule{ rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1b", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "r1b", Labels: labelpb.LabelSetFromStrings("label", "foo"), }), }, }, @@ -1232,20 +1049,14 @@ func TestFilterRules(t *testing.T) { Name: "a", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1a", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "a1a", + Labels: labelpb.LabelSetFromStrings("label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1a", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "r1a", Labels: labelpb.LabelSetFromStrings("label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1b", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "otherlabel", Value: "bar"}, - }}, + Name: "r1b", Labels: labelpb.LabelSetFromStrings("otherlabel", "bar"), }), }, }, @@ -1253,15 +1064,11 @@ func TestFilterRules(t *testing.T) { Name: "b", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1b", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "some", Value: "label"}, - }}, + Name: "a1b", + Labels: labelpb.LabelSetFromStrings("some", "label"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1b", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "r1b", Labels: labelpb.LabelSetFromStrings("label", "foo"), }), }, }, @@ -1276,10 +1083,8 @@ func TestFilterRules(t *testing.T) { Name: "a", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1a", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "templatedlabel", Value: "{{ $externalURL }}"}, - }}, + Name: "a1a", + Labels: labelpb.LabelSetFromStrings("templatedlabel", "{{ $externalURL }}"), }), }, }, @@ -1287,10 +1092,8 @@ func TestFilterRules(t *testing.T) { Name: "b", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1b", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "templated", Value: "{{ $externalURL }}"}, - }}, + Name: "a1b", + Labels: labelpb.LabelSetFromStrings("templated", "{{ $externalURL }}"), }), }, }, @@ -1305,10 +1108,8 @@ func TestFilterRules(t *testing.T) { Name: "a", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1a", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "templatedlabel", Value: "{{ $externalURL }}"}, - }}, + Name: "a1a", + Labels: labelpb.LabelSetFromStrings("templatedlabel", "{{ $externalURL }}"), }), }, }, @@ -1316,10 +1117,8 @@ func TestFilterRules(t *testing.T) { Name: "b", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1b", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "templated", Value: "{{ $externalURL }}"}, - }}, + Name: "a1b", + Labels: labelpb.LabelSetFromStrings("templated", "{{ $externalURL }}"), }), }, }, @@ -1334,20 +1133,14 @@ func TestFilterRules(t *testing.T) { Name: "a", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1a", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "a1a", + Labels: labelpb.LabelSetFromStrings("label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1a", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "r1a", Labels: labelpb.LabelSetFromStrings("label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1b", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "otherlabel", Value: "bar"}, - }}, + Name: "r1b", Labels: labelpb.LabelSetFromStrings("otherlabel", "bar"), }), }, }, @@ -1355,15 +1148,11 @@ func TestFilterRules(t *testing.T) { Name: "b", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1b", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "some", Value: "label"}, - }}, + Name: "a1b", + Labels: labelpb.LabelSetFromStrings("some", "label"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1b", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "r1b", Labels: labelpb.LabelSetFromStrings("label", "foo"), }), }, }, @@ -1373,15 +1162,11 @@ func TestFilterRules(t *testing.T) { Name: "a", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1a", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "a1a", + Labels: labelpb.LabelSetFromStrings("label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1a", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "r1a", Labels: labelpb.LabelSetFromStrings("label", "foo"), }), }, }, @@ -1389,9 +1174,7 @@ func TestFilterRules(t *testing.T) { Name: "b", Rules: []*rulespb.Rule{ rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1b", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "r1b", Labels: labelpb.LabelSetFromStrings("label", "foo"), }), }, }, @@ -1405,21 +1188,14 @@ func TestFilterRules(t *testing.T) { Name: "a", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - {Name: "label", Value: "foo"}, - }}, + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "1", "label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "r1", Labels: labelpb.LabelSetFromStrings("label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r2", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "otherlabel", Value: "bar"}, - }}, + Name: "r2", Labels: labelpb.LabelSetFromStrings("otherlabel", "bar"), }), }, }, @@ -1429,11 +1205,8 @@ func TestFilterRules(t *testing.T) { Name: "a", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - {Name: "label", Value: "foo"}, - }}, + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "1", "label", "foo"), }), }, }, @@ -1660,21 +1433,14 @@ func TestFilterRules(t *testing.T) { Name: "a", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - {Name: "label", Value: "foo"}, - }}, + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "1", "label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "label", Value: "foo"}, - }}, + Name: "r1", Labels: labelpb.LabelSetFromStrings("label", "foo"), }), rulespb.NewRecordingRule(&rulespb.RecordingRule{ - Name: "r2", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "otherlabel", Value: "bar"}, - }}, + Name: "r2", Labels: labelpb.LabelSetFromStrings("otherlabel", "bar"), }), }, }, @@ -1684,11 +1450,8 @@ func TestFilterRules(t *testing.T) { Name: "a", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "a1", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "replica", Value: "1"}, - {Name: "label", Value: "foo"}, - }}, + Name: "a1", + Labels: labelpb.LabelSetFromStrings("replica", "1", "label", "foo"), }), }, }, @@ -1698,7 +1461,7 @@ func TestFilterRules(t *testing.T) { t.Run(tc.name, func(t *testing.T) { groups := filterRulesByMatchers(tc.groups, tc.matcherSets) groups = filterRulesByNamesAndFile(groups, tc.ruleNameFilter, tc.ruleGroupFilter, tc.fileFilter) - testutil.Equals(t, tc.want, groups) + thanostestutil.ProtoEquals(t, tc.want, groups) }) } } diff --git a/pkg/rules/rulespb/custom.go b/pkg/rules/rulespb/custom.go index 5e405b2e864..f71ce434256 100644 --- a/pkg/rules/rulespb/custom.go +++ b/pkg/rules/rulespb/custom.go @@ -11,9 +11,8 @@ import ( "time" "github.com/pkg/errors" - "github.com/prometheus/prometheus/model/labels" - "github.com/thanos-io/thanos/pkg/store/labelpb" + "google.golang.org/protobuf/types/known/timestamppb" ) const ( @@ -55,11 +54,11 @@ func NewRecordingRule(r *RecordingRule) *Rule { // // Note: This method assumes r1 and r2 are logically equal as per Rule#Compare. func (r1 *RecordingRule) Compare(r2 *RecordingRule) int { - if r1.LastEvaluation.Before(r2.LastEvaluation) { + t1, t2 := r1.LastEvaluation.AsTime(), r2.LastEvaluation.AsTime() + if t1.Before(t2) { return 1 } - - if r1.LastEvaluation.After(r2.LastEvaluation) { + if t1.After(t2) { return -1 } @@ -72,60 +71,59 @@ func NewAlertingRule(a *Alert) *Rule { } } -func (r *Rule) GetLabels() labels.Labels { - switch { - case r.GetRecording() != nil: - return r.GetRecording().Labels.PromLabels() - case r.GetAlert() != nil: - return r.GetAlert().Labels.PromLabels() +func (r *Rule) GetLabels() labelpb.Labels { + switch v := r.Result.(type) { + case *Rule_Recording: + return v.Recording.GetLabels().GetLabels() + case *Rule_Alert: + return v.Alert.GetLabels().GetLabels() default: - return labels.EmptyLabels() + return nil } } -func (r *Rule) SetLabels(ls labels.Labels) { - var result labelpb.ZLabelSet - - if !ls.IsEmpty() { - result = labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(ls)} +func (r *Rule) SetLabels(ls labelpb.Labels) { + var result *labelpb.LabelSet + if len(ls) > 0 { + result = &labelpb.LabelSet{Labels: ls} } - switch { - case r.GetRecording() != nil: - r.GetRecording().Labels = result - case r.GetAlert() != nil: - r.GetAlert().Labels = result + switch v := r.Result.(type) { + case *Rule_Recording: + v.Recording.Labels = result + case *Rule_Alert: + v.Alert.Labels = result } } func (r *Rule) GetName() string { - switch { - case r.GetRecording() != nil: - return r.GetRecording().Name - case r.GetAlert() != nil: - return r.GetAlert().Name + switch v := r.Result.(type) { + case *Rule_Recording: + return v.Recording.Name + case *Rule_Alert: + return v.Alert.Name default: return "" } } func (r *Rule) GetQuery() string { - switch { - case r.GetRecording() != nil: - return r.GetRecording().Query - case r.GetAlert() != nil: - return r.GetAlert().Query + switch v := r.Result.(type) { + case *Rule_Recording: + return v.Recording.Query + case *Rule_Alert: + return v.Alert.Query default: return "" } } func (r *Rule) GetLastEvaluation() time.Time { - switch { - case r.GetRecording() != nil: - return r.GetRecording().LastEvaluation - case r.GetAlert() != nil: - return r.GetAlert().LastEvaluation + switch v := r.Result.(type) { + case *Rule_Recording: + return v.Recording.GetLastEvaluation().AsTime() + case *Rule_Alert: + return v.Alert.GetLastEvaluation().AsTime() default: return time.Time{} } @@ -148,11 +146,12 @@ func (r *Rule) GetLastEvaluation() time.Time { // Note: this can still leave ordering undetermined for equal rules (x == y). // For determining ordering of equal rules, use Alert#Compare or RecordingRule#Compare. func (r1 *Rule) Compare(r2 *Rule) int { - if r1.GetAlert() != nil && r2.GetRecording() != nil { - return -1 - } - - if r1.GetRecording() != nil && r2.GetAlert() != nil { + _, r1IsAlert := r1.Result.(*Rule_Alert) + _, r2IsAlert := r2.Result.(*Rule_Alert) + if r1IsAlert != r2IsAlert { + if r1IsAlert { + return -1 + } return 1 } @@ -160,7 +159,7 @@ func (r1 *Rule) Compare(r2 *Rule) int { return d } - if d := labels.Compare(r1.GetLabels(), r2.GetLabels()); d != 0 { + if d := labelpb.Compare(r1.GetLabels(), r2.GetLabels()); d != 0 { return d } @@ -168,7 +167,7 @@ func (r1 *Rule) Compare(r2 *Rule) int { return d } - if r1.GetAlert() != nil && r2.GetAlert() != nil { + if r1IsAlert { // we already asserted that the rules are the same type if d := big.NewFloat(r1.GetAlert().DurationSeconds).Cmp(big.NewFloat(r2.GetAlert().DurationSeconds)); d != 0 { return d } @@ -236,37 +235,249 @@ func (m *Rule) UnmarshalJSON(entry []byte) error { return nil } +// MarshalJSON is required to maintain backward compatibility with the previous +// gogo-proto generated code. Gogo generated timestamp fields as time.Time, +// which marshals to RFC 3339 strings like "2026-02-26T12:00:00Z". The new +// proto-generated *timestamppb.Timestamp marshals as {"seconds":N, "nanos":N}. +// This method shadows timestamp fields with time.Time to preserve the expected +// JSON format. It also uses type aliases to avoid recursion with the custom +// MarshalJSON methods on RecordingRule and Alert. func (m *Rule) MarshalJSON() ([]byte, error) { if r := m.GetRecording(); r != nil { + // Ensure nil pointer fields serialize as {} instead of null for JSON backward compatibility. + if r.Labels == nil { + r.Labels = &labelpb.LabelSet{} + } + type RecAlias RecordingRule return json.Marshal(struct { - *RecordingRule - Type string `json:"type"` + *RecAlias + LastEvaluation time.Time `json:"lastEvaluation"` + Type string `json:"type"` }{ - RecordingRule: r, - Type: RuleRecordingType, + RecAlias: (*RecAlias)(r), + LastEvaluation: timestampToTime(r.LastEvaluation), + Type: RuleRecordingType, }) } a := m.GetAlert() if a.Alerts == nil { - // Ensure that empty slices are marshaled as '[]' and not 'null'. a.Alerts = make([]*AlertInstance, 0) } + // Ensure nil pointer fields serialize as {} instead of null for JSON backward compatibility. + if a.Labels == nil { + a.Labels = &labelpb.LabelSet{} + } + if a.Annotations == nil { + a.Annotations = &labelpb.LabelSet{} + } + type AlertAlias Alert return json.Marshal(struct { - *Alert - Type string `json:"type"` + *AlertAlias + LastEvaluation time.Time `json:"lastEvaluation"` + Type string `json:"type"` }{ - Alert: a, - Type: RuleAlertingType, + AlertAlias: (*AlertAlias)(a), + LastEvaluation: timestampToTime(a.LastEvaluation), + Type: RuleAlertingType, }) } +// MarshalJSON is required to maintain backward compatibility with the previous +// gogo-proto generated code. Gogo generated timestamp fields as time.Time, +// which marshals to RFC 3339 strings like "2026-02-26T12:00:00Z". The new +// proto-generated *timestamppb.Timestamp marshals as {"seconds":N, "nanos":N}. +// This method shadows timestamp fields with time.Time to preserve the expected +// JSON format. func (r *RuleGroup) MarshalJSON() ([]byte, error) { if r.Rules == nil { - // Ensure that empty slices are marshaled as '[]' and not 'null'. r.Rules = make([]*Rule, 0) } - type plain RuleGroup - return json.Marshal((*plain)(r)) + type Alias RuleGroup + return json.Marshal(&struct { + *Alias + LastEvaluation time.Time `json:"lastEvaluation"` + }{ + Alias: (*Alias)(r), + LastEvaluation: timestampToTime(r.LastEvaluation), + }) +} + +// UnmarshalJSON is required to maintain backward compatibility with the previous +// gogo-proto generated code. Gogo generated timestamp fields as time.Time, +// which unmarshals from RFC 3339 strings like "2026-02-26T12:00:00Z". The new +// proto-generated *timestamppb.Timestamp expects {"seconds":N, "nanos":N}. +// This method shadows timestamp fields with time.Time to accept the expected +// JSON format. +func (r *RuleGroup) UnmarshalJSON(data []byte) error { + type Alias RuleGroup + aux := &struct { + *Alias + LastEvaluation time.Time `json:"lastEvaluation"` + }{ + Alias: (*Alias)(r), + } + if err := json.Unmarshal(data, aux); err != nil { + return err + } + r.LastEvaluation = timeToTimestamp(aux.LastEvaluation) + return nil +} + +func timeToTimestamp(t time.Time) *timestamppb.Timestamp { + if t.IsZero() { + return nil + } + return timestamppb.New(t) +} + +func timestampToTime(ts *timestamppb.Timestamp) time.Time { + if ts == nil { + return time.Time{} + } + return ts.AsTime() +} + +// MarshalJSON is required to maintain backward compatibility with the previous +// gogo-proto generated code. Gogo generated timestamp fields as time.Time, +// which marshals to RFC 3339 strings like "2026-02-26T12:00:00Z". The new +// proto-generated *timestamppb.Timestamp marshals as {"seconds":N, "nanos":N}. +// This method shadows timestamp fields with time.Time to preserve the expected +// JSON format. +func (r *RecordingRule) MarshalJSON() ([]byte, error) { + // Ensure nil pointer fields serialize as {} instead of null for JSON backward compatibility. + if r.Labels == nil { + r.Labels = &labelpb.LabelSet{} + } + type Alias RecordingRule + return json.Marshal(&struct { + *Alias + LastEvaluation time.Time `json:"lastEvaluation"` + }{ + Alias: (*Alias)(r), + LastEvaluation: timestampToTime(r.LastEvaluation), + }) +} + +// UnmarshalJSON is required to maintain backward compatibility with the previous +// gogo-proto generated code. Gogo generated timestamp fields as time.Time, +// which unmarshals from RFC 3339 strings like "2026-02-26T12:00:00Z". The new +// proto-generated *timestamppb.Timestamp expects {"seconds":N, "nanos":N}. +// This method shadows timestamp fields with time.Time to accept the expected +// JSON format. +func (r *RecordingRule) UnmarshalJSON(data []byte) error { + type Alias RecordingRule + aux := &struct { + *Alias + LastEvaluation time.Time `json:"lastEvaluation"` + }{ + Alias: (*Alias)(r), + } + if err := json.Unmarshal(data, aux); err != nil { + return err + } + r.LastEvaluation = timeToTimestamp(aux.LastEvaluation) + return nil +} + +// MarshalJSON is required to maintain backward compatibility with the previous +// gogo-proto generated code. Gogo generated timestamp fields as time.Time, +// which marshals to RFC 3339 strings like "2026-02-26T12:00:00Z". The new +// proto-generated *timestamppb.Timestamp marshals as {"seconds":N, "nanos":N}. +// This method shadows timestamp fields with time.Time to preserve the expected +// JSON format. +func (a *Alert) MarshalJSON() ([]byte, error) { + if a.Alerts == nil { + a.Alerts = make([]*AlertInstance, 0) + } + // Ensure nil pointer fields serialize as {} instead of null for JSON backward compatibility. + if a.Labels == nil { + a.Labels = &labelpb.LabelSet{} + } + if a.Annotations == nil { + a.Annotations = &labelpb.LabelSet{} + } + type Alias Alert + return json.Marshal(&struct { + *Alias + LastEvaluation time.Time `json:"lastEvaluation"` + }{ + Alias: (*Alias)(a), + LastEvaluation: timestampToTime(a.LastEvaluation), + }) +} + +// UnmarshalJSON is required to maintain backward compatibility with the previous +// gogo-proto generated code. Gogo generated timestamp fields as time.Time, +// which unmarshals from RFC 3339 strings like "2026-02-26T12:00:00Z". The new +// proto-generated *timestamppb.Timestamp expects {"seconds":N, "nanos":N}. +// This method shadows timestamp fields with time.Time to accept the expected +// JSON format. +func (a *Alert) UnmarshalJSON(data []byte) error { + type Alias Alert + aux := &struct { + *Alias + LastEvaluation time.Time `json:"lastEvaluation"` + }{ + Alias: (*Alias)(a), + } + if err := json.Unmarshal(data, aux); err != nil { + return err + } + a.LastEvaluation = timeToTimestamp(aux.LastEvaluation) + return nil +} + +// MarshalJSON is required to maintain backward compatibility with the previous +// gogo-proto generated code. Gogo generated timestamp fields as time.Time, +// which marshals to RFC 3339 strings like "2026-02-26T12:00:00Z". The new +// proto-generated *timestamppb.Timestamp marshals as {"seconds":N, "nanos":N}. +// This method shadows timestamp fields with time.Time to preserve the expected +// JSON format. +func (ai *AlertInstance) MarshalJSON() ([]byte, error) { + // Ensure nil pointer fields serialize as {} instead of null for JSON backward compatibility. + if ai.Labels == nil { + ai.Labels = &labelpb.LabelSet{} + } + if ai.Annotations == nil { + ai.Annotations = &labelpb.LabelSet{} + } + type Alias AlertInstance + return json.Marshal(&struct { + *Alias + ActiveAt *time.Time `json:"activeAt,omitempty"` + }{ + Alias: (*Alias)(ai), + ActiveAt: func() *time.Time { + if ai.ActiveAt == nil { + return nil + } + t := ai.ActiveAt.AsTime() + return &t + }(), + }) +} + +// UnmarshalJSON is required to maintain backward compatibility with the previous +// gogo-proto generated code. Gogo generated timestamp fields as time.Time, +// which unmarshals from RFC 3339 strings like "2026-02-26T12:00:00Z". The new +// proto-generated *timestamppb.Timestamp expects {"seconds":N, "nanos":N}. +// This method shadows timestamp fields with time.Time to accept the expected +// JSON format. +func (ai *AlertInstance) UnmarshalJSON(data []byte) error { + type Alias AlertInstance + aux := &struct { + *Alias + ActiveAt *time.Time `json:"activeAt,omitempty"` + }{ + Alias: (*Alias)(ai), + } + if err := json.Unmarshal(data, aux); err != nil { + return err + } + if aux.ActiveAt != nil { + ai.ActiveAt = timestamppb.New(*aux.ActiveAt) + } + return nil } func (x *AlertState) UnmarshalJSON(entry []byte) error { @@ -319,11 +530,11 @@ func (a1 *Alert) Compare(a2 *Alert) int { return d } - if a1.LastEvaluation.Before(a2.LastEvaluation) { + t1, t2 := a1.LastEvaluation.AsTime(), a2.LastEvaluation.AsTime() + if t1.Before(t2) { return 1 } - - if a1.LastEvaluation.After(a2.LastEvaluation) { + if t1.After(t2) { return -1 } diff --git a/pkg/rules/rulespb/custom_test.go b/pkg/rules/rulespb/custom_test.go index 9c60e5173f6..1f6aa927522 100644 --- a/pkg/rules/rulespb/custom_test.go +++ b/pkg/rules/rulespb/custom_test.go @@ -11,6 +11,7 @@ import ( "github.com/pkg/errors" "github.com/prometheus/prometheus/model/labels" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" "github.com/efficientgo/core/testutil" "github.com/thanos-io/thanos/pkg/store/labelpb" @@ -20,7 +21,8 @@ import ( func TestJSONUnmarshalMarshal(t *testing.T) { now := time.Now() - twoHoursAgo := now.Add(2 * time.Hour) + twoHoursAgoTime := now.Add(2 * time.Hour) + twoHoursAgo := timestamppb.New(twoHoursAgoTime) for _, tcase := range []struct { name string @@ -56,7 +58,7 @@ func TestJSONUnmarshalMarshal(t *testing.T) { Name: "group1", File: "file1.yml", Interval: 2442, - LastEvaluation: now, + LastEvaluation: timestamppb.New(now), EvaluationDurationSeconds: 2.1, Limit: 0, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT, @@ -198,20 +200,10 @@ func TestJSONUnmarshalMarshal(t *testing.T) { Name: "group1", Rules: []*Rule{ NewAlertingRule(&Alert{ - Name: "alert1", - Query: "up == 0", - Labels: labelpb.ZLabelSet{ - Labels: []labelpb.ZLabel{ - {Name: "a2", Value: "b2"}, - {Name: "c2", Value: "d2"}, - }, - }, - Annotations: labelpb.ZLabelSet{ - Labels: []labelpb.ZLabel{ - {Name: "ann1", Value: "ann44"}, - {Name: "ann2", Value: "ann33"}, - }, - }, + Name: "alert1", + Query: "up == 0", + Labels: labelpb.LabelSetFromStrings("a2", "b2", "c2", "d2"), + Annotations: labelpb.LabelSetFromStrings("ann1", "ann44", "ann2", "ann33"), DurationSeconds: 60, KeepFiringForSeconds: 0, State: AlertState_PENDING, @@ -277,7 +269,7 @@ func TestJSONUnmarshalMarshal(t *testing.T) { Labels: labels.EmptyLabels(), Annotations: labels.EmptyLabels(), State: "firing", - ActiveAt: &twoHoursAgo, + ActiveAt: &twoHoursAgoTime, Value: "2143", PartialResponseStrategy: "ABORT", }, @@ -311,54 +303,33 @@ func TestJSONUnmarshalMarshal(t *testing.T) { Name: "group1", Rules: []*Rule{ NewRecordingRule(&RecordingRule{ - Query: "up", - Name: "recording1", - Labels: labelpb.ZLabelSet{ - Labels: []labelpb.ZLabel{ - {Name: "a", Value: "b"}, - {Name: "c", Value: "d"}, - }, - }, + Query: "up", + Name: "recording1", + Labels: labelpb.LabelSetFromStrings("a", "b", "c", "d"), LastError: "2", Health: "health", - LastEvaluation: now.Add(-2 * time.Minute), + LastEvaluation: timestamppb.New(now.Add(-2 * time.Minute)), EvaluationDurationSeconds: 2.6, }), NewAlertingRule(&Alert{ - Name: "alert1", - Query: "up == 0", - Labels: labelpb.ZLabelSet{ - Labels: []labelpb.ZLabel{ - {Name: "a2", Value: "b2"}, - {Name: "c2", Value: "d2"}, - }, - }, - Annotations: labelpb.ZLabelSet{ - Labels: []labelpb.ZLabel{ - {Name: "ann1", Value: "ann44"}, - {Name: "ann2", Value: "ann33"}, - }, - }, + Name: "alert1", + Query: "up == 0", + Labels: labelpb.LabelSetFromStrings("a2", "b2", "c2", "d2"), + Annotations: labelpb.LabelSetFromStrings("ann1", "ann44", "ann2", "ann33"), Alerts: []*AlertInstance{ { - Labels: labelpb.ZLabelSet{ - Labels: []labelpb.ZLabel{ - {Name: "instance1", Value: "1"}, - }, - }, - Annotations: labelpb.ZLabelSet{ - Labels: []labelpb.ZLabel{ - {Name: "annotation1", Value: "2"}, - }, - }, + Labels: labelpb.LabelSetFromStrings("instance1", "1"), + Annotations: labelpb.LabelSetFromStrings("annotation1", "2"), State: AlertState_INACTIVE, ActiveAt: nil, Value: "1", PartialResponseStrategy: storepb.PartialResponseStrategy_WARN, }, { + Labels: &labelpb.LabelSet{}, + Annotations: &labelpb.LabelSet{}, State: AlertState_FIRING, - ActiveAt: &twoHoursAgo, + ActiveAt: twoHoursAgo, Value: "2143", PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT, }, @@ -367,13 +338,13 @@ func TestJSONUnmarshalMarshal(t *testing.T) { State: AlertState_PENDING, LastError: "1", Health: "health2", - LastEvaluation: now.Add(-1 * time.Minute), + LastEvaluation: timestamppb.New(now.Add(-1 * time.Minute)), EvaluationDurationSeconds: 1.1, }), }, File: "file1.yml", Interval: 2442, - LastEvaluation: now, + LastEvaluation: timestamppb.New(now), EvaluationDurationSeconds: 2.1, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT, }, @@ -381,7 +352,7 @@ func TestJSONUnmarshalMarshal(t *testing.T) { Name: "group2", File: "file2.yml", Interval: 242342442, - LastEvaluation: now.Add(40 * time.Hour), + LastEvaluation: timestamppb.New(now.Add(40 * time.Hour)), EvaluationDurationSeconds: 21244.1, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT, Rules: []*Rule{}, @@ -408,10 +379,10 @@ func TestJSONUnmarshalMarshal(t *testing.T) { jsonProto, err := json.Marshal(proto) testutil.Ok(t, err) if tcase.expectedJSONOutput != "" { - testutil.Equals(t, tcase.expectedJSONOutput, string(jsonProto)) + assertEqualJSON(t, tcase.expectedJSONOutput, string(jsonProto)) return } - testutil.Equals(t, string(jsonInput), string(jsonProto)) + assertEqualJSON(t, string(jsonInput), string(jsonProto)) }) } } @@ -450,39 +421,28 @@ func TestRulesComparator(t *testing.T) { name: "no label before label", r1: NewAlertingRule(&Alert{Name: "a"}), r2: NewAlertingRule(&Alert{ - Name: "a", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a", + Labels: labelpb.LabelSetFromStrings("a", "1")}), want: -1, }, { name: "label ordering", r1: NewAlertingRule(&Alert{ - Name: "a", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a", + Labels: labelpb.LabelSetFromStrings("a", "1")}), r2: NewAlertingRule(&Alert{ - Name: "a", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "2"}, - }}}), + Name: "a", + Labels: labelpb.LabelSetFromStrings("a", "2")}), want: -1, }, { name: "multiple label ordering", r1: NewAlertingRule(&Alert{ - Name: "a", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Name: "a", + Labels: labelpb.LabelSetFromStrings("a", "1")}), r2: NewAlertingRule(&Alert{ - Name: "a", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - {Name: "b", Value: "1"}, - }}}), + Name: "a", + Labels: labelpb.LabelSetFromStrings("a", "1", "b", "1")}), want: -1, }, { @@ -490,15 +450,11 @@ func TestRulesComparator(t *testing.T) { r1: NewAlertingRule(&Alert{ Name: "a", DurationSeconds: 0.0, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Labels: labelpb.LabelSetFromStrings("a", "1")}), r2: NewAlertingRule(&Alert{ Name: "a", DurationSeconds: 1.0, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "a", Value: "1"}, - }}}), + Labels: labelpb.LabelSetFromStrings("a", "1")}), want: -1, }, } { @@ -507,3 +463,15 @@ func TestRulesComparator(t *testing.T) { }) } } + +func assertEqualJSON(t *testing.T, expected, actual string) { + t.Helper() + var exp, act interface{} + if err := json.Unmarshal([]byte(expected), &exp); err != nil { + t.Fatalf("failed to unmarshal expected JSON: %v", err) + } + if err := json.Unmarshal([]byte(actual), &act); err != nil { + t.Fatalf("failed to unmarshal actual JSON: %v", err) + } + testutil.Equals(t, exp, act) +} diff --git a/pkg/rules/rulespb/rpc.pb.go b/pkg/rules/rulespb/rpc.pb.go index 298ce03063b..46957913e6e 100644 --- a/pkg/rules/rulespb/rpc.pb.go +++ b/pkg/rules/rulespb/rpc.pb.go @@ -1,40 +1,32 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.20.1 // source: rules/rulespb/rpc.proto package rulespb import ( - context "context" - encoding_binary "encoding/binary" - fmt "fmt" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - - io "io" - math "math" - math_bits "math/bits" - time "time" + reflect "reflect" + sync "sync" + _ "github.com/srikrsna/protoc-gen-gotag/tagger" labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" storepb "github.com/thanos-io/thanos/pkg/store/storepb" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) // / AlertState represents state of the alert. Has to match 1:1 Prometheus AlertState: // @@ -54,58 +46,104 @@ const ( AlertState_FIRING AlertState = 2 ) -var AlertState_name = map[int32]string{ - 0: "INACTIVE", - 1: "PENDING", - 2: "FIRING", -} +// Enum value maps for AlertState. +var ( + AlertState_name = map[int32]string{ + 0: "INACTIVE", + 1: "PENDING", + 2: "FIRING", + } + AlertState_value = map[string]int32{ + "INACTIVE": 0, + "PENDING": 1, + "FIRING": 2, + } +) -var AlertState_value = map[string]int32{ - "INACTIVE": 0, - "PENDING": 1, - "FIRING": 2, +func (x AlertState) Enum() *AlertState { + p := new(AlertState) + *p = x + return p } func (x AlertState) String() string { - return proto.EnumName(AlertState_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AlertState) Descriptor() protoreflect.EnumDescriptor { + return file_rules_rulespb_rpc_proto_enumTypes[0].Descriptor() +} + +func (AlertState) Type() protoreflect.EnumType { + return &file_rules_rulespb_rpc_proto_enumTypes[0] } +func (x AlertState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AlertState.Descriptor instead. func (AlertState) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_91b1d28f30eb5efb, []int{0} + return file_rules_rulespb_rpc_proto_rawDescGZIP(), []int{0} } type RulesRequest_Type int32 const ( RulesRequest_ALL RulesRequest_Type = 0 - /// This will make sure strings.ToLower(.String()) will match 'alert' and 'record' values for - /// Prometheus HTTP API. - /// NOTE: The implementation has to return empty rule groups as well. + // / This will make sure strings.ToLower(.String()) will match 'alert' and 'record' values for + // / Prometheus HTTP API. + // / NOTE: The implementation has to return empty rule groups as well. RulesRequest_ALERT RulesRequest_Type = 1 RulesRequest_RECORD RulesRequest_Type = 2 ) -var RulesRequest_Type_name = map[int32]string{ - 0: "ALL", - 1: "ALERT", - 2: "RECORD", -} +// Enum value maps for RulesRequest_Type. +var ( + RulesRequest_Type_name = map[int32]string{ + 0: "ALL", + 1: "ALERT", + 2: "RECORD", + } + RulesRequest_Type_value = map[string]int32{ + "ALL": 0, + "ALERT": 1, + "RECORD": 2, + } +) -var RulesRequest_Type_value = map[string]int32{ - "ALL": 0, - "ALERT": 1, - "RECORD": 2, +func (x RulesRequest_Type) Enum() *RulesRequest_Type { + p := new(RulesRequest_Type) + *p = x + return p } func (x RulesRequest_Type) String() string { - return proto.EnumName(RulesRequest_Type_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RulesRequest_Type) Descriptor() protoreflect.EnumDescriptor { + return file_rules_rulespb_rpc_proto_enumTypes[1].Descriptor() +} + +func (RulesRequest_Type) Type() protoreflect.EnumType { + return &file_rules_rulespb_rpc_proto_enumTypes[1] +} + +func (x RulesRequest_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } +// Deprecated: Use RulesRequest_Type.Descriptor instead. func (RulesRequest_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_91b1d28f30eb5efb, []int{0, 0} + return file_rules_rulespb_rpc_proto_rawDescGZIP(), []int{0, 0} } type RulesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Type RulesRequest_Type `protobuf:"varint,1,opt,name=type,proto3,enum=thanos.RulesRequest_Type" json:"type,omitempty"` PartialResponseStrategy storepb.PartialResponseStrategy `protobuf:"varint,2,opt,name=partial_response_strategy,json=partialResponseStrategy,proto3,enum=thanos.PartialResponseStrategy" json:"partial_response_strategy,omitempty"` MatcherString []string `protobuf:"bytes,3,rep,name=matcher_string,json=matcherString,proto3" json:"matcher_string,omitempty"` @@ -114,95 +152,120 @@ type RulesRequest struct { File []string `protobuf:"bytes,6,rep,name=file,proto3" json:"file,omitempty"` } -func (m *RulesRequest) Reset() { *m = RulesRequest{} } -func (m *RulesRequest) String() string { return proto.CompactTextString(m) } -func (*RulesRequest) ProtoMessage() {} -func (*RulesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_91b1d28f30eb5efb, []int{0} -} -func (m *RulesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RulesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RulesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *RulesRequest) Reset() { + *x = RulesRequest{} + mi := &file_rules_rulespb_rpc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RulesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RulesRequest) ProtoMessage() {} + +func (x *RulesRequest) ProtoReflect() protoreflect.Message { + mi := &file_rules_rulespb_rpc_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *RulesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RulesRequest.Merge(m, src) + +// Deprecated: Use RulesRequest.ProtoReflect.Descriptor instead. +func (*RulesRequest) Descriptor() ([]byte, []int) { + return file_rules_rulespb_rpc_proto_rawDescGZIP(), []int{0} } -func (m *RulesRequest) XXX_Size() int { - return m.Size() + +func (x *RulesRequest) GetType() RulesRequest_Type { + if x != nil { + return x.Type + } + return RulesRequest_ALL } -func (m *RulesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RulesRequest.DiscardUnknown(m) + +func (x *RulesRequest) GetPartialResponseStrategy() storepb.PartialResponseStrategy { + if x != nil { + return x.PartialResponseStrategy + } + return storepb.PartialResponseStrategy(0) +} + +func (x *RulesRequest) GetMatcherString() []string { + if x != nil { + return x.MatcherString + } + return nil +} + +func (x *RulesRequest) GetRuleName() []string { + if x != nil { + return x.RuleName + } + return nil } -var xxx_messageInfo_RulesRequest proto.InternalMessageInfo +func (x *RulesRequest) GetRuleGroup() []string { + if x != nil { + return x.RuleGroup + } + return nil +} + +func (x *RulesRequest) GetFile() []string { + if x != nil { + return x.File + } + return nil +} type RulesResponse struct { - // Types that are valid to be assigned to Result: + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Result: + // // *RulesResponse_Group // *RulesResponse_Warning Result isRulesResponse_Result `protobuf_oneof:"result"` } -func (m *RulesResponse) Reset() { *m = RulesResponse{} } -func (m *RulesResponse) String() string { return proto.CompactTextString(m) } -func (*RulesResponse) ProtoMessage() {} -func (*RulesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_91b1d28f30eb5efb, []int{1} -} -func (m *RulesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RulesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RulesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RulesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RulesResponse.Merge(m, src) -} -func (m *RulesResponse) XXX_Size() int { - return m.Size() +func (x *RulesResponse) Reset() { + *x = RulesResponse{} + mi := &file_rules_rulespb_rpc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *RulesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RulesResponse.DiscardUnknown(m) + +func (x *RulesResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_RulesResponse proto.InternalMessageInfo +func (*RulesResponse) ProtoMessage() {} -type isRulesResponse_Result interface { - isRulesResponse_Result() - MarshalTo([]byte) (int, error) - Size() int +func (x *RulesResponse) ProtoReflect() protoreflect.Message { + mi := &file_rules_rulespb_rpc_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -type RulesResponse_Group struct { - Group *RuleGroup `protobuf:"bytes,1,opt,name=group,proto3,oneof" json:"group,omitempty"` -} -type RulesResponse_Warning struct { - Warning string `protobuf:"bytes,2,opt,name=warning,proto3,oneof" json:"warning,omitempty"` +// Deprecated: Use RulesResponse.ProtoReflect.Descriptor instead. +func (*RulesResponse) Descriptor() ([]byte, []int) { + return file_rules_rulespb_rpc_proto_rawDescGZIP(), []int{1} } -func (*RulesResponse_Group) isRulesResponse_Result() {} -func (*RulesResponse_Warning) isRulesResponse_Result() {} - func (m *RulesResponse) GetResult() isRulesResponse_Result { if m != nil { return m.Result @@ -210,28 +273,39 @@ func (m *RulesResponse) GetResult() isRulesResponse_Result { return nil } -func (m *RulesResponse) GetGroup() *RuleGroup { - if x, ok := m.GetResult().(*RulesResponse_Group); ok { +func (x *RulesResponse) GetGroup() *RuleGroup { + if x, ok := x.GetResult().(*RulesResponse_Group); ok { return x.Group } return nil } -func (m *RulesResponse) GetWarning() string { - if x, ok := m.GetResult().(*RulesResponse_Warning); ok { +func (x *RulesResponse) GetWarning() string { + if x, ok := x.GetResult().(*RulesResponse_Warning); ok { return x.Warning } return "" } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*RulesResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*RulesResponse_Group)(nil), - (*RulesResponse_Warning)(nil), - } +type isRulesResponse_Result interface { + isRulesResponse_Result() +} + +type RulesResponse_Group struct { + // / group for rule groups. It is up to server implementation to decide how many of those to put here within single frame. + Group *RuleGroup `protobuf:"bytes,1,opt,name=group,proto3,oneof"` +} + +type RulesResponse_Warning struct { + // / warning is considered an information piece in place of series for warning purposes. + // / It is used to warn rule API users about suspicious cases or partial response (if enabled). + Warning string `protobuf:"bytes,2,opt,name=warning,proto3,oneof"` } +func (*RulesResponse_Group) isRulesResponse_Result() {} + +func (*RulesResponse_Warning) isRulesResponse_Result() {} + // / RuleGroups is set of rule groups. // / This and below APIs are meant to be used for unmarshaling and marshsaling rules from/to Prometheus API. // / That's why json tag has to be customized and matching https://github.com/prometheus/prometheus/blob/c530b4b456cc5f9ec249f771dff187eb7715dc9b/web/api/v1/api.go#L955 @@ -239,3081 +313,841 @@ func (*RulesResponse) XXX_OneofWrappers() []interface{} { // / // / For rule parsing from YAML configuration other struct is used: https://github.com/prometheus/prometheus/blob/20b1f596f6fb16107ef0c244d240b0ad6da36829/pkg/rulefmt/rulefmt.go#L105 type RuleGroups struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Groups []*RuleGroup `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups"` } -func (m *RuleGroups) Reset() { *m = RuleGroups{} } -func (m *RuleGroups) String() string { return proto.CompactTextString(m) } -func (*RuleGroups) ProtoMessage() {} -func (*RuleGroups) Descriptor() ([]byte, []int) { - return fileDescriptor_91b1d28f30eb5efb, []int{2} -} -func (m *RuleGroups) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RuleGroups) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RuleGroups.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +func (x *RuleGroups) Reset() { + *x = RuleGroups{} + mi := &file_rules_rulespb_rpc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *RuleGroups) XXX_Merge(src proto.Message) { - xxx_messageInfo_RuleGroups.Merge(m, src) + +func (x *RuleGroups) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *RuleGroups) XXX_Size() int { - return m.Size() + +func (*RuleGroups) ProtoMessage() {} + +func (x *RuleGroups) ProtoReflect() protoreflect.Message { + mi := &file_rules_rulespb_rpc_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *RuleGroups) XXX_DiscardUnknown() { - xxx_messageInfo_RuleGroups.DiscardUnknown(m) + +// Deprecated: Use RuleGroups.ProtoReflect.Descriptor instead. +func (*RuleGroups) Descriptor() ([]byte, []int) { + return file_rules_rulespb_rpc_proto_rawDescGZIP(), []int{2} } -var xxx_messageInfo_RuleGroups proto.InternalMessageInfo +func (x *RuleGroups) GetGroups() []*RuleGroup { + if x != nil { + return x.Groups + } + return nil +} // / RuleGroup has info for rules which are part of a group. type RuleGroup struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` - File string `protobuf:"bytes,2,opt,name=file,proto3" json:"file"` - Rules []*Rule `protobuf:"bytes,3,rep,name=rules,proto3" json:"rules"` - Interval float64 `protobuf:"fixed64,4,opt,name=interval,proto3" json:"interval"` - EvaluationDurationSeconds float64 `protobuf:"fixed64,5,opt,name=evaluation_duration_seconds,json=evaluationDurationSeconds,proto3" json:"evaluationTime"` - LastEvaluation time.Time `protobuf:"bytes,6,opt,name=last_evaluation,json=lastEvaluation,proto3,stdtime" json:"lastEvaluation"` - Limit int64 `protobuf:"varint,9,opt,name=limit,proto3" json:"limit"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` + File string `protobuf:"bytes,2,opt,name=file,proto3" json:"file"` + Rules []*Rule `protobuf:"bytes,3,rep,name=rules,proto3" json:"rules"` + Interval float64 `protobuf:"fixed64,4,opt,name=interval,proto3" json:"interval"` + EvaluationDurationSeconds float64 `protobuf:"fixed64,5,opt,name=evaluation_duration_seconds,json=evaluationDurationSeconds,proto3" json:"evaluationTime"` // TODO: Is it really second? + LastEvaluation *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=last_evaluation,json=lastEvaluation,proto3" json:"lastEvaluation"` + Limit int64 `protobuf:"varint,9,opt,name=limit,proto3" json:"limit"` // Thanos specific. PartialResponseStrategy storepb.PartialResponseStrategy `protobuf:"varint,8,opt,name=PartialResponseStrategy,proto3,enum=thanos.PartialResponseStrategy" json:"partialResponseStrategy"` } -func (m *RuleGroup) Reset() { *m = RuleGroup{} } -func (m *RuleGroup) String() string { return proto.CompactTextString(m) } -func (*RuleGroup) ProtoMessage() {} -func (*RuleGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_91b1d28f30eb5efb, []int{3} -} -func (m *RuleGroup) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RuleGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RuleGroup.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RuleGroup) XXX_Merge(src proto.Message) { - xxx_messageInfo_RuleGroup.Merge(m, src) +func (x *RuleGroup) Reset() { + *x = RuleGroup{} + mi := &file_rules_rulespb_rpc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *RuleGroup) XXX_Size() int { - return m.Size() -} -func (m *RuleGroup) XXX_DiscardUnknown() { - xxx_messageInfo_RuleGroup.DiscardUnknown(m) -} - -var xxx_messageInfo_RuleGroup proto.InternalMessageInfo -type Rule struct { - // Types that are valid to be assigned to Result: - // *Rule_Recording - // *Rule_Alert - Result isRule_Result `protobuf_oneof:"result"` +func (x *RuleGroup) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Rule) Reset() { *m = Rule{} } -func (m *Rule) String() string { return proto.CompactTextString(m) } -func (*Rule) ProtoMessage() {} -func (*Rule) Descriptor() ([]byte, []int) { - return fileDescriptor_91b1d28f30eb5efb, []int{4} -} -func (m *Rule) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Rule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Rule.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (*RuleGroup) ProtoMessage() {} + +func (x *RuleGroup) ProtoReflect() protoreflect.Message { + mi := &file_rules_rulespb_rpc_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *Rule) XXX_Merge(src proto.Message) { - xxx_messageInfo_Rule.Merge(m, src) -} -func (m *Rule) XXX_Size() int { - return m.Size() -} -func (m *Rule) XXX_DiscardUnknown() { - xxx_messageInfo_Rule.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_Rule proto.InternalMessageInfo - -type isRule_Result interface { - isRule_Result() - MarshalTo([]byte) (int, error) - Size() int +// Deprecated: Use RuleGroup.ProtoReflect.Descriptor instead. +func (*RuleGroup) Descriptor() ([]byte, []int) { + return file_rules_rulespb_rpc_proto_rawDescGZIP(), []int{3} } -type Rule_Recording struct { - Recording *RecordingRule `protobuf:"bytes,1,opt,name=recording,proto3,oneof" json:"recording,omitempty"` -} -type Rule_Alert struct { - Alert *Alert `protobuf:"bytes,2,opt,name=alert,proto3,oneof" json:"alert,omitempty"` +func (x *RuleGroup) GetName() string { + if x != nil { + return x.Name + } + return "" } -func (*Rule_Recording) isRule_Result() {} -func (*Rule_Alert) isRule_Result() {} - -func (m *Rule) GetResult() isRule_Result { - if m != nil { - return m.Result +func (x *RuleGroup) GetFile() string { + if x != nil { + return x.File } - return nil + return "" } -func (m *Rule) GetRecording() *RecordingRule { - if x, ok := m.GetResult().(*Rule_Recording); ok { - return x.Recording +func (x *RuleGroup) GetRules() []*Rule { + if x != nil { + return x.Rules } return nil } -func (m *Rule) GetAlert() *Alert { - if x, ok := m.GetResult().(*Rule_Alert); ok { - return x.Alert +func (x *RuleGroup) GetInterval() float64 { + if x != nil { + return x.Interval } - return nil + return 0 } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Rule) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Rule_Recording)(nil), - (*Rule_Alert)(nil), +func (x *RuleGroup) GetEvaluationDurationSeconds() float64 { + if x != nil { + return x.EvaluationDurationSeconds } + return 0 } -type AlertInstance struct { - Labels labelpb.ZLabelSet `protobuf:"bytes,1,opt,name=labels,proto3" json:"labels"` - Annotations labelpb.ZLabelSet `protobuf:"bytes,2,opt,name=annotations,proto3" json:"annotations"` - State AlertState `protobuf:"varint,3,opt,name=state,proto3,enum=thanos.AlertState" json:"state"` - ActiveAt *time.Time `protobuf:"bytes,4,opt,name=active_at,json=activeAt,proto3,stdtime" json:"activeAt,omitempty"` - Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value"` - // Thanos specific. Used mainly for alert API purposes. - PartialResponseStrategy storepb.PartialResponseStrategy `protobuf:"varint,6,opt,name=PartialResponseStrategy,proto3,enum=thanos.PartialResponseStrategy" json:"partialResponseStrategy"` +func (x *RuleGroup) GetLastEvaluation() *timestamppb.Timestamp { + if x != nil { + return x.LastEvaluation + } + return nil } -func (m *AlertInstance) Reset() { *m = AlertInstance{} } -func (m *AlertInstance) String() string { return proto.CompactTextString(m) } -func (*AlertInstance) ProtoMessage() {} -func (*AlertInstance) Descriptor() ([]byte, []int) { - return fileDescriptor_91b1d28f30eb5efb, []int{5} -} -func (m *AlertInstance) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AlertInstance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AlertInstance.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *RuleGroup) GetLimit() int64 { + if x != nil { + return x.Limit } -} -func (m *AlertInstance) XXX_Merge(src proto.Message) { - xxx_messageInfo_AlertInstance.Merge(m, src) -} -func (m *AlertInstance) XXX_Size() int { - return m.Size() -} -func (m *AlertInstance) XXX_DiscardUnknown() { - xxx_messageInfo_AlertInstance.DiscardUnknown(m) + return 0 } -var xxx_messageInfo_AlertInstance proto.InternalMessageInfo - -type Alert struct { - /// state returns the maximum state of alert instances for this rule. - State AlertState `protobuf:"varint,1,opt,name=state,proto3,enum=thanos.AlertState" json:"state"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` - Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query"` - DurationSeconds float64 `protobuf:"fixed64,4,opt,name=duration_seconds,json=durationSeconds,proto3" json:"duration"` - Labels labelpb.ZLabelSet `protobuf:"bytes,5,opt,name=labels,proto3" json:"labels"` - Annotations labelpb.ZLabelSet `protobuf:"bytes,6,opt,name=annotations,proto3" json:"annotations"` - Alerts []*AlertInstance `protobuf:"bytes,7,rep,name=alerts,proto3" json:"alerts"` - Health string `protobuf:"bytes,8,opt,name=health,proto3" json:"health"` - LastError string `protobuf:"bytes,9,opt,name=last_error,json=lastError,proto3" json:"lastError,omitempty"` - EvaluationDurationSeconds float64 `protobuf:"fixed64,10,opt,name=evaluation_duration_seconds,json=evaluationDurationSeconds,proto3" json:"evaluationTime"` - LastEvaluation time.Time `protobuf:"bytes,11,opt,name=last_evaluation,json=lastEvaluation,proto3,stdtime" json:"lastEvaluation"` - KeepFiringForSeconds float64 `protobuf:"fixed64,12,opt,name=keep_firing_for_seconds,json=keepFiringForSeconds,proto3" json:"keepFiringFor"` -} - -func (m *Alert) Reset() { *m = Alert{} } -func (m *Alert) String() string { return proto.CompactTextString(m) } -func (*Alert) ProtoMessage() {} -func (*Alert) Descriptor() ([]byte, []int) { - return fileDescriptor_91b1d28f30eb5efb, []int{6} -} -func (m *Alert) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Alert) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Alert.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *RuleGroup) GetPartialResponseStrategy() storepb.PartialResponseStrategy { + if x != nil { + return x.PartialResponseStrategy } -} -func (m *Alert) XXX_Merge(src proto.Message) { - xxx_messageInfo_Alert.Merge(m, src) -} -func (m *Alert) XXX_Size() int { - return m.Size() -} -func (m *Alert) XXX_DiscardUnknown() { - xxx_messageInfo_Alert.DiscardUnknown(m) + return storepb.PartialResponseStrategy(0) } -var xxx_messageInfo_Alert proto.InternalMessageInfo +type Rule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -type RecordingRule struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` - Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query"` - Labels labelpb.ZLabelSet `protobuf:"bytes,3,opt,name=labels,proto3" json:"labels"` - Health string `protobuf:"bytes,4,opt,name=health,proto3" json:"health"` - LastError string `protobuf:"bytes,5,opt,name=last_error,json=lastError,proto3" json:"lastError,omitempty"` - EvaluationDurationSeconds float64 `protobuf:"fixed64,6,opt,name=evaluation_duration_seconds,json=evaluationDurationSeconds,proto3" json:"evaluationTime"` - LastEvaluation time.Time `protobuf:"bytes,7,opt,name=last_evaluation,json=lastEvaluation,proto3,stdtime" json:"lastEvaluation"` -} - -func (m *RecordingRule) Reset() { *m = RecordingRule{} } -func (m *RecordingRule) String() string { return proto.CompactTextString(m) } -func (*RecordingRule) ProtoMessage() {} -func (*RecordingRule) Descriptor() ([]byte, []int) { - return fileDescriptor_91b1d28f30eb5efb, []int{7} -} -func (m *RecordingRule) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RecordingRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RecordingRule.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RecordingRule) XXX_Merge(src proto.Message) { - xxx_messageInfo_RecordingRule.Merge(m, src) -} -func (m *RecordingRule) XXX_Size() int { - return m.Size() -} -func (m *RecordingRule) XXX_DiscardUnknown() { - xxx_messageInfo_RecordingRule.DiscardUnknown(m) -} - -var xxx_messageInfo_RecordingRule proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("thanos.AlertState", AlertState_name, AlertState_value) - proto.RegisterEnum("thanos.RulesRequest_Type", RulesRequest_Type_name, RulesRequest_Type_value) - proto.RegisterType((*RulesRequest)(nil), "thanos.RulesRequest") - proto.RegisterType((*RulesResponse)(nil), "thanos.RulesResponse") - proto.RegisterType((*RuleGroups)(nil), "thanos.RuleGroups") - proto.RegisterType((*RuleGroup)(nil), "thanos.RuleGroup") - proto.RegisterType((*Rule)(nil), "thanos.Rule") - proto.RegisterType((*AlertInstance)(nil), "thanos.AlertInstance") - proto.RegisterType((*Alert)(nil), "thanos.Alert") - proto.RegisterType((*RecordingRule)(nil), "thanos.RecordingRule") -} - -func init() { proto.RegisterFile("rules/rulespb/rpc.proto", fileDescriptor_91b1d28f30eb5efb) } - -var fileDescriptor_91b1d28f30eb5efb = []byte{ - // 1096 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x4e, 0x23, 0x47, - 0x10, 0xf6, 0xd8, 0x9e, 0xb1, 0xa7, 0x8c, 0x59, 0xb6, 0x17, 0xc4, 0x00, 0x89, 0x07, 0x59, 0x22, - 0x22, 0x51, 0xd6, 0x8e, 0x40, 0xbb, 0xd1, 0x9e, 0x22, 0xcc, 0xcf, 0x82, 0x84, 0xc8, 0xaa, 0x8d, - 0x72, 0xd8, 0x1c, 0x9c, 0xc6, 0x34, 0x66, 0x94, 0xf1, 0xcc, 0x6c, 0x4f, 0x9b, 0x88, 0xb7, 0xd8, - 0x73, 0x5e, 0x24, 0xca, 0x1b, 0x70, 0xcb, 0x1e, 0x73, 0x72, 0x12, 0xb8, 0xf9, 0x90, 0x67, 0x88, - 0xba, 0x7a, 0xc6, 0x63, 0x08, 0x84, 0xdd, 0x84, 0x5c, 0xdc, 0xdd, 0x5f, 0x7d, 0xd5, 0x3f, 0x55, - 0x5f, 0x95, 0x07, 0xe6, 0xc5, 0xc0, 0xe7, 0x71, 0x13, 0x7f, 0xa3, 0xa3, 0xa6, 0x88, 0xba, 0x8d, - 0x48, 0x84, 0x32, 0x24, 0x96, 0x3c, 0x65, 0x41, 0x18, 0x2f, 0x2e, 0xc4, 0x32, 0x14, 0xbc, 0x89, - 0xbf, 0xd1, 0x51, 0x53, 0x9e, 0x47, 0x3c, 0xd6, 0x94, 0xd4, 0xe4, 0xb3, 0x23, 0xee, 0xdf, 0x30, - 0xcd, 0xf6, 0xc2, 0x5e, 0x88, 0xd3, 0xa6, 0x9a, 0x25, 0xa8, 0xdb, 0x0b, 0xc3, 0x9e, 0xcf, 0x9b, - 0xb8, 0x3a, 0x1a, 0x9c, 0x34, 0xa5, 0xd7, 0xe7, 0xb1, 0x64, 0xfd, 0x48, 0x13, 0xea, 0x3f, 0xe7, - 0x61, 0x8a, 0xaa, 0xab, 0x50, 0xfe, 0x66, 0xc0, 0x63, 0x49, 0x9e, 0x42, 0x51, 0x6d, 0xeb, 0x18, - 0xcb, 0xc6, 0xea, 0xf4, 0xda, 0x42, 0x43, 0x5f, 0xaa, 0x31, 0xc9, 0x69, 0x1c, 0x9e, 0x47, 0x9c, - 0x22, 0x8d, 0x7c, 0x0b, 0x0b, 0x11, 0x13, 0xd2, 0x63, 0x7e, 0x47, 0xf0, 0x38, 0x0a, 0x83, 0x98, - 0x77, 0x62, 0x29, 0x98, 0xe4, 0xbd, 0x73, 0x27, 0x8f, 0x7b, 0xb8, 0xe9, 0x1e, 0xaf, 0x34, 0x91, - 0x26, 0xbc, 0x76, 0x42, 0xa3, 0xf3, 0xd1, 0xed, 0x06, 0xb2, 0x02, 0xd3, 0x7d, 0x26, 0xbb, 0xa7, - 0x5c, 0xa8, 0x3d, 0xbd, 0xa0, 0xe7, 0x14, 0x96, 0x0b, 0xab, 0x36, 0xad, 0x26, 0x68, 0x1b, 0x41, - 0xb2, 0x04, 0xb6, 0x8a, 0x66, 0x27, 0x60, 0x7d, 0xee, 0x14, 0x91, 0x51, 0x56, 0xc0, 0x01, 0xeb, - 0x73, 0xf2, 0x31, 0x00, 0x1a, 0x7b, 0x22, 0x1c, 0x44, 0x8e, 0x89, 0x56, 0xa4, 0xbf, 0x54, 0x00, - 0x21, 0x50, 0x3c, 0xf1, 0x7c, 0xee, 0x58, 0x68, 0xc0, 0x79, 0xfd, 0x13, 0x28, 0xaa, 0x17, 0x92, - 0x12, 0x14, 0x36, 0xf6, 0xf7, 0x67, 0x72, 0xc4, 0x06, 0x73, 0x63, 0x7f, 0x9b, 0x1e, 0xce, 0x18, - 0x04, 0xc0, 0xa2, 0xdb, 0x9b, 0x5f, 0xd3, 0xad, 0x99, 0x7c, 0xfd, 0x3b, 0xa8, 0x26, 0x61, 0xd1, - 0xf7, 0x26, 0x9f, 0x82, 0xa9, 0x8f, 0x51, 0xc1, 0xab, 0xac, 0x3d, 0x9e, 0x0c, 0x1e, 0x1e, 0xb7, - 0x9b, 0xa3, 0x9a, 0x41, 0x16, 0xa1, 0xf4, 0x03, 0x13, 0x81, 0x7a, 0x93, 0x8a, 0x92, 0xbd, 0x9b, - 0xa3, 0x29, 0xd0, 0x2a, 0x83, 0x25, 0x78, 0x3c, 0xf0, 0x65, 0x7d, 0x13, 0x60, 0xec, 0x1b, 0x93, - 0x67, 0x60, 0xa1, 0x73, 0xec, 0x18, 0xcb, 0x85, 0x5b, 0xf7, 0x6f, 0xc1, 0x68, 0xe8, 0x26, 0x24, - 0x9a, 0x8c, 0xf5, 0x3f, 0x0b, 0x60, 0x8f, 0x19, 0xe4, 0x23, 0x28, 0x62, 0x9c, 0xd4, 0x15, 0xed, - 0x56, 0x79, 0x34, 0x74, 0x71, 0x4d, 0xf1, 0x57, 0x59, 0x31, 0x1c, 0xf9, 0xcc, 0xaa, 0xd6, 0x3a, - 0x30, 0xe4, 0x29, 0x98, 0x28, 0x5b, 0x4c, 0x43, 0x65, 0x6d, 0x6a, 0xf2, 0xfc, 0x96, 0x3d, 0x1a, - 0xba, 0xda, 0x4c, 0xf5, 0x40, 0x56, 0xa1, 0xec, 0x05, 0x92, 0x8b, 0x33, 0xe6, 0x3b, 0xc5, 0x65, - 0x63, 0xd5, 0x68, 0x4d, 0x8d, 0x86, 0xee, 0x18, 0xa3, 0xe3, 0x19, 0xa1, 0xb0, 0xc4, 0xcf, 0x98, - 0x3f, 0x60, 0xd2, 0x0b, 0x83, 0xce, 0xf1, 0x40, 0xe8, 0x49, 0xcc, 0xbb, 0x61, 0x70, 0x1c, 0x3b, - 0x26, 0x3a, 0x93, 0xd1, 0xd0, 0x9d, 0xce, 0x68, 0x87, 0x5e, 0x9f, 0xd3, 0x85, 0x6c, 0xbd, 0x95, - 0x78, 0xb5, 0xb5, 0x13, 0xe9, 0xc0, 0x23, 0x9f, 0xc5, 0xb2, 0x93, 0x31, 0x1c, 0x0b, 0xd3, 0xb2, - 0xd8, 0xd0, 0x45, 0xd1, 0x48, 0x8b, 0xa2, 0x71, 0x98, 0x16, 0x45, 0x6b, 0xf1, 0x62, 0xe8, 0xe6, - 0xd4, 0x39, 0xca, 0x75, 0x7b, 0xec, 0xf9, 0xf6, 0x37, 0xd7, 0xa0, 0x37, 0x30, 0xe2, 0x82, 0xe9, - 0x7b, 0x7d, 0x4f, 0x3a, 0xf6, 0xb2, 0xb1, 0x5a, 0xd0, 0xef, 0x47, 0x80, 0xea, 0x81, 0x9c, 0xc1, - 0xfc, 0x1d, 0x92, 0x77, 0xca, 0xef, 0x55, 0x19, 0xad, 0xa5, 0xd1, 0xd0, 0xbd, 0xab, 0x3a, 0xe8, - 0x5d, 0x9b, 0xd7, 0x03, 0x28, 0xaa, 0x8c, 0x90, 0x67, 0x60, 0x0b, 0xde, 0x0d, 0xc5, 0xb1, 0x52, - 0x99, 0x96, 0xe4, 0xdc, 0x38, 0x65, 0xa9, 0x41, 0x31, 0x77, 0x73, 0x34, 0x63, 0x92, 0x15, 0x30, - 0x99, 0xcf, 0x85, 0x44, 0x11, 0x54, 0xd6, 0xaa, 0xa9, 0xcb, 0x86, 0x02, 0x95, 0x82, 0xd1, 0x3a, - 0xa1, 0xd2, 0x9f, 0x0a, 0x50, 0x45, 0xe3, 0x5e, 0x10, 0x4b, 0x16, 0x74, 0x39, 0x79, 0x01, 0x16, - 0xf6, 0xa8, 0xf8, 0x66, 0x25, 0xbc, 0xde, 0x57, 0x70, 0x9b, 0xcb, 0xd6, 0x74, 0x12, 0xe9, 0x84, - 0x48, 0x93, 0x91, 0xec, 0x42, 0x85, 0x05, 0x41, 0x28, 0x31, 0xc6, 0x71, 0x72, 0x87, 0x5b, 0xfc, - 0x9f, 0x24, 0xfe, 0x93, 0x6c, 0x3a, 0xb9, 0x20, 0xeb, 0x60, 0xc6, 0x92, 0x49, 0xee, 0x14, 0x30, - 0xd8, 0xe4, 0xda, 0x3b, 0xda, 0xca, 0xa2, 0x73, 0x86, 0x24, 0xaa, 0x07, 0xd2, 0x06, 0x9b, 0x75, - 0xa5, 0x77, 0xc6, 0x3b, 0x4c, 0xa2, 0x68, 0xef, 0xd1, 0xcb, 0x68, 0xe8, 0x12, 0xed, 0xb0, 0x21, - 0x3f, 0x0f, 0xfb, 0x9e, 0xe4, 0xfd, 0x48, 0x9e, 0xa3, 0x5e, 0xca, 0x29, 0xae, 0x94, 0xa2, 0x64, - 0xc3, 0x51, 0xc8, 0xb6, 0x3e, 0x15, 0x01, 0xaa, 0x87, 0x7f, 0x52, 0x8a, 0xf5, 0x7f, 0x2a, 0xe5, - 0x17, 0x13, 0x4c, 0x0c, 0x47, 0x16, 0x2c, 0xe3, 0x03, 0x82, 0x95, 0xf6, 0x92, 0xfc, 0xad, 0xbd, - 0xc4, 0x05, 0xf3, 0xcd, 0x80, 0x8b, 0x73, 0x8c, 0x7f, 0xf2, 0x6a, 0x04, 0xa8, 0x1e, 0xc8, 0x97, - 0x30, 0xf3, 0xb7, 0x52, 0x9f, 0xe8, 0x13, 0xa9, 0x8d, 0x3e, 0x3a, 0xbe, 0x51, 0xda, 0x99, 0xbc, - 0xcc, 0xff, 0x28, 0x2f, 0xeb, 0xdf, 0xcb, 0xeb, 0x05, 0x58, 0x58, 0x08, 0xb1, 0x53, 0xc2, 0x6e, - 0x38, 0x77, 0x2d, 0x64, 0x69, 0x29, 0xe8, 0x8e, 0xac, 0x89, 0x34, 0x19, 0x49, 0x1d, 0xac, 0x53, - 0xce, 0x7c, 0x79, 0x8a, 0x7d, 0xc0, 0xd6, 0x1c, 0x8d, 0xd0, 0x64, 0x24, 0xcf, 0x01, 0x74, 0xfb, - 0x12, 0x22, 0x14, 0xd8, 0x62, 0xec, 0xd6, 0xfc, 0x68, 0xe8, 0x3e, 0xc1, 0x2e, 0xa4, 0xc0, 0x4c, - 0x6e, 0xd4, 0x1e, 0x83, 0xf7, 0xb5, 0x52, 0x78, 0xa0, 0x56, 0x5a, 0x79, 0xd0, 0x56, 0xba, 0x0b, - 0xf3, 0xdf, 0x73, 0x1e, 0x75, 0x4e, 0x3c, 0xf5, 0x87, 0xde, 0x39, 0x09, 0xc5, 0xf8, 0xc2, 0x53, - 0x78, 0xe1, 0xc7, 0xa3, 0xa1, 0x5b, 0x55, 0x94, 0x1d, 0x64, 0xec, 0x84, 0x82, 0xce, 0x5e, 0x5b, - 0x26, 0x57, 0xad, 0xff, 0x58, 0x80, 0xea, 0xb5, 0xde, 0x76, 0xcf, 0x1f, 0xde, 0x58, 0xa4, 0xf9, - 0x3b, 0x44, 0x9a, 0x69, 0xad, 0xf0, 0xa1, 0x5a, 0xcb, 0xd2, 0x5c, 0x7c, 0xcf, 0x34, 0x9b, 0x0f, - 0x95, 0x66, 0xeb, 0x81, 0xd2, 0x5c, 0x7a, 0xc8, 0x34, 0x7f, 0xb6, 0x0e, 0x90, 0xf5, 0x13, 0x32, - 0x05, 0xe5, 0xbd, 0x83, 0x8d, 0xcd, 0xc3, 0xbd, 0x6f, 0xb6, 0x67, 0x72, 0xa4, 0x02, 0xa5, 0x57, - 0xdb, 0x07, 0x5b, 0x7b, 0x07, 0x2f, 0xf5, 0x57, 0xd6, 0xce, 0x1e, 0x55, 0xf3, 0xfc, 0xda, 0x57, - 0x60, 0xe2, 0x57, 0x16, 0x79, 0x9e, 0x4e, 0x66, 0x6f, 0xfb, 0x28, 0x5d, 0x9c, 0xbb, 0x81, 0xea, - 0x56, 0xf7, 0x85, 0xd1, 0x5a, 0xb9, 0xf8, 0xa3, 0x96, 0xbb, 0xb8, 0xac, 0x19, 0xef, 0x2e, 0x6b, - 0xc6, 0xef, 0x97, 0x35, 0xe3, 0xed, 0x55, 0x2d, 0xf7, 0xee, 0xaa, 0x96, 0xfb, 0xf5, 0xaa, 0x96, - 0x7b, 0x5d, 0x4a, 0x3e, 0xc4, 0x8f, 0x2c, 0x7c, 0xdc, 0xfa, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, - 0xa0, 0xc1, 0xf7, 0x10, 0xa0, 0x0b, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// RulesClient is the client API for Rules service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type RulesClient interface { - /// Rules has info for all rules. - /// Returned rules are expected to include external labels. - Rules(ctx context.Context, in *RulesRequest, opts ...grpc.CallOption) (Rules_RulesClient, error) + // Types that are assignable to Result: + // + // *Rule_Recording + // *Rule_Alert + Result isRule_Result `protobuf_oneof:"result"` } -type rulesClient struct { - cc *grpc.ClientConn +func (x *Rule) Reset() { + *x = Rule{} + mi := &file_rules_rulespb_rpc_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func NewRulesClient(cc *grpc.ClientConn) RulesClient { - return &rulesClient{cc} +func (x *Rule) String() string { + return protoimpl.X.MessageStringOf(x) } -func (c *rulesClient) Rules(ctx context.Context, in *RulesRequest, opts ...grpc.CallOption) (Rules_RulesClient, error) { - stream, err := c.cc.NewStream(ctx, &_Rules_serviceDesc.Streams[0], "/thanos.Rules/Rules", opts...) - if err != nil { - return nil, err - } - x := &rulesRulesClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err +func (*Rule) ProtoMessage() {} + +func (x *Rule) ProtoReflect() protoreflect.Message { + mi := &file_rules_rulespb_rpc_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return x, nil + return mi.MessageOf(x) } -type Rules_RulesClient interface { - Recv() (*RulesResponse, error) - grpc.ClientStream +// Deprecated: Use Rule.ProtoReflect.Descriptor instead. +func (*Rule) Descriptor() ([]byte, []int) { + return file_rules_rulespb_rpc_proto_rawDescGZIP(), []int{4} } -type rulesRulesClient struct { - grpc.ClientStream +func (m *Rule) GetResult() isRule_Result { + if m != nil { + return m.Result + } + return nil } -func (x *rulesRulesClient) Recv() (*RulesResponse, error) { - m := new(RulesResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err +func (x *Rule) GetRecording() *RecordingRule { + if x, ok := x.GetResult().(*Rule_Recording); ok { + return x.Recording } - return m, nil + return nil } -// RulesServer is the server API for Rules service. -type RulesServer interface { - /// Rules has info for all rules. - /// Returned rules are expected to include external labels. - Rules(*RulesRequest, Rules_RulesServer) error +func (x *Rule) GetAlert() *Alert { + if x, ok := x.GetResult().(*Rule_Alert); ok { + return x.Alert + } + return nil } -// UnimplementedRulesServer can be embedded to have forward compatible implementations. -type UnimplementedRulesServer struct { +type isRule_Result interface { + isRule_Result() } -func (*UnimplementedRulesServer) Rules(req *RulesRequest, srv Rules_RulesServer) error { - return status.Errorf(codes.Unimplemented, "method Rules not implemented") +type Rule_Recording struct { + Recording *RecordingRule `protobuf:"bytes,1,opt,name=recording,proto3,oneof"` } -func RegisterRulesServer(s *grpc.Server, srv RulesServer) { - s.RegisterService(&_Rules_serviceDesc, srv) +type Rule_Alert struct { + Alert *Alert `protobuf:"bytes,2,opt,name=alert,proto3,oneof"` } -func _Rules_Rules_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(RulesRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(RulesServer).Rules(m, &rulesRulesServer{stream}) -} +func (*Rule_Recording) isRule_Result() {} -type Rules_RulesServer interface { - Send(*RulesResponse) error - grpc.ServerStream -} +func (*Rule_Alert) isRule_Result() {} -type rulesRulesServer struct { - grpc.ServerStream +type AlertInstance struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Labels *labelpb.LabelSet `protobuf:"bytes,1,opt,name=labels,proto3" json:"labels"` + Annotations *labelpb.LabelSet `protobuf:"bytes,2,opt,name=annotations,proto3" json:"annotations"` + State AlertState `protobuf:"varint,3,opt,name=state,proto3,enum=thanos.AlertState" json:"state"` + ActiveAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=active_at,json=activeAt,proto3" json:"activeAt,omitempty"` + Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value"` + // Thanos specific. Used mainly for alert API purposes. + PartialResponseStrategy storepb.PartialResponseStrategy `protobuf:"varint,6,opt,name=PartialResponseStrategy,proto3,enum=thanos.PartialResponseStrategy" json:"partialResponseStrategy"` } -func (x *rulesRulesServer) Send(m *RulesResponse) error { - return x.ServerStream.SendMsg(m) +func (x *AlertInstance) Reset() { + *x = AlertInstance{} + mi := &file_rules_rulespb_rpc_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -var _Rules_serviceDesc = grpc.ServiceDesc{ - ServiceName: "thanos.Rules", - HandlerType: (*RulesServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Rules", - Handler: _Rules_Rules_Handler, - ServerStreams: true, - }, - }, - Metadata: "rules/rulespb/rpc.proto", +func (x *AlertInstance) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *RulesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RulesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RulesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.File) > 0 { - for iNdEx := len(m.File) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.File[iNdEx]) - copy(dAtA[i:], m.File[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.File[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(m.RuleGroup) > 0 { - for iNdEx := len(m.RuleGroup) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.RuleGroup[iNdEx]) - copy(dAtA[i:], m.RuleGroup[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.RuleGroup[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(m.RuleName) > 0 { - for iNdEx := len(m.RuleName) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.RuleName[iNdEx]) - copy(dAtA[i:], m.RuleName[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.RuleName[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.MatcherString) > 0 { - for iNdEx := len(m.MatcherString) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.MatcherString[iNdEx]) - copy(dAtA[i:], m.MatcherString[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.MatcherString[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if m.PartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) - i-- - dAtA[i] = 0x10 - } - if m.Type != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} +func (*AlertInstance) ProtoMessage() {} -func (m *RulesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RulesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RulesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Result != nil { - { - size := m.Result.Size() - i -= size - if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } +func (x *AlertInstance) ProtoReflect() protoreflect.Message { + mi := &file_rules_rulespb_rpc_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - return len(dAtA) - i, nil + return mi.MessageOf(x) } -func (m *RulesResponse_Group) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use AlertInstance.ProtoReflect.Descriptor instead. +func (*AlertInstance) Descriptor() ([]byte, []int) { + return file_rules_rulespb_rpc_proto_rawDescGZIP(), []int{5} } -func (m *RulesResponse_Group) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Group != nil { - { - size, err := m.Group.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa +func (x *AlertInstance) GetLabels() *labelpb.LabelSet { + if x != nil { + return x.Labels } - return len(dAtA) - i, nil -} -func (m *RulesResponse_Warning) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RulesResponse_Warning) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.Warning) - copy(dAtA[i:], m.Warning) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Warning))) - i-- - dAtA[i] = 0x12 - return len(dAtA) - i, nil -} -func (m *RuleGroups) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RuleGroups) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RuleGroups) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Groups) > 0 { - for iNdEx := len(m.Groups) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Groups[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil + return nil } -func (m *RuleGroup) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *AlertInstance) GetAnnotations() *labelpb.LabelSet { + if x != nil { + return x.Annotations } - return dAtA[:n], nil + return nil } -func (m *RuleGroup) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *AlertInstance) GetState() AlertState { + if x != nil { + return x.State + } + return AlertState_INACTIVE } -func (m *RuleGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Limit != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Limit)) - i-- - dAtA[i] = 0x48 +func (x *AlertInstance) GetActiveAt() *timestamppb.Timestamp { + if x != nil { + return x.ActiveAt } - if m.PartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) - i-- - dAtA[i] = 0x40 - } - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastEvaluation, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastEvaluation):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintRpc(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x32 - if m.EvaluationDurationSeconds != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.EvaluationDurationSeconds)))) - i-- - dAtA[i] = 0x29 - } - if m.Interval != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Interval)))) - i-- - dAtA[i] = 0x21 - } - if len(m.Rules) > 0 { - for iNdEx := len(m.Rules) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Rules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.File) > 0 { - i -= len(m.File) - copy(dAtA[i:], m.File) - i = encodeVarintRpc(dAtA, i, uint64(len(m.File))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return nil } -func (m *Rule) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *AlertInstance) GetValue() string { + if x != nil { + return x.Value } - return dAtA[:n], nil -} - -func (m *Rule) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Rule) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Result != nil { - { - size := m.Result.Size() - i -= size - if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil + return "" } -func (m *Rule_Recording) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *AlertInstance) GetPartialResponseStrategy() storepb.PartialResponseStrategy { + if x != nil { + return x.PartialResponseStrategy + } + return storepb.PartialResponseStrategy(0) } -func (m *Rule_Recording) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Recording != nil { - { - size, err := m.Recording.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *Rule_Alert) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Rule_Alert) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Alert != nil { - { - size, err := m.Alert.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *AlertInstance) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +type Alert struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // / state returns the maximum state of alert instances for this rule. + State AlertState `protobuf:"varint,1,opt,name=state,proto3,enum=thanos.AlertState" json:"state"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` + Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query"` + DurationSeconds float64 `protobuf:"fixed64,4,opt,name=duration_seconds,json=durationSeconds,proto3" json:"duration"` + Labels *labelpb.LabelSet `protobuf:"bytes,5,opt,name=labels,proto3" json:"labels"` + Annotations *labelpb.LabelSet `protobuf:"bytes,6,opt,name=annotations,proto3" json:"annotations"` + Alerts []*AlertInstance `protobuf:"bytes,7,rep,name=alerts,proto3" json:"alerts"` + Health string `protobuf:"bytes,8,opt,name=health,proto3" json:"health"` + LastError string `protobuf:"bytes,9,opt,name=last_error,json=lastError,proto3" json:"lastError,omitempty"` + EvaluationDurationSeconds float64 `protobuf:"fixed64,10,opt,name=evaluation_duration_seconds,json=evaluationDurationSeconds,proto3" json:"evaluationTime"` + LastEvaluation *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=last_evaluation,json=lastEvaluation,proto3" json:"lastEvaluation"` + KeepFiringForSeconds float64 `protobuf:"fixed64,12,opt,name=keep_firing_for_seconds,json=keepFiringForSeconds,proto3" json:"keepFiringFor"` } -func (m *AlertInstance) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *Alert) Reset() { + *x = Alert{} + mi := &file_rules_rulespb_rpc_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *AlertInstance) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) - i-- - dAtA[i] = 0x30 - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x2a - } - if m.ActiveAt != nil { - n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.ActiveAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.ActiveAt):]) - if err5 != nil { - return 0, err5 - } - i -= n5 - i = encodeVarintRpc(dAtA, i, uint64(n5)) - i-- - dAtA[i] = 0x22 - } - if m.State != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.State)) - i-- - dAtA[i] = 0x18 - } - { - size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.Labels.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil +func (x *Alert) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Alert) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (*Alert) ProtoMessage() {} + +func (x *Alert) ProtoReflect() protoreflect.Message { + mi := &file_rules_rulespb_rpc_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *Alert) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use Alert.ProtoReflect.Descriptor instead. +func (*Alert) Descriptor() ([]byte, []int) { + return file_rules_rulespb_rpc_proto_rawDescGZIP(), []int{6} } -func (m *Alert) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.KeepFiringForSeconds != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.KeepFiringForSeconds)))) - i-- - dAtA[i] = 0x61 - } - n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastEvaluation, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastEvaluation):]) - if err8 != nil { - return 0, err8 - } - i -= n8 - i = encodeVarintRpc(dAtA, i, uint64(n8)) - i-- - dAtA[i] = 0x5a - if m.EvaluationDurationSeconds != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.EvaluationDurationSeconds)))) - i-- - dAtA[i] = 0x51 +func (x *Alert) GetState() AlertState { + if x != nil { + return x.State } - if len(m.LastError) > 0 { - i -= len(m.LastError) - copy(dAtA[i:], m.LastError) - i = encodeVarintRpc(dAtA, i, uint64(len(m.LastError))) - i-- - dAtA[i] = 0x4a - } - if len(m.Health) > 0 { - i -= len(m.Health) - copy(dAtA[i:], m.Health) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Health))) - i-- - dAtA[i] = 0x42 - } - if len(m.Alerts) > 0 { - for iNdEx := len(m.Alerts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Alerts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - { - size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - { - size, err := m.Labels.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if m.DurationSeconds != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DurationSeconds)))) - i-- - dAtA[i] = 0x21 - } - if len(m.Query) > 0 { - i -= len(m.Query) - copy(dAtA[i:], m.Query) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Query))) - i-- - dAtA[i] = 0x1a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.State != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.State)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil + return AlertState_INACTIVE } -func (m *RecordingRule) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *Alert) GetName() string { + if x != nil { + return x.Name } - return dAtA[:n], nil + return "" } -func (m *RecordingRule) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *Alert) GetQuery() string { + if x != nil { + return x.Query + } + return "" } -func (m *RecordingRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n11, err11 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastEvaluation, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastEvaluation):]) - if err11 != nil { - return 0, err11 - } - i -= n11 - i = encodeVarintRpc(dAtA, i, uint64(n11)) - i-- - dAtA[i] = 0x3a - if m.EvaluationDurationSeconds != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.EvaluationDurationSeconds)))) - i-- - dAtA[i] = 0x31 +func (x *Alert) GetDurationSeconds() float64 { + if x != nil { + return x.DurationSeconds } - if len(m.LastError) > 0 { - i -= len(m.LastError) - copy(dAtA[i:], m.LastError) - i = encodeVarintRpc(dAtA, i, uint64(len(m.LastError))) - i-- - dAtA[i] = 0x2a - } - if len(m.Health) > 0 { - i -= len(m.Health) - copy(dAtA[i:], m.Health) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Health))) - i-- - dAtA[i] = 0x22 - } - { - size, err := m.Labels.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Query) > 0 { - i -= len(m.Query) - copy(dAtA[i:], m.Query) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Query))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return 0 } -func encodeVarintRpc(dAtA []byte, offset int, v uint64) int { - offset -= sovRpc(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (x *Alert) GetLabels() *labelpb.LabelSet { + if x != nil { + return x.Labels } - dAtA[offset] = uint8(v) - return base + return nil } -func (m *RulesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovRpc(uint64(m.Type)) - } - if m.PartialResponseStrategy != 0 { - n += 1 + sovRpc(uint64(m.PartialResponseStrategy)) - } - if len(m.MatcherString) > 0 { - for _, s := range m.MatcherString { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if len(m.RuleName) > 0 { - for _, s := range m.RuleName { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if len(m.RuleGroup) > 0 { - for _, s := range m.RuleGroup { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if len(m.File) > 0 { - for _, s := range m.File { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } + +func (x *Alert) GetAnnotations() *labelpb.LabelSet { + if x != nil { + return x.Annotations } - return n + return nil } -func (m *RulesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Result != nil { - n += m.Result.Size() +func (x *Alert) GetAlerts() []*AlertInstance { + if x != nil { + return x.Alerts } - return n + return nil } -func (m *RulesResponse_Group) Size() (n int) { - if m == nil { - return 0 +func (x *Alert) GetHealth() string { + if x != nil { + return x.Health } - var l int - _ = l - if m.Group != nil { - l = m.Group.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n + return "" } -func (m *RulesResponse_Warning) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Warning) - n += 1 + l + sovRpc(uint64(l)) - return n -} -func (m *RuleGroups) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Groups) > 0 { - for _, e := range m.Groups { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } + +func (x *Alert) GetLastError() string { + if x != nil { + return x.LastError } - return n + return "" } -func (m *RuleGroup) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.File) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Rules) > 0 { - for _, e := range m.Rules { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.Interval != 0 { - n += 9 - } - if m.EvaluationDurationSeconds != 0 { - n += 9 - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LastEvaluation) - n += 1 + l + sovRpc(uint64(l)) - if m.PartialResponseStrategy != 0 { - n += 1 + sovRpc(uint64(m.PartialResponseStrategy)) - } - if m.Limit != 0 { - n += 1 + sovRpc(uint64(m.Limit)) +func (x *Alert) GetEvaluationDurationSeconds() float64 { + if x != nil { + return x.EvaluationDurationSeconds } - return n + return 0 } -func (m *Rule) Size() (n int) { - if m == nil { - return 0 +func (x *Alert) GetLastEvaluation() *timestamppb.Timestamp { + if x != nil { + return x.LastEvaluation } - var l int - _ = l - if m.Result != nil { - n += m.Result.Size() - } - return n + return nil } -func (m *Rule_Recording) Size() (n int) { - if m == nil { - return 0 +func (x *Alert) GetKeepFiringForSeconds() float64 { + if x != nil { + return x.KeepFiringForSeconds } - var l int - _ = l - if m.Recording != nil { - l = m.Recording.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n + return 0 } -func (m *Rule_Alert) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Alert != nil { - l = m.Alert.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n + +type RecordingRule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` + Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query"` + Labels *labelpb.LabelSet `protobuf:"bytes,3,opt,name=labels,proto3" json:"labels"` + Health string `protobuf:"bytes,4,opt,name=health,proto3" json:"health"` + LastError string `protobuf:"bytes,5,opt,name=last_error,json=lastError,proto3" json:"lastError,omitempty"` + EvaluationDurationSeconds float64 `protobuf:"fixed64,6,opt,name=evaluation_duration_seconds,json=evaluationDurationSeconds,proto3" json:"evaluationTime"` + LastEvaluation *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=last_evaluation,json=lastEvaluation,proto3" json:"lastEvaluation"` } -func (m *AlertInstance) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Labels.Size() - n += 1 + l + sovRpc(uint64(l)) - l = m.Annotations.Size() - n += 1 + l + sovRpc(uint64(l)) - if m.State != 0 { - n += 1 + sovRpc(uint64(m.State)) - } - if m.ActiveAt != nil { - l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.ActiveAt) - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.PartialResponseStrategy != 0 { - n += 1 + sovRpc(uint64(m.PartialResponseStrategy)) - } - return n + +func (x *RecordingRule) Reset() { + *x = RecordingRule{} + mi := &file_rules_rulespb_rpc_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Alert) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.State != 0 { - n += 1 + sovRpc(uint64(m.State)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Query) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.DurationSeconds != 0 { - n += 9 - } - l = m.Labels.Size() - n += 1 + l + sovRpc(uint64(l)) - l = m.Annotations.Size() - n += 1 + l + sovRpc(uint64(l)) - if len(m.Alerts) > 0 { - for _, e := range m.Alerts { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - l = len(m.Health) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.LastError) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.EvaluationDurationSeconds != 0 { - n += 9 - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LastEvaluation) - n += 1 + l + sovRpc(uint64(l)) - if m.KeepFiringForSeconds != 0 { - n += 9 - } - return n +func (x *RecordingRule) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *RecordingRule) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Query) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = m.Labels.Size() - n += 1 + l + sovRpc(uint64(l)) - l = len(m.Health) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.LastError) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.EvaluationDurationSeconds != 0 { - n += 9 - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LastEvaluation) - n += 1 + l + sovRpc(uint64(l)) - return n -} - -func sovRpc(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRpc(x uint64) (n int) { - return sovRpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *RulesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RulesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RulesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= RulesRequest_Type(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) - } - m.PartialResponseStrategy = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PartialResponseStrategy |= storepb.PartialResponseStrategy(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MatcherString", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MatcherString = append(m.MatcherString, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RuleName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RuleName = append(m.RuleName, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RuleGroup", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RuleGroup = append(m.RuleGroup, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field File", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.File = append(m.File, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy +func (*RecordingRule) ProtoMessage() {} + +func (x *RecordingRule) ProtoReflect() protoreflect.Message { + mi := &file_rules_rulespb_rpc_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } + return mi.MessageOf(x) +} - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +// Deprecated: Use RecordingRule.ProtoReflect.Descriptor instead. +func (*RecordingRule) Descriptor() ([]byte, []int) { + return file_rules_rulespb_rpc_proto_rawDescGZIP(), []int{7} } -func (m *RulesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RulesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RulesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RuleGroup{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Result = &RulesResponse_Group{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Warning", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Result = &RulesResponse_Warning{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *RecordingRule) GetName() string { + if x != nil { + return x.Name } - return nil + return "" } -func (m *RuleGroups) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RuleGroups: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RuleGroups: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Groups", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Groups = append(m.Groups, &RuleGroup{}) - if err := m.Groups[len(m.Groups)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *RecordingRule) GetQuery() string { + if x != nil { + return x.Query } - return nil + return "" } -func (m *RuleGroup) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RuleGroup: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RuleGroup: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field File", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.File = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Rules = append(m.Rules, &Rule{}) - if err := m.Rules[len(m.Rules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Interval = float64(math.Float64frombits(v)) - case 5: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field EvaluationDurationSeconds", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.EvaluationDurationSeconds = float64(math.Float64frombits(v)) - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastEvaluation", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.LastEvaluation, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) - } - m.PartialResponseStrategy = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PartialResponseStrategy |= storepb.PartialResponseStrategy(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) - } - m.Limit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Limit |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *RecordingRule) GetLabels() *labelpb.LabelSet { + if x != nil { + return x.Labels } return nil } -func (m *Rule) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Rule: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Rule: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Recording", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RecordingRule{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Result = &Rule_Recording{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Alert", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Alert{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Result = &Rule_Alert{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *RecordingRule) GetHealth() string { + if x != nil { + return x.Health } - return nil + return "" } -func (m *AlertInstance) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AlertInstance: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AlertInstance: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Labels.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Annotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - m.State = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.State |= AlertState(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActiveAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ActiveAt == nil { - m.ActiveAt = new(time.Time) - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.ActiveAt, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) - } - m.PartialResponseStrategy = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PartialResponseStrategy |= storepb.PartialResponseStrategy(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *RecordingRule) GetLastError() string { + if x != nil { + return x.LastError } - return nil + return "" } -func (m *Alert) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Alert: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Alert: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - m.State = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.State |= AlertState(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Query = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationSeconds", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.DurationSeconds = float64(math.Float64frombits(v)) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Labels.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Annotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Alerts", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Alerts = append(m.Alerts, &AlertInstance{}) - if err := m.Alerts[len(m.Alerts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Health", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Health = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastError", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LastError = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 10: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field EvaluationDurationSeconds", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.EvaluationDurationSeconds = float64(math.Float64frombits(v)) - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastEvaluation", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.LastEvaluation, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field KeepFiringForSeconds", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.KeepFiringForSeconds = float64(math.Float64frombits(v)) - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *RecordingRule) GetEvaluationDurationSeconds() float64 { + if x != nil { + return x.EvaluationDurationSeconds } - return nil + return 0 } -func (m *RecordingRule) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RecordingRule: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RecordingRule: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Query = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Labels.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Health", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Health = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastError", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LastError = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field EvaluationDurationSeconds", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.EvaluationDurationSeconds = float64(math.Float64frombits(v)) - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastEvaluation", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.LastEvaluation, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *RecordingRule) GetLastEvaluation() *timestamppb.Timestamp { + if x != nil { + return x.LastEvaluation } return nil } -func skipRpc(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthRpc - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRpc - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRpc - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF + +var File_rules_rulespb_rpc_proto protoreflect.FileDescriptor + +var file_rules_rulespb_rpc_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x70, 0x62, 0x2f, + 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x74, 0x68, 0x61, 0x6e, 0x6f, + 0x73, 0x1a, 0x19, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x2f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x70, 0x62, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, + 0x2f, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb9, 0x02, + 0x0a, 0x0c, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x74, + 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x5b, 0x0a, + 0x19, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, + 0x79, 0x52, 0x17, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x72, 0x75, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, + 0x0a, 0x0a, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x09, 0x72, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x12, 0x0a, + 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x66, 0x69, 0x6c, + 0x65, 0x22, 0x26, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4c, 0x4c, + 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x45, 0x52, 0x54, 0x10, 0x01, 0x12, 0x0a, 0x0a, + 0x06, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x10, 0x02, 0x22, 0x60, 0x0a, 0x0d, 0x52, 0x75, 0x6c, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x05, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x68, 0x61, 0x6e, + 0x6f, 0x73, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x48, 0x00, 0x52, 0x05, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1a, 0x0a, 0x07, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, + 0x67, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x4b, 0x0a, 0x0a, 0x52, + 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x3d, 0x0a, 0x06, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x68, 0x61, 0x6e, + 0x6f, 0x73, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x12, 0x9a, 0x84, + 0x9e, 0x03, 0x0d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, + 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0xa6, 0x04, 0x0a, 0x09, 0x52, 0x75, 0x6c, + 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x24, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0x9a, 0x84, 0x9e, 0x03, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x04, + 0x66, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0x9a, 0x84, 0x9e, 0x03, + 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x52, 0x04, 0x66, 0x69, + 0x6c, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x42, + 0x11, 0x9a, 0x84, 0x9e, 0x03, 0x0c, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x75, 0x6c, 0x65, + 0x73, 0x22, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x08, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x42, 0x14, 0x9a, 0x84, 0x9e, + 0x03, 0x0f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, + 0x22, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x5a, 0x0a, 0x1b, 0x65, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, + 0x42, 0x1a, 0x9a, 0x84, 0x9e, 0x03, 0x15, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x65, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x52, 0x19, 0x65, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x5f, 0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x5f, + 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x1a, 0x9a, 0x84, + 0x9e, 0x03, 0x15, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6c, 0x61, 0x73, 0x74, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x52, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x45, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x42, 0x11, 0x9a, 0x84, 0x9e, 0x03, 0x0c, 0x6a, 0x73, + 0x6f, 0x6e, 0x3a, 0x22, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x12, 0x7e, 0x0a, 0x17, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x50, 0x61, 0x72, 0x74, + 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x72, 0x61, 0x74, + 0x65, 0x67, 0x79, 0x42, 0x23, 0x9a, 0x84, 0x9e, 0x03, 0x1e, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, + 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, + 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x22, 0x52, 0x17, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, + 0x79, 0x22, 0x6e, 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x35, 0x0a, 0x09, 0x72, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, + 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x52, + 0x75, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x09, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x67, + 0x12, 0x25, 0x0a, 0x05, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0d, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x48, 0x00, + 0x52, 0x05, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x22, 0xd9, 0x03, 0x0a, 0x0d, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x53, 0x65, 0x74, 0x42, 0x12, 0x9a, 0x84, 0x9e, 0x03, 0x0d, 0x6a, 0x73, 0x6f, 0x6e, + 0x3a, 0x22, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x12, 0x4b, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x74, 0x42, 0x17, 0x9a, 0x84, 0x9e, 0x03, 0x12, 0x6a, + 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x22, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3b, + 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, + 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x42, 0x11, 0x9a, 0x84, 0x9e, 0x03, 0x0c, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x22, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x57, 0x0a, 0x09, 0x61, + 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x1e, 0x9a, 0x84, 0x9e, 0x03, + 0x19, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x41, 0x74, 0x2c, + 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x52, 0x08, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x41, 0x74, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x11, 0x9a, 0x84, 0x9e, 0x03, 0x0c, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x7e, 0x0a, + 0x17, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, + 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x42, + 0x23, 0x9a, 0x84, 0x9e, 0x03, 0x1e, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x70, 0x61, 0x72, 0x74, + 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x72, 0x61, 0x74, + 0x65, 0x67, 0x79, 0x22, 0x52, 0x17, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x22, 0x9d, 0x06, + 0x0a, 0x05, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x12, 0x3b, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, + 0x41, 0x6c, 0x65, 0x72, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x11, 0x9a, 0x84, 0x9e, 0x03, + 0x0c, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x52, 0x05, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x10, 0x9a, 0x84, 0x9e, 0x03, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x11, 0x9a, 0x84, 0x9e, 0x03, 0x0c, + 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x52, 0x05, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x12, 0x3f, 0x0a, 0x10, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x42, 0x14, 0x9a, + 0x84, 0x9e, 0x03, 0x0f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x52, 0x0f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, + 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x3c, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x53, 0x65, 0x74, 0x42, 0x12, 0x9a, 0x84, 0x9e, 0x03, 0x0d, 0x6a, 0x73, 0x6f, + 0x6e, 0x3a, 0x22, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x12, 0x4b, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, + 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x74, 0x42, 0x17, 0x9a, 0x84, 0x9e, 0x03, 0x12, + 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x22, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x41, 0x0a, 0x06, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x15, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x42, 0x12, 0x9a, 0x84, 0x9e, 0x03, 0x0d, 0x6a, 0x73, 0x6f, + 0x6e, 0x3a, 0x22, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x22, 0x52, 0x06, 0x61, 0x6c, 0x65, 0x72, + 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x12, 0x9a, 0x84, 0x9e, 0x03, 0x0d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x68, + 0x65, 0x61, 0x6c, 0x74, 0x68, 0x22, 0x52, 0x06, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x3e, + 0x0a, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x1f, 0x9a, 0x84, 0x9e, 0x03, 0x1a, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6c, + 0x61, 0x73, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, + 0x74, 0x79, 0x22, 0x52, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x5a, + 0x0a, 0x1b, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x01, 0x42, 0x1a, 0x9a, 0x84, 0x9e, 0x03, 0x15, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, + 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x52, + 0x19, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x5f, 0x0a, 0x0f, 0x6c, 0x61, + 0x73, 0x74, 0x5f, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, + 0x1a, 0x9a, 0x84, 0x9e, 0x03, 0x15, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6c, 0x61, 0x73, 0x74, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x52, 0x0e, 0x6c, 0x61, 0x73, + 0x74, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x50, 0x0a, 0x17, 0x6b, + 0x65, 0x65, 0x70, 0x5f, 0x66, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x73, + 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x01, 0x42, 0x19, 0x9a, 0x84, + 0x9e, 0x03, 0x14, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6b, 0x65, 0x65, 0x70, 0x46, 0x69, 0x72, + 0x69, 0x6e, 0x67, 0x46, 0x6f, 0x72, 0x22, 0x52, 0x14, 0x6b, 0x65, 0x65, 0x70, 0x46, 0x69, 0x72, + 0x69, 0x6e, 0x67, 0x46, 0x6f, 0x72, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x22, 0xc5, 0x03, + 0x0a, 0x0d, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x12, + 0x24, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0x9a, + 0x84, 0x9e, 0x03, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x11, 0x9a, 0x84, 0x9e, 0x03, 0x0c, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x22, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3c, + 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, + 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x74, + 0x42, 0x12, 0x9a, 0x84, 0x9e, 0x03, 0x0d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x22, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x2a, 0x0a, 0x06, + 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x12, 0x9a, 0x84, + 0x9e, 0x03, 0x0d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x22, + 0x52, 0x06, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x3e, 0x0a, 0x0a, 0x6c, 0x61, 0x73, 0x74, + 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0x9a, 0x84, + 0x9e, 0x03, 0x1a, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6c, 0x61, 0x73, 0x74, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x52, 0x09, 0x6c, + 0x61, 0x73, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x5a, 0x0a, 0x1b, 0x65, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x42, 0x1a, 0x9a, + 0x84, 0x9e, 0x03, 0x15, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x52, 0x19, 0x65, 0x76, 0x61, 0x6c, 0x75, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, + 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x5f, 0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x65, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x1a, 0x9a, 0x84, 0x9e, 0x03, 0x15, + 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6c, 0x61, 0x73, 0x74, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x52, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x45, 0x76, 0x61, 0x6c, 0x75, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x33, 0x0a, 0x0a, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, + 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0a, + 0x0a, 0x06, 0x46, 0x49, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x32, 0x3f, 0x0a, 0x05, 0x52, 0x75, + 0x6c, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x05, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x14, 0x2e, 0x74, + 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x52, 0x75, 0x6c, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, 0x2f, 0x5a, 0x2d, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, + 0x2d, 0x69, 0x6f, 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x72, + 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( - ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRpc = fmt.Errorf("proto: unexpected end of group") + file_rules_rulespb_rpc_proto_rawDescOnce sync.Once + file_rules_rulespb_rpc_proto_rawDescData = file_rules_rulespb_rpc_proto_rawDesc ) + +func file_rules_rulespb_rpc_proto_rawDescGZIP() []byte { + file_rules_rulespb_rpc_proto_rawDescOnce.Do(func() { + file_rules_rulespb_rpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_rules_rulespb_rpc_proto_rawDescData) + }) + return file_rules_rulespb_rpc_proto_rawDescData +} + +var file_rules_rulespb_rpc_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_rules_rulespb_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_rules_rulespb_rpc_proto_goTypes = []any{ + (AlertState)(0), // 0: thanos.AlertState + (RulesRequest_Type)(0), // 1: thanos.RulesRequest.Type + (*RulesRequest)(nil), // 2: thanos.RulesRequest + (*RulesResponse)(nil), // 3: thanos.RulesResponse + (*RuleGroups)(nil), // 4: thanos.RuleGroups + (*RuleGroup)(nil), // 5: thanos.RuleGroup + (*Rule)(nil), // 6: thanos.Rule + (*AlertInstance)(nil), // 7: thanos.AlertInstance + (*Alert)(nil), // 8: thanos.Alert + (*RecordingRule)(nil), // 9: thanos.RecordingRule + (storepb.PartialResponseStrategy)(0), // 10: thanos.PartialResponseStrategy + (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp + (*labelpb.LabelSet)(nil), // 12: thanos.LabelSet +} +var file_rules_rulespb_rpc_proto_depIdxs = []int32{ + 1, // 0: thanos.RulesRequest.type:type_name -> thanos.RulesRequest.Type + 10, // 1: thanos.RulesRequest.partial_response_strategy:type_name -> thanos.PartialResponseStrategy + 5, // 2: thanos.RulesResponse.group:type_name -> thanos.RuleGroup + 5, // 3: thanos.RuleGroups.groups:type_name -> thanos.RuleGroup + 6, // 4: thanos.RuleGroup.rules:type_name -> thanos.Rule + 11, // 5: thanos.RuleGroup.last_evaluation:type_name -> google.protobuf.Timestamp + 10, // 6: thanos.RuleGroup.PartialResponseStrategy:type_name -> thanos.PartialResponseStrategy + 9, // 7: thanos.Rule.recording:type_name -> thanos.RecordingRule + 8, // 8: thanos.Rule.alert:type_name -> thanos.Alert + 12, // 9: thanos.AlertInstance.labels:type_name -> thanos.LabelSet + 12, // 10: thanos.AlertInstance.annotations:type_name -> thanos.LabelSet + 0, // 11: thanos.AlertInstance.state:type_name -> thanos.AlertState + 11, // 12: thanos.AlertInstance.active_at:type_name -> google.protobuf.Timestamp + 10, // 13: thanos.AlertInstance.PartialResponseStrategy:type_name -> thanos.PartialResponseStrategy + 0, // 14: thanos.Alert.state:type_name -> thanos.AlertState + 12, // 15: thanos.Alert.labels:type_name -> thanos.LabelSet + 12, // 16: thanos.Alert.annotations:type_name -> thanos.LabelSet + 7, // 17: thanos.Alert.alerts:type_name -> thanos.AlertInstance + 11, // 18: thanos.Alert.last_evaluation:type_name -> google.protobuf.Timestamp + 12, // 19: thanos.RecordingRule.labels:type_name -> thanos.LabelSet + 11, // 20: thanos.RecordingRule.last_evaluation:type_name -> google.protobuf.Timestamp + 2, // 21: thanos.Rules.Rules:input_type -> thanos.RulesRequest + 3, // 22: thanos.Rules.Rules:output_type -> thanos.RulesResponse + 22, // [22:23] is the sub-list for method output_type + 21, // [21:22] is the sub-list for method input_type + 21, // [21:21] is the sub-list for extension type_name + 21, // [21:21] is the sub-list for extension extendee + 0, // [0:21] is the sub-list for field type_name +} + +func init() { file_rules_rulespb_rpc_proto_init() } +func file_rules_rulespb_rpc_proto_init() { + if File_rules_rulespb_rpc_proto != nil { + return + } + file_rules_rulespb_rpc_proto_msgTypes[1].OneofWrappers = []any{ + (*RulesResponse_Group)(nil), + (*RulesResponse_Warning)(nil), + } + file_rules_rulespb_rpc_proto_msgTypes[4].OneofWrappers = []any{ + (*Rule_Recording)(nil), + (*Rule_Alert)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rules_rulespb_rpc_proto_rawDesc, + NumEnums: 2, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_rules_rulespb_rpc_proto_goTypes, + DependencyIndexes: file_rules_rulespb_rpc_proto_depIdxs, + EnumInfos: file_rules_rulespb_rpc_proto_enumTypes, + MessageInfos: file_rules_rulespb_rpc_proto_msgTypes, + }.Build() + File_rules_rulespb_rpc_proto = out.File + file_rules_rulespb_rpc_proto_rawDesc = nil + file_rules_rulespb_rpc_proto_goTypes = nil + file_rules_rulespb_rpc_proto_depIdxs = nil +} diff --git a/pkg/rules/rulespb/rpc.proto b/pkg/rules/rulespb/rpc.proto index f5fc8a038bb..c96f8f8b1fe 100644 --- a/pkg/rules/rulespb/rpc.proto +++ b/pkg/rules/rulespb/rpc.proto @@ -6,21 +6,10 @@ package thanos; import "store/storepb/types.proto"; import "store/labelpb/types.proto"; -import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; +import "tagger/tagger.proto"; -option go_package = "rulespb"; - -option (gogoproto.sizer_all) = true; -option (gogoproto.marshaler_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; +option go_package = "github.com/thanos-io/thanos/pkg/rules/rulespb"; /// Rules represents API that is responsible for gathering rules and their statuses. service Rules { @@ -65,21 +54,21 @@ message RulesResponse { /// /// For rule parsing from YAML configuration other struct is used: https://github.com/prometheus/prometheus/blob/20b1f596f6fb16107ef0c244d240b0ad6da36829/pkg/rulefmt/rulefmt.go#L105 message RuleGroups { - repeated RuleGroup groups = 1 [(gogoproto.jsontag) = "groups" ]; + repeated RuleGroup groups = 1 [(tagger.tags) = "json:\"groups\""]; } /// RuleGroup has info for rules which are part of a group. message RuleGroup { - string name = 1 [(gogoproto.jsontag) = "name" ]; - string file = 2 [(gogoproto.jsontag) = "file" ]; - repeated Rule rules = 3 [(gogoproto.jsontag) = "rules" ]; - double interval = 4 [(gogoproto.jsontag) = "interval" ]; - double evaluation_duration_seconds = 5 [(gogoproto.jsontag) = "evaluationTime" ]; // TODO: Is it really second? - google.protobuf.Timestamp last_evaluation = 6 [(gogoproto.jsontag) = "lastEvaluation", (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; - int64 limit = 9 [(gogoproto.jsontag) = "limit" ]; + string name = 1 [(tagger.tags) = "json:\"name\""]; + string file = 2 [(tagger.tags) = "json:\"file\""]; + repeated Rule rules = 3 [(tagger.tags) = "json:\"rules\""]; + double interval = 4 [(tagger.tags) = "json:\"interval\""]; + double evaluation_duration_seconds = 5 [(tagger.tags) = "json:\"evaluationTime\""]; // TODO: Is it really second? + google.protobuf.Timestamp last_evaluation = 6 [(tagger.tags) = "json:\"lastEvaluation\""]; + int64 limit = 9 [(tagger.tags) = "json:\"limit\""]; // Thanos specific. - PartialResponseStrategy PartialResponseStrategy = 8 [(gogoproto.jsontag) = "partialResponseStrategy" ]; + PartialResponseStrategy PartialResponseStrategy = 8 [(tagger.tags) = "json:\"partialResponseStrategy\""]; } message Rule { @@ -106,38 +95,38 @@ enum AlertState { } message AlertInstance { - ZLabelSet labels = 1 [(gogoproto.jsontag) = "labels", (gogoproto.nullable) = false ]; - ZLabelSet annotations = 2 [(gogoproto.jsontag) = "annotations", (gogoproto.nullable) = false ]; - AlertState state = 3 [(gogoproto.jsontag) = "state" ]; - google.protobuf.Timestamp active_at = 4 [(gogoproto.jsontag) = "activeAt,omitempty", (gogoproto.stdtime) = true]; - string value = 5 [(gogoproto.jsontag) = "value" ]; + LabelSet labels = 1 [(tagger.tags) = "json:\"labels\""]; + LabelSet annotations = 2 [(tagger.tags) = "json:\"annotations\""]; + AlertState state = 3 [(tagger.tags) = "json:\"state\""]; + google.protobuf.Timestamp active_at = 4 [(tagger.tags) = "json:\"activeAt,omitempty\""]; + string value = 5 [(tagger.tags) = "json:\"value\""]; // Thanos specific. Used mainly for alert API purposes. - PartialResponseStrategy PartialResponseStrategy = 6 [(gogoproto.jsontag) = "partialResponseStrategy" ]; + PartialResponseStrategy PartialResponseStrategy = 6 [(tagger.tags) = "json:\"partialResponseStrategy\""]; } message Alert { /// state returns the maximum state of alert instances for this rule. - AlertState state = 1 [(gogoproto.jsontag) = "state" ]; - string name = 2 [(gogoproto.jsontag) = "name" ]; - string query = 3 [(gogoproto.jsontag) = "query" ]; - double duration_seconds = 4 [(gogoproto.jsontag) = "duration" ]; - ZLabelSet labels = 5 [(gogoproto.jsontag) = "labels", (gogoproto.nullable) = false ]; - ZLabelSet annotations = 6 [(gogoproto.jsontag) = "annotations", (gogoproto.nullable) = false ]; - repeated AlertInstance alerts = 7 [(gogoproto.jsontag) = "alerts" ]; - string health = 8 [(gogoproto.jsontag) = "health" ]; - string last_error = 9 [(gogoproto.jsontag) = "lastError,omitempty" ]; - double evaluation_duration_seconds = 10 [(gogoproto.jsontag) = "evaluationTime" ]; - google.protobuf.Timestamp last_evaluation = 11 [(gogoproto.jsontag) = "lastEvaluation", (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; - double keep_firing_for_seconds = 12 [(gogoproto.jsontag) = "keepFiringFor" ]; + AlertState state = 1 [(tagger.tags) = "json:\"state\""]; + string name = 2 [(tagger.tags) = "json:\"name\""]; + string query = 3 [(tagger.tags) = "json:\"query\""]; + double duration_seconds = 4 [(tagger.tags) = "json:\"duration\""]; + LabelSet labels = 5 [(tagger.tags) = "json:\"labels\""]; + LabelSet annotations = 6 [(tagger.tags) = "json:\"annotations\""]; + repeated AlertInstance alerts = 7 [(tagger.tags) = "json:\"alerts\""]; + string health = 8 [(tagger.tags) = "json:\"health\""]; + string last_error = 9 [(tagger.tags) = "json:\"lastError,omitempty\""]; + double evaluation_duration_seconds = 10 [(tagger.tags) = "json:\"evaluationTime\""]; + google.protobuf.Timestamp last_evaluation = 11 [(tagger.tags) = "json:\"lastEvaluation\""]; + double keep_firing_for_seconds = 12 [(tagger.tags) = "json:\"keepFiringFor\""]; } message RecordingRule { - string name = 1 [(gogoproto.jsontag) = "name" ]; - string query = 2 [(gogoproto.jsontag) = "query" ]; - ZLabelSet labels = 3 [(gogoproto.jsontag) = "labels", (gogoproto.nullable) = false ]; - string health = 4 [(gogoproto.jsontag) = "health" ]; - string last_error = 5 [(gogoproto.jsontag) = "lastError,omitempty" ]; - double evaluation_duration_seconds = 6 [(gogoproto.jsontag) = "evaluationTime" ]; - google.protobuf.Timestamp last_evaluation = 7 [(gogoproto.jsontag) = "lastEvaluation", (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + string name = 1 [(tagger.tags) = "json:\"name\""]; + string query = 2 [(tagger.tags) = "json:\"query\""]; + LabelSet labels = 3 [(tagger.tags) = "json:\"labels\""]; + string health = 4 [(tagger.tags) = "json:\"health\""]; + string last_error = 5 [(tagger.tags) = "json:\"lastError,omitempty\""]; + double evaluation_duration_seconds = 6 [(tagger.tags) = "json:\"evaluationTime\""]; + google.protobuf.Timestamp last_evaluation = 7 [(tagger.tags) = "json:\"lastEvaluation\""]; } diff --git a/pkg/rules/rulespb/rpc_grpc.pb.go b/pkg/rules/rulespb/rpc_grpc.pb.go new file mode 100644 index 00000000000..e4fdee112d4 --- /dev/null +++ b/pkg/rules/rulespb/rpc_grpc.pb.go @@ -0,0 +1,136 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v3.20.1 +// source: rules/rulespb/rpc.proto + +package rulespb + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Rules_Rules_FullMethodName = "/thanos.Rules/Rules" +) + +// RulesClient is the client API for Rules service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// / Rules represents API that is responsible for gathering rules and their statuses. +type RulesClient interface { + // / Rules has info for all rules. + // / Returned rules are expected to include external labels. + Rules(ctx context.Context, in *RulesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RulesResponse], error) +} + +type rulesClient struct { + cc grpc.ClientConnInterface +} + +func NewRulesClient(cc grpc.ClientConnInterface) RulesClient { + return &rulesClient{cc} +} + +func (c *rulesClient) Rules(ctx context.Context, in *RulesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RulesResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &Rules_ServiceDesc.Streams[0], Rules_Rules_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[RulesRequest, RulesResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Rules_RulesClient = grpc.ServerStreamingClient[RulesResponse] + +// RulesServer is the server API for Rules service. +// All implementations must embed UnimplementedRulesServer +// for forward compatibility. +// +// / Rules represents API that is responsible for gathering rules and their statuses. +type RulesServer interface { + // / Rules has info for all rules. + // / Returned rules are expected to include external labels. + Rules(*RulesRequest, grpc.ServerStreamingServer[RulesResponse]) error + mustEmbedUnimplementedRulesServer() +} + +// UnimplementedRulesServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedRulesServer struct{} + +func (UnimplementedRulesServer) Rules(*RulesRequest, grpc.ServerStreamingServer[RulesResponse]) error { + return status.Errorf(codes.Unimplemented, "method Rules not implemented") +} +func (UnimplementedRulesServer) mustEmbedUnimplementedRulesServer() {} +func (UnimplementedRulesServer) testEmbeddedByValue() {} + +// UnsafeRulesServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RulesServer will +// result in compilation errors. +type UnsafeRulesServer interface { + mustEmbedUnimplementedRulesServer() +} + +func RegisterRulesServer(s grpc.ServiceRegistrar, srv RulesServer) { + // If the following call pancis, it indicates UnimplementedRulesServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Rules_ServiceDesc, srv) +} + +func _Rules_Rules_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(RulesRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(RulesServer).Rules(m, &grpc.GenericServerStream[RulesRequest, RulesResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Rules_RulesServer = grpc.ServerStreamingServer[RulesResponse] + +// Rules_ServiceDesc is the grpc.ServiceDesc for Rules service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Rules_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "thanos.Rules", + HandlerType: (*RulesServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Rules", + Handler: _Rules_Rules_Handler, + ServerStreams: true, + }, + }, + Metadata: "rules/rulespb/rpc.proto", +} diff --git a/pkg/rules/rulespb/rpc_vtproto.pb.go b/pkg/rules/rulespb/rpc_vtproto.pb.go new file mode 100644 index 00000000000..ff8361005f7 --- /dev/null +++ b/pkg/rules/rulespb/rpc_vtproto.pb.go @@ -0,0 +1,3262 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.1-0.20250313105119-ba97887b0a25 +// source: rules/rulespb/rpc.proto + +package rulespb + +import ( + binary "encoding/binary" + fmt "fmt" + io "io" + math "math" + + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + timestamppb1 "github.com/planetscale/vtprotobuf/types/known/timestamppb" + labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" + storepb "github.com/thanos-io/thanos/pkg/store/storepb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *RulesRequest) CloneVT() *RulesRequest { + if m == nil { + return (*RulesRequest)(nil) + } + r := new(RulesRequest) + r.Type = m.Type + r.PartialResponseStrategy = m.PartialResponseStrategy + if rhs := m.MatcherString; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.MatcherString = tmpContainer + } + if rhs := m.RuleName; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.RuleName = tmpContainer + } + if rhs := m.RuleGroup; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.RuleGroup = tmpContainer + } + if rhs := m.File; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.File = tmpContainer + } + return r +} + +func (m *RulesRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *RulesResponse) CloneVT() *RulesResponse { + if m == nil { + return (*RulesResponse)(nil) + } + r := new(RulesResponse) + if m.Result != nil { + r.Result = m.Result.(interface{ CloneVT() isRulesResponse_Result }).CloneVT() + } + return r +} + +func (m *RulesResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *RulesResponse_Group) CloneVT() isRulesResponse_Result { + if m == nil { + return (*RulesResponse_Group)(nil) + } + r := new(RulesResponse_Group) + r.Group = m.Group.CloneVT() + return r +} + +func (m *RulesResponse_Warning) CloneVT() isRulesResponse_Result { + if m == nil { + return (*RulesResponse_Warning)(nil) + } + r := new(RulesResponse_Warning) + r.Warning = m.Warning + return r +} + +func (m *RuleGroups) CloneVT() *RuleGroups { + if m == nil { + return (*RuleGroups)(nil) + } + r := new(RuleGroups) + if rhs := m.Groups; rhs != nil { + tmpContainer := make([]*RuleGroup, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Groups = tmpContainer + } + return r +} + +func (m *RuleGroups) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *RuleGroup) CloneVT() *RuleGroup { + if m == nil { + return (*RuleGroup)(nil) + } + r := new(RuleGroup) + r.Name = m.Name + r.File = m.File + r.Interval = m.Interval + r.EvaluationDurationSeconds = m.EvaluationDurationSeconds + r.LastEvaluation = (*timestamppb.Timestamp)((*timestamppb1.Timestamp)(m.LastEvaluation).CloneVT()) + r.Limit = m.Limit + r.PartialResponseStrategy = m.PartialResponseStrategy + if rhs := m.Rules; rhs != nil { + tmpContainer := make([]*Rule, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Rules = tmpContainer + } + return r +} + +func (m *RuleGroup) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Rule) CloneVT() *Rule { + if m == nil { + return (*Rule)(nil) + } + r := new(Rule) + if m.Result != nil { + r.Result = m.Result.(interface{ CloneVT() isRule_Result }).CloneVT() + } + return r +} + +func (m *Rule) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Rule_Recording) CloneVT() isRule_Result { + if m == nil { + return (*Rule_Recording)(nil) + } + r := new(Rule_Recording) + r.Recording = m.Recording.CloneVT() + return r +} + +func (m *Rule_Alert) CloneVT() isRule_Result { + if m == nil { + return (*Rule_Alert)(nil) + } + r := new(Rule_Alert) + r.Alert = m.Alert.CloneVT() + return r +} + +func (m *AlertInstance) CloneVT() *AlertInstance { + if m == nil { + return (*AlertInstance)(nil) + } + r := new(AlertInstance) + r.Labels = m.Labels.CloneVT() + r.Annotations = m.Annotations.CloneVT() + r.State = m.State + r.ActiveAt = (*timestamppb.Timestamp)((*timestamppb1.Timestamp)(m.ActiveAt).CloneVT()) + r.Value = m.Value + r.PartialResponseStrategy = m.PartialResponseStrategy + return r +} + +func (m *AlertInstance) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Alert) CloneVT() *Alert { + if m == nil { + return (*Alert)(nil) + } + r := new(Alert) + r.State = m.State + r.Name = m.Name + r.Query = m.Query + r.DurationSeconds = m.DurationSeconds + r.Labels = m.Labels.CloneVT() + r.Annotations = m.Annotations.CloneVT() + r.Health = m.Health + r.LastError = m.LastError + r.EvaluationDurationSeconds = m.EvaluationDurationSeconds + r.LastEvaluation = (*timestamppb.Timestamp)((*timestamppb1.Timestamp)(m.LastEvaluation).CloneVT()) + r.KeepFiringForSeconds = m.KeepFiringForSeconds + if rhs := m.Alerts; rhs != nil { + tmpContainer := make([]*AlertInstance, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Alerts = tmpContainer + } + return r +} + +func (m *Alert) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *RecordingRule) CloneVT() *RecordingRule { + if m == nil { + return (*RecordingRule)(nil) + } + r := new(RecordingRule) + r.Name = m.Name + r.Query = m.Query + r.Labels = m.Labels.CloneVT() + r.Health = m.Health + r.LastError = m.LastError + r.EvaluationDurationSeconds = m.EvaluationDurationSeconds + r.LastEvaluation = (*timestamppb.Timestamp)((*timestamppb1.Timestamp)(m.LastEvaluation).CloneVT()) + return r +} + +func (m *RecordingRule) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *RulesRequest) EqualVT(that *RulesRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Type != that.Type { + return false + } + if this.PartialResponseStrategy != that.PartialResponseStrategy { + return false + } + if len(this.MatcherString) != len(that.MatcherString) { + return false + } + for i, vx := range this.MatcherString { + vy := that.MatcherString[i] + if vx != vy { + return false + } + } + if len(this.RuleName) != len(that.RuleName) { + return false + } + for i, vx := range this.RuleName { + vy := that.RuleName[i] + if vx != vy { + return false + } + } + if len(this.RuleGroup) != len(that.RuleGroup) { + return false + } + for i, vx := range this.RuleGroup { + vy := that.RuleGroup[i] + if vx != vy { + return false + } + } + if len(this.File) != len(that.File) { + return false + } + for i, vx := range this.File { + vy := that.File[i] + if vx != vy { + return false + } + } + return true +} + +func (this *RulesRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*RulesRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *RulesResponse) EqualVT(that *RulesResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Result == nil && that.Result != nil { + return false + } else if this.Result != nil { + if that.Result == nil { + return false + } + if !this.Result.(interface { + EqualVT(isRulesResponse_Result) bool + }).EqualVT(that.Result) { + return false + } + } + return true +} + +func (this *RulesResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*RulesResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *RulesResponse_Group) EqualVT(thatIface isRulesResponse_Result) bool { + that, ok := thatIface.(*RulesResponse_Group) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Group, that.Group; p != q { + if p == nil { + p = &RuleGroup{} + } + if q == nil { + q = &RuleGroup{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *RulesResponse_Warning) EqualVT(thatIface isRulesResponse_Result) bool { + that, ok := thatIface.(*RulesResponse_Warning) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.Warning != that.Warning { + return false + } + return true +} + +func (this *RuleGroups) EqualVT(that *RuleGroups) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Groups) != len(that.Groups) { + return false + } + for i, vx := range this.Groups { + vy := that.Groups[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &RuleGroup{} + } + if q == nil { + q = &RuleGroup{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *RuleGroups) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*RuleGroups) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *RuleGroup) EqualVT(that *RuleGroup) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Name != that.Name { + return false + } + if this.File != that.File { + return false + } + if len(this.Rules) != len(that.Rules) { + return false + } + for i, vx := range this.Rules { + vy := that.Rules[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Rule{} + } + if q == nil { + q = &Rule{} + } + if !p.EqualVT(q) { + return false + } + } + } + if this.Interval != that.Interval { + return false + } + if this.EvaluationDurationSeconds != that.EvaluationDurationSeconds { + return false + } + if !(*timestamppb1.Timestamp)(this.LastEvaluation).EqualVT((*timestamppb1.Timestamp)(that.LastEvaluation)) { + return false + } + if this.PartialResponseStrategy != that.PartialResponseStrategy { + return false + } + if this.Limit != that.Limit { + return false + } + return true +} + +func (this *RuleGroup) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*RuleGroup) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Rule) EqualVT(that *Rule) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Result == nil && that.Result != nil { + return false + } else if this.Result != nil { + if that.Result == nil { + return false + } + if !this.Result.(interface{ EqualVT(isRule_Result) bool }).EqualVT(that.Result) { + return false + } + } + return true +} + +func (this *Rule) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Rule) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Rule_Recording) EqualVT(thatIface isRule_Result) bool { + that, ok := thatIface.(*Rule_Recording) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Recording, that.Recording; p != q { + if p == nil { + p = &RecordingRule{} + } + if q == nil { + q = &RecordingRule{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Rule_Alert) EqualVT(thatIface isRule_Result) bool { + that, ok := thatIface.(*Rule_Alert) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Alert, that.Alert; p != q { + if p == nil { + p = &Alert{} + } + if q == nil { + q = &Alert{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *AlertInstance) EqualVT(that *AlertInstance) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !this.Labels.EqualVT(that.Labels) { + return false + } + if !this.Annotations.EqualVT(that.Annotations) { + return false + } + if this.State != that.State { + return false + } + if !(*timestamppb1.Timestamp)(this.ActiveAt).EqualVT((*timestamppb1.Timestamp)(that.ActiveAt)) { + return false + } + if this.Value != that.Value { + return false + } + if this.PartialResponseStrategy != that.PartialResponseStrategy { + return false + } + return true +} + +func (this *AlertInstance) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*AlertInstance) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Alert) EqualVT(that *Alert) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.State != that.State { + return false + } + if this.Name != that.Name { + return false + } + if this.Query != that.Query { + return false + } + if this.DurationSeconds != that.DurationSeconds { + return false + } + if !this.Labels.EqualVT(that.Labels) { + return false + } + if !this.Annotations.EqualVT(that.Annotations) { + return false + } + if len(this.Alerts) != len(that.Alerts) { + return false + } + for i, vx := range this.Alerts { + vy := that.Alerts[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &AlertInstance{} + } + if q == nil { + q = &AlertInstance{} + } + if !p.EqualVT(q) { + return false + } + } + } + if this.Health != that.Health { + return false + } + if this.LastError != that.LastError { + return false + } + if this.EvaluationDurationSeconds != that.EvaluationDurationSeconds { + return false + } + if !(*timestamppb1.Timestamp)(this.LastEvaluation).EqualVT((*timestamppb1.Timestamp)(that.LastEvaluation)) { + return false + } + if this.KeepFiringForSeconds != that.KeepFiringForSeconds { + return false + } + return true +} + +func (this *Alert) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Alert) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *RecordingRule) EqualVT(that *RecordingRule) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Name != that.Name { + return false + } + if this.Query != that.Query { + return false + } + if !this.Labels.EqualVT(that.Labels) { + return false + } + if this.Health != that.Health { + return false + } + if this.LastError != that.LastError { + return false + } + if this.EvaluationDurationSeconds != that.EvaluationDurationSeconds { + return false + } + if !(*timestamppb1.Timestamp)(this.LastEvaluation).EqualVT((*timestamppb1.Timestamp)(that.LastEvaluation)) { + return false + } + return true +} + +func (this *RecordingRule) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*RecordingRule) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *RulesRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RulesRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RulesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.File) > 0 { + for iNdEx := len(m.File) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.File[iNdEx]) + copy(dAtA[i:], m.File[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.File[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.RuleGroup) > 0 { + for iNdEx := len(m.RuleGroup) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RuleGroup[iNdEx]) + copy(dAtA[i:], m.RuleGroup[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RuleGroup[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.RuleName) > 0 { + for iNdEx := len(m.RuleName) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RuleName[iNdEx]) + copy(dAtA[i:], m.RuleName[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RuleName[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.MatcherString) > 0 { + for iNdEx := len(m.MatcherString) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.MatcherString[iNdEx]) + copy(dAtA[i:], m.MatcherString[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.MatcherString[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if m.PartialResponseStrategy != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PartialResponseStrategy)) + i-- + dAtA[i] = 0x10 + } + if m.Type != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *RulesResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RulesResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RulesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if vtmsg, ok := m.Result.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *RulesResponse_Group) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RulesResponse_Group) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Group != nil { + size, err := m.Group.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *RulesResponse_Warning) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RulesResponse_Warning) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Warning) + copy(dAtA[i:], m.Warning) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Warning))) + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil +} +func (m *RuleGroups) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RuleGroups) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RuleGroups) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Groups) > 0 { + for iNdEx := len(m.Groups) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Groups[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *RuleGroup) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RuleGroup) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RuleGroup) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.Limit != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x48 + } + if m.PartialResponseStrategy != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PartialResponseStrategy)) + i-- + dAtA[i] = 0x40 + } + if m.LastEvaluation != nil { + size, err := (*timestamppb1.Timestamp)(m.LastEvaluation).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + if m.EvaluationDurationSeconds != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.EvaluationDurationSeconds)))) + i-- + dAtA[i] = 0x29 + } + if m.Interval != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Interval)))) + i-- + dAtA[i] = 0x21 + } + if len(m.Rules) > 0 { + for iNdEx := len(m.Rules) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Rules[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + } + if len(m.File) > 0 { + i -= len(m.File) + copy(dAtA[i:], m.File) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.File))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Rule) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Rule) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Rule) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if vtmsg, ok := m.Result.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *Rule_Recording) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Rule_Recording) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Recording != nil { + size, err := m.Recording.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *Rule_Alert) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Rule_Alert) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Alert != nil { + size, err := m.Alert.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *AlertInstance) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AlertInstance) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *AlertInstance) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.PartialResponseStrategy != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PartialResponseStrategy)) + i-- + dAtA[i] = 0x30 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x2a + } + if m.ActiveAt != nil { + size, err := (*timestamppb1.Timestamp)(m.ActiveAt).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if m.State != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x18 + } + if m.Annotations != nil { + size, err := m.Annotations.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Labels != nil { + size, err := m.Labels.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Alert) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Alert) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Alert) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.KeepFiringForSeconds != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.KeepFiringForSeconds)))) + i-- + dAtA[i] = 0x61 + } + if m.LastEvaluation != nil { + size, err := (*timestamppb1.Timestamp)(m.LastEvaluation).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x5a + } + if m.EvaluationDurationSeconds != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.EvaluationDurationSeconds)))) + i-- + dAtA[i] = 0x51 + } + if len(m.LastError) > 0 { + i -= len(m.LastError) + copy(dAtA[i:], m.LastError) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LastError))) + i-- + dAtA[i] = 0x4a + } + if len(m.Health) > 0 { + i -= len(m.Health) + copy(dAtA[i:], m.Health) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Health))) + i-- + dAtA[i] = 0x42 + } + if len(m.Alerts) > 0 { + for iNdEx := len(m.Alerts) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Alerts[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + } + if m.Annotations != nil { + size, err := m.Annotations.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + if m.Labels != nil { + size, err := m.Labels.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + if m.DurationSeconds != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DurationSeconds)))) + i-- + dAtA[i] = 0x21 + } + if len(m.Query) > 0 { + i -= len(m.Query) + copy(dAtA[i:], m.Query) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Query))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if m.State != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *RecordingRule) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RecordingRule) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RecordingRule) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.LastEvaluation != nil { + size, err := (*timestamppb1.Timestamp)(m.LastEvaluation).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + if m.EvaluationDurationSeconds != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.EvaluationDurationSeconds)))) + i-- + dAtA[i] = 0x31 + } + if len(m.LastError) > 0 { + i -= len(m.LastError) + copy(dAtA[i:], m.LastError) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LastError))) + i-- + dAtA[i] = 0x2a + } + if len(m.Health) > 0 { + i -= len(m.Health) + copy(dAtA[i:], m.Health) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Health))) + i-- + dAtA[i] = 0x22 + } + if m.Labels != nil { + size, err := m.Labels.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if len(m.Query) > 0 { + i -= len(m.Query) + copy(dAtA[i:], m.Query) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Query))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RulesRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Type)) + } + if m.PartialResponseStrategy != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PartialResponseStrategy)) + } + if len(m.MatcherString) > 0 { + for _, s := range m.MatcherString { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.RuleName) > 0 { + for _, s := range m.RuleName { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.RuleGroup) > 0 { + for _, s := range m.RuleGroup { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.File) > 0 { + for _, s := range m.File { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *RulesResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Result.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + return n +} + +func (m *RulesResponse_Group) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Group != nil { + l = m.Group.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *RulesResponse_Warning) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Warning) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return n +} +func (m *RuleGroups) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Groups) > 0 { + for _, e := range m.Groups { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *RuleGroup) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.File) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Rules) > 0 { + for _, e := range m.Rules { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.Interval != 0 { + n += 9 + } + if m.EvaluationDurationSeconds != 0 { + n += 9 + } + if m.LastEvaluation != nil { + l = (*timestamppb1.Timestamp)(m.LastEvaluation).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.PartialResponseStrategy != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PartialResponseStrategy)) + } + if m.Limit != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Limit)) + } + return n +} + +func (m *Rule) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Result.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + return n +} + +func (m *Rule_Recording) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Recording != nil { + l = m.Recording.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *Rule_Alert) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Alert != nil { + l = m.Alert.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *AlertInstance) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Labels != nil { + l = m.Labels.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Annotations != nil { + l = m.Annotations.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.State != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.State)) + } + if m.ActiveAt != nil { + l = (*timestamppb1.Timestamp)(m.ActiveAt).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.PartialResponseStrategy != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PartialResponseStrategy)) + } + return n +} + +func (m *Alert) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.State != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.State)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Query) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.DurationSeconds != 0 { + n += 9 + } + if m.Labels != nil { + l = m.Labels.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Annotations != nil { + l = m.Annotations.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Alerts) > 0 { + for _, e := range m.Alerts { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + l = len(m.Health) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.LastError) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.EvaluationDurationSeconds != 0 { + n += 9 + } + if m.LastEvaluation != nil { + l = (*timestamppb1.Timestamp)(m.LastEvaluation).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.KeepFiringForSeconds != 0 { + n += 9 + } + return n +} + +func (m *RecordingRule) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Query) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Labels != nil { + l = m.Labels.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Health) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.LastError) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.EvaluationDurationSeconds != 0 { + n += 9 + } + if m.LastEvaluation != nil { + l = (*timestamppb1.Timestamp)(m.LastEvaluation).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *RulesRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RulesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RulesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= RulesRequest_Type(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) + } + m.PartialResponseStrategy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PartialResponseStrategy |= storepb.PartialResponseStrategy(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MatcherString", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MatcherString = append(m.MatcherString, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RuleName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RuleName = append(m.RuleName, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RuleGroup", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RuleGroup = append(m.RuleGroup, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field File", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.File = append(m.File, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RulesResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RulesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RulesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Result.(*RulesResponse_Group); ok { + if err := oneof.Group.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &RuleGroup{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Result = &RulesResponse_Group{Group: v} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Warning", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Result = &RulesResponse_Warning{Warning: string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RuleGroups) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RuleGroups: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RuleGroups: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Groups", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Groups = append(m.Groups, &RuleGroup{}) + if err := m.Groups[len(m.Groups)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RuleGroup) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RuleGroup: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RuleGroup: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field File", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.File = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rules = append(m.Rules, &Rule{}) + if err := m.Rules[len(m.Rules)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Interval = float64(math.Float64frombits(v)) + case 5: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field EvaluationDurationSeconds", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.EvaluationDurationSeconds = float64(math.Float64frombits(v)) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastEvaluation", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LastEvaluation == nil { + m.LastEvaluation = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.LastEvaluation).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) + } + m.PartialResponseStrategy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PartialResponseStrategy |= storepb.PartialResponseStrategy(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Rule) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Rule: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Rule: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recording", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Result.(*Rule_Recording); ok { + if err := oneof.Recording.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &RecordingRule{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Result = &Rule_Recording{Recording: v} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Alert", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Result.(*Rule_Alert); ok { + if err := oneof.Alert.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Alert{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Result = &Rule_Alert{Alert: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AlertInstance) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AlertInstance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AlertInstance: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = &labelpb.LabelSet{} + } + if err := m.Labels.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Annotations == nil { + m.Annotations = &labelpb.LabelSet{} + } + if err := m.Annotations.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + m.State = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= AlertState(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActiveAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ActiveAt == nil { + m.ActiveAt = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.ActiveAt).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) + } + m.PartialResponseStrategy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PartialResponseStrategy |= storepb.PartialResponseStrategy(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Alert) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Alert: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Alert: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + m.State = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= AlertState(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Query = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field DurationSeconds", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.DurationSeconds = float64(math.Float64frombits(v)) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = &labelpb.LabelSet{} + } + if err := m.Labels.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Annotations == nil { + m.Annotations = &labelpb.LabelSet{} + } + if err := m.Annotations.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Alerts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Alerts = append(m.Alerts, &AlertInstance{}) + if err := m.Alerts[len(m.Alerts)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Health", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Health = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastError", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LastError = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field EvaluationDurationSeconds", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.EvaluationDurationSeconds = float64(math.Float64frombits(v)) + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastEvaluation", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LastEvaluation == nil { + m.LastEvaluation = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.LastEvaluation).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field KeepFiringForSeconds", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.KeepFiringForSeconds = float64(math.Float64frombits(v)) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RecordingRule) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RecordingRule: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RecordingRule: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Query = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = &labelpb.LabelSet{} + } + if err := m.Labels.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Health", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Health = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastError", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LastError = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field EvaluationDurationSeconds", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.EvaluationDurationSeconds = float64(math.Float64frombits(v)) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastEvaluation", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LastEvaluation == nil { + m.LastEvaluation = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.LastEvaluation).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pkg/shipper/shipper.go b/pkg/shipper/shipper.go index 6b7be6cd12d..27f0d61bc3c 100644 --- a/pkg/shipper/shipper.go +++ b/pkg/shipper/shipper.go @@ -21,7 +21,6 @@ import ( "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb" "github.com/prometheus/prometheus/tsdb/fileutil" @@ -30,6 +29,7 @@ import ( "github.com/thanos-io/thanos/pkg/block" "github.com/thanos-io/thanos/pkg/block/metadata" "github.com/thanos-io/thanos/pkg/runutil" + "github.com/thanos-io/thanos/pkg/store/labelpb" ) type metrics struct { @@ -80,7 +80,7 @@ type Shipper struct { allowOutOfOrderUploads bool hashFunc metadata.HashFunc - labels func() labels.Labels + labels func() labelpb.Labels mtx sync.RWMutex } @@ -92,7 +92,7 @@ func New( r prometheus.Registerer, dir string, bucket objstore.Bucket, - lbls func() labels.Labels, + lbls func() labelpb.Labels, source metadata.SourceType, uploadCompactedFunc func() bool, allowOutOfOrderUploads bool, @@ -103,7 +103,7 @@ func New( logger = log.NewNopLogger() } if lbls == nil { - lbls = func() labels.Labels { return labels.EmptyLabels() } + lbls = func() labelpb.Labels { return labelpb.EmptyLabels() } } if metaFileName == "" { @@ -129,11 +129,11 @@ func New( } } -func (s *Shipper) SetLabels(lbls labels.Labels) { +func (s *Shipper) SetLabels(lbls labelpb.Labels) { s.mtx.Lock() defer s.mtx.Unlock() - s.labels = func() labels.Labels { return lbls } + s.labels = func() labelpb.Labels { return lbls } } // Timestamps returns the minimum timestamp for which data is available and the highest timestamp @@ -176,13 +176,13 @@ type lazyOverlapChecker struct { synced bool logger log.Logger bucket objstore.Bucket - labels func() labels.Labels + labels func() labelpb.Labels metas []tsdb.BlockMeta lookupMetas map[ulid.ULID]struct{} } -func newLazyOverlapChecker(logger log.Logger, bucket objstore.Bucket, labels func() labels.Labels) *lazyOverlapChecker { +func newLazyOverlapChecker(logger log.Logger, bucket objstore.Bucket, labels func() labelpb.Labels) *lazyOverlapChecker { return &lazyOverlapChecker{ logger: logger, bucket: bucket, @@ -204,7 +204,7 @@ func (c *lazyOverlapChecker) sync(ctx context.Context) error { return err } - if !labels.Equal(labels.FromMap(m.Thanos.Labels), c.labels()) { + if !labelpb.Equal(labelpb.FromMap(m.Thanos.Labels), c.labels()) { return nil } @@ -271,7 +271,7 @@ func (s *Shipper) Sync(ctx context.Context) (uploaded int, err error) { meta.Uploaded = nil var ( - checker = newLazyOverlapChecker(s.logger, s.bucket, func() labels.Labels { return s.labels() }) + checker = newLazyOverlapChecker(s.logger, s.bucket, func() labelpb.Labels { return s.labels() }) uploadErrs int ) @@ -394,7 +394,7 @@ func (s *Shipper) upload(ctx context.Context, meta *metadata.Meta) error { } // Attach current labels and write a new meta file with Thanos extensions. if lset := s.labels(); !lset.IsEmpty() { - lset.Range(func(l labels.Label) { + lset.Range(func(l *labelpb.Label) { meta.Thanos.Labels[l.Name] = l.Value }) } diff --git a/pkg/shipper/shipper_e2e_test.go b/pkg/shipper/shipper_e2e_test.go index ddb963339c5..bb8ad4c8ffd 100644 --- a/pkg/shipper/shipper_e2e_test.go +++ b/pkg/shipper/shipper_e2e_test.go @@ -22,7 +22,6 @@ import ( "github.com/oklog/ulid" "github.com/prometheus/client_golang/prometheus" promtest "github.com/prometheus/client_golang/prometheus/testutil" - "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/tsdb" @@ -32,6 +31,7 @@ import ( "github.com/efficientgo/core/testutil" "github.com/thanos-io/thanos/pkg/block" "github.com/thanos-io/thanos/pkg/block/metadata" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/testutil/e2eutil" ) @@ -43,8 +43,8 @@ func TestShipper_SyncBlocks_e2e(t *testing.T) { dir := t.TempDir() - extLset := labels.FromStrings("prometheus", "prom-1") - shipper := New(log.NewLogfmtLogger(os.Stderr), nil, dir, metricsBucket, func() labels.Labels { return extLset }, metadata.TestSource, nil, false, metadata.NoneFunc, DefaultMetaFilename) + extLset := labelpb.FromStrings("prometheus", "prom-1") + shipper := New(log.NewLogfmtLogger(os.Stderr), nil, dir, metricsBucket, func() labelpb.Labels { return extLset }, metadata.TestSource, nil, false, metadata.NoneFunc, DefaultMetaFilename) ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -203,7 +203,7 @@ func TestShipper_SyncBlocksWithMigrating_e2e(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - extLset := labels.FromStrings("prometheus", "prom-1") + extLset := labelpb.FromStrings("prometheus", "prom-1") logger := log.NewNopLogger() testutil.Ok(t, p.Start(context.Background(), logger)) @@ -212,7 +212,7 @@ func TestShipper_SyncBlocksWithMigrating_e2e(t *testing.T) { testutil.Ok(t, p.Restart(context.Background(), logger)) uploadCompactedFunc := func() bool { return true } - shipper := New(log.NewLogfmtLogger(os.Stderr), nil, dir, bkt, func() labels.Labels { return extLset }, metadata.TestSource, uploadCompactedFunc, false, metadata.NoneFunc, DefaultMetaFilename) + shipper := New(log.NewLogfmtLogger(os.Stderr), nil, dir, bkt, func() labelpb.Labels { return extLset }, metadata.TestSource, uploadCompactedFunc, false, metadata.NoneFunc, DefaultMetaFilename) // Create 10 new blocks. 9 of them (non compacted) should be actually uploaded. var ( @@ -351,7 +351,7 @@ func TestShipper_SyncOverlapBlocks_e2e(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - extLset := labels.FromStrings("prometheus", "prom-1") + extLset := labelpb.FromStrings("prometheus", "prom-1") logger := log.NewNopLogger() testutil.Ok(t, p.Start(context.Background(), logger)) @@ -360,8 +360,7 @@ func TestShipper_SyncOverlapBlocks_e2e(t *testing.T) { testutil.Ok(t, p.Restart(context.Background(), logger)) uploadCompactedFunc := func() bool { return true } - // Here, the allowOutOfOrderUploads flag is set to true, which allows blocks with overlaps to be uploaded. - shipper := New(log.NewLogfmtLogger(os.Stderr), nil, dir, bkt, func() labels.Labels { return extLset }, metadata.TestSource, uploadCompactedFunc, true, metadata.NoneFunc, DefaultMetaFilename) + shipper := New(log.NewLogfmtLogger(os.Stderr), nil, dir, bkt, func() labelpb.Labels { return extLset }, metadata.TestSource, uploadCompactedFunc, true, metadata.NoneFunc, DefaultMetaFilename) // Creating 2 overlapping blocks - both uploaded when OOO uploads allowed. var ( diff --git a/pkg/shipper/shipper_test.go b/pkg/shipper/shipper_test.go index 1a5cd5c75ac..2d4308eb5d8 100644 --- a/pkg/shipper/shipper_test.go +++ b/pkg/shipper/shipper_test.go @@ -16,7 +16,6 @@ import ( "github.com/go-kit/log" "github.com/oklog/ulid" - "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb" "github.com/thanos-io/objstore" @@ -24,6 +23,7 @@ import ( "github.com/efficientgo/core/testutil" "github.com/thanos-io/thanos/pkg/block" "github.com/thanos-io/thanos/pkg/block/metadata" + "github.com/thanos-io/thanos/pkg/store/labelpb" ) func TestShipperTimestamps(t *testing.T) { @@ -164,8 +164,8 @@ func TestShipperAddsSegmentFiles(t *testing.T) { inmemory := objstore.NewInMemBucket() - lbls := labels.FromStrings("test", "test") - s := New(nil, nil, dir, inmemory, func() labels.Labels { return lbls }, metadata.TestSource, nil, false, metadata.NoneFunc, DefaultMetaFilename) + lbls := labelpb.FromStrings("test", "test") + s := New(nil, nil, dir, inmemory, func() labelpb.Labels { return lbls }, metadata.TestSource, nil, false, metadata.NoneFunc, DefaultMetaFilename) id := ulid.MustNew(1, nil) blockDir := path.Join(dir, id.String()) @@ -234,8 +234,8 @@ func TestShipperExistingThanosLabels(t *testing.T) { inmemory := objstore.NewInMemBucket() - lbls := labels.FromStrings("test", "test") - s := New(nil, nil, dir, inmemory, func() labels.Labels { return lbls }, metadata.TestSource, nil, false, metadata.NoneFunc, DefaultMetaFilename) + lbls := labelpb.FromStrings("test", "test") + s := New(nil, nil, dir, inmemory, func() labelpb.Labels { return lbls }, metadata.TestSource, nil, false, metadata.NoneFunc, DefaultMetaFilename) id := ulid.MustNew(1, nil) id2 := ulid.MustNew(2, nil) diff --git a/pkg/store/acceptance_test.go b/pkg/store/acceptance_test.go index 48fc00adfbe..0c16de5a960 100644 --- a/pkg/store/acceptance_test.go +++ b/pkg/store/acceptance_test.go @@ -37,6 +37,7 @@ import ( "github.com/thanos-io/thanos/pkg/store/storepb" "github.com/thanos-io/thanos/pkg/store/storepb/prompb" storetestutil "github.com/thanos-io/thanos/pkg/store/storepb/testutil" + thanostestutil "github.com/thanos-io/thanos/pkg/testutil" "github.com/thanos-io/thanos/pkg/testutil/custom" "github.com/thanos-io/thanos/pkg/testutil/e2eutil" ) @@ -46,7 +47,7 @@ func TestMain(m *testing.M) { } type labelNameCallCase struct { - matchers []storepb.LabelMatcher + matchers []*storepb.LabelMatcher start int64 end int64 @@ -57,7 +58,7 @@ type labelNameCallCase struct { type labelValuesCallCase struct { label string - matchers []storepb.LabelMatcher + matchers []*storepb.LabelMatcher start int64 end int64 @@ -66,7 +67,7 @@ type labelValuesCallCase struct { } type seriesCallCase struct { - matchers []storepb.LabelMatcher + matchers []*storepb.LabelMatcher start int64 end int64 skipChunks bool @@ -153,30 +154,30 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), expectedNames: []string{"bar", "foo", "region"}, - matchers: []storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "bar", Value: "barvalue1"}}, + matchers: []*storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "bar", Value: "barvalue1"}}, }, { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), expectedNames: []string{"foo", "region"}, - matchers: []storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "foo", Value: "foovalue2"}}, + matchers: []*storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "foo", Value: "foovalue2"}}, }, { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "bar", Value: "different"}}, + matchers: []*storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "bar", Value: "different"}}, }, // Matchers on external labels. { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), expectedNames: []string{"bar", "foo", "region"}, - matchers: []storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "region", Value: "eu-west"}}, + matchers: []*storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "region", Value: "eu-west"}}, }, { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "region", Value: "different"}}, + matchers: []*storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "region", Value: "different"}}, }, }, labelValuesCalls: []labelValuesCallCase{ @@ -192,13 +193,13 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { end: timestamp.FromTime(maxTime), label: "foo", expectedValues: []string{"foovalue1"}, - matchers: []storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "bar", Value: "barvalue1"}}, + matchers: []*storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "bar", Value: "barvalue1"}}, }, { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), label: "foo", - matchers: []storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "bar", Value: "different"}}, + matchers: []*storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "bar", Value: "different"}}, }, // Matchers on external labels. { @@ -206,40 +207,40 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { end: timestamp.FromTime(maxTime), label: "region", expectedValues: []string(nil), - matchers: []storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "__name__", Value: "nonexistent"}}, + matchers: []*storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "__name__", Value: "nonexistent"}}, }, { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), label: "region", expectedValues: []string(nil), - matchers: []storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "region", Value: "eu-east"}}, + matchers: []*storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "region", Value: "eu-east"}}, }, { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), label: "foo", expectedValues: []string{"foovalue1", "foovalue2"}, - matchers: []storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "region", Value: "eu-west"}}, + matchers: []*storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "region", Value: "eu-west"}}, }, { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), label: "bar", expectedValues: []string{"barvalue1"}, - matchers: []storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "region", Value: "eu-west"}}, + matchers: []*storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "region", Value: "eu-west"}}, }, { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), label: "foo", - matchers: []storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "region", Value: "different"}}, + matchers: []*storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "region", Value: "different"}}, }, { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), label: "bar", - matchers: []storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "region", Value: "different"}}, + matchers: []*storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "region", Value: "different"}}, }, }, }, @@ -254,7 +255,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "foo", Value: "bar"}, }, skipChunks: true, @@ -279,7 +280,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), label: "region", - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "__name__", Value: "up"}, {Type: storepb.LabelMatcher_EQ, Name: "job", Value: "C"}, }, @@ -308,7 +309,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "n", Value: "1"}, }, expectedLabels: []labels.Labels{ @@ -320,7 +321,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "n", Value: "1"}, {Type: storepb.LabelMatcher_EQ, Name: "i", Value: "a"}, }, @@ -331,7 +332,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "n", Value: "1"}, {Type: storepb.LabelMatcher_EQ, Name: "i", Value: "missing"}, }, @@ -340,7 +341,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "missing", Value: ""}, }, expectedLabels: []labels.Labels{ @@ -354,7 +355,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_NEQ, Name: "n", Value: "1"}, }, expectedLabels: []labels.Labels{ @@ -365,7 +366,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "i", Value: ".+"}, }, expectedLabels: []labels.Labels{ @@ -376,7 +377,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "i", Value: ".*"}, }, expectedLabels: []labels.Labels{ @@ -390,7 +391,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "i", Value: ""}, }, expectedLabels: []labels.Labels{ @@ -402,7 +403,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_NEQ, Name: "i", Value: ""}, }, expectedLabels: []labels.Labels{ @@ -413,7 +414,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_NEQ, Name: "missing", Value: ""}, }, expectedLabels: []labels.Labels{}, @@ -421,7 +422,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "n", Value: "1"}, {Type: storepb.LabelMatcher_NEQ, Name: "i", Value: "a"}, }, @@ -433,7 +434,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "n", Value: "^1$"}, }, expectedLabels: []labels.Labels{ @@ -445,7 +446,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "n", Value: "1"}, {Type: storepb.LabelMatcher_RE, Name: "i", Value: "^a$"}, }, @@ -456,7 +457,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "n", Value: "1"}, {Type: storepb.LabelMatcher_RE, Name: "i", Value: "^a?$"}, }, @@ -468,7 +469,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "i", Value: "^$"}, }, expectedLabels: []labels.Labels{ @@ -480,7 +481,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "n", Value: "1"}, {Type: storepb.LabelMatcher_RE, Name: "i", Value: "^$"}, }, @@ -491,7 +492,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "n", Value: "1"}, {Type: storepb.LabelMatcher_RE, Name: "i", Value: "^.*$"}, }, @@ -504,7 +505,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "n", Value: "1"}, {Type: storepb.LabelMatcher_RE, Name: "i", Value: "^.+$"}, }, @@ -516,7 +517,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_NRE, Name: "n", Value: "^1$"}, }, expectedLabels: []labels.Labels{ @@ -527,7 +528,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_NRE, Name: "n", Value: "1"}, }, expectedLabels: []labels.Labels{ @@ -538,7 +539,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_NRE, Name: "n", Value: "1|2.5"}, }, expectedLabels: []labels.Labels{ @@ -548,7 +549,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_NRE, Name: "n", Value: "(1|2.5)"}, }, expectedLabels: []labels.Labels{ @@ -558,7 +559,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "n", Value: "1"}, {Type: storepb.LabelMatcher_NRE, Name: "i", Value: "^a$"}, }, @@ -570,7 +571,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "n", Value: "1"}, {Type: storepb.LabelMatcher_NRE, Name: "i", Value: "^a?$"}, }, @@ -581,7 +582,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "n", Value: "1"}, {Type: storepb.LabelMatcher_NRE, Name: "i", Value: "^$"}, }, @@ -593,7 +594,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "n", Value: "1"}, {Type: storepb.LabelMatcher_NRE, Name: "i", Value: "^.*$"}, }, @@ -602,7 +603,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "n", Value: "1"}, {Type: storepb.LabelMatcher_NRE, Name: "i", Value: "^.+$"}, }, @@ -613,7 +614,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "n", Value: "1"}, {Type: storepb.LabelMatcher_NEQ, Name: "i", Value: ""}, {Type: storepb.LabelMatcher_EQ, Name: "i", Value: "a"}, @@ -625,7 +626,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "n", Value: "1"}, {Type: storepb.LabelMatcher_NEQ, Name: "i", Value: "b"}, {Type: storepb.LabelMatcher_RE, Name: "i", Value: "^(b|a).*$"}, @@ -637,7 +638,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "n", Value: "(1|2)"}, }, expectedLabels: []labels.Labels{ @@ -650,7 +651,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "i", Value: "a|b"}, }, expectedLabels: []labels.Labels{ @@ -661,7 +662,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "i", Value: "(a|b)"}, }, expectedLabels: []labels.Labels{ @@ -672,7 +673,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "n", Value: "x1|2"}, }, expectedLabels: []labels.Labels{ @@ -682,7 +683,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "n", Value: "2|2\\.5"}, }, expectedLabels: []labels.Labels{ @@ -693,7 +694,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "i", Value: "c||d"}, }, expectedLabels: []labels.Labels{ @@ -705,7 +706,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "i", Value: "(c||d)"}, }, expectedLabels: []labels.Labels{ @@ -728,7 +729,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), expectedNames: []string{"__name__", "foo", "region"}, - matchers: []storepb.LabelMatcher{{Type: storepb.LabelMatcher_RE, Name: "region", Value: ".*"}}, + matchers: []*storepb.LabelMatcher{{Type: storepb.LabelMatcher_RE, Name: "region", Value: ".*"}}, }, }, labelValuesCalls: []labelValuesCallCase{ @@ -736,7 +737,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), label: "region", - matchers: []storepb.LabelMatcher{ + matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "__name__", Value: "up"}, {Type: storepb.LabelMatcher_RE, Name: "region", Value: ".*"}, }, @@ -760,7 +761,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), expectedNames: []string{"__name__", "pod", "region"}, - matchers: []storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "__name__", Value: "kube_pod_info"}}, + matchers: []*storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "__name__", Value: "kube_pod_info"}}, }, { start: timestamp.FromTime(minTime), @@ -774,7 +775,7 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { end: timestamp.FromTime(maxTime), label: "pod", expectedValues: []string{"pod-1"}, - matchers: []storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "__name__", Value: "kube_pod_info"}}, + matchers: []*storepb.LabelMatcher{{Type: storepb.LabelMatcher_EQ, Name: "__name__", Value: "kube_pod_info"}}, }, { start: timestamp.FromTime(minTime), @@ -852,13 +853,13 @@ func testStoreAPIsAcceptance(t *testing.T, startStore startStoreFn) { } testutil.Ok(t, err) - testutil.Assert(t, slices.IsSortedFunc(srv.SeriesSet, func(x, y storepb.Series) int { - return labels.Compare(x.PromLabels(), y.PromLabels()) + testutil.Assert(t, slices.IsSortedFunc(srv.SeriesSet, func(x, y *storepb.Series) int { + return labelpb.Compare(x.PromLabels(), y.PromLabels()) }), "Unsorted Series response returned") receivedLabels := make([]labels.Labels, 0) for _, s := range srv.SeriesSet { - receivedLabels = append(receivedLabels, s.PromLabels()) + receivedLabels = append(receivedLabels, labelpb.ToPromLabels(s.PromLabels())) } testutil.Equals(t, c.expectedLabels, receivedLabels) @@ -897,7 +898,7 @@ func testStoreAPIsSeriesSplitSamplesIntoChunksWithMaxSizeOf120(t *testing.T, sta testutil.Ok(t, client.Series(&storepb.SeriesRequest{ MinTime: baseT, MaxTime: baseT + offset, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "b"}, {Type: storepb.LabelMatcher_EQ, Name: "region", Value: "eu-west"}, }, @@ -907,10 +908,7 @@ func testStoreAPIsSeriesSplitSamplesIntoChunksWithMaxSizeOf120(t *testing.T, sta firstSeries := srv.SeriesSet[0] - testutil.Equals(t, []labelpb.ZLabel{ - {Name: "a", Value: "b"}, - {Name: "region", Value: "eu-west"}, - }, firstSeries.Labels) + thanostestutil.ProtoEquals(t, labelpb.FromStrings("a", "b", "region", "eu-west"), labelpb.Labels(firstSeries.Labels)) testutil.Equals(t, 1093, len(firstSeries.Chunks)) for i := 0; i < len(firstSeries.Chunks)-1; i++ { @@ -1039,7 +1037,7 @@ func TestPrometheusStore_Acceptance(t *testing.T) { testutil.Ok(tt, err) promStore, err := NewPrometheusStore(nil, nil, promclient.NewDefaultClient(), u, component.Sidecar, - func() labels.Labels { return extLset }, + func() labelpb.Labels { return labelpb.FromPromLabels(extLset) }, func() (int64, int64) { return timestamp.FromTime(minTime), timestamp.FromTime(maxTime) }, func() string { return version }) testutil.Ok(tt, err) @@ -1063,7 +1061,7 @@ func TestTSDBStore_Acceptance(t *testing.T) { tt.Cleanup(func() { testutil.Ok(tt, db.Close()) }) appendFn(db.Appender(context.Background())) - return NewTSDBStore(nil, db, component.Rule, extLset) + return NewTSDBStore(nil, db, component.Rule, labelpb.FromPromLabels(extLset)) } testStoreAPIsAcceptance(t, startStore) @@ -1164,7 +1162,7 @@ func TestProxyStoreWithTSDBSelector_Acceptance(t *testing.T) { p1 := startNestedStore(tt, appendFn, extLset1, extLset2, extLset3) clients := []Client{ - storetestutil.TestClient{StoreClient: storepb.ServerAsClient(p1), ExtLset: []labels.Labels{extLset1, extLset2, extLset3}}, + &storetestutil.TestClient{StoreClient: storepb.ServerAsClient(p1), ExtLset: []labelpb.Labels{labelpb.FromPromLabels(extLset1), labelpb.FromPromLabels(extLset2), labelpb.FromPromLabels(extLset3)}}, } relabelCfgs := []*relabel.Config{{ @@ -1174,7 +1172,7 @@ func TestProxyStoreWithTSDBSelector_Acceptance(t *testing.T) { Action: relabel.Keep, }} - return NewProxyStore(nil, nil, func() []Client { return clients }, component.Query, labels.EmptyLabels(), 0*time.Second, RetrievalStrategy(EagerRetrieval), WithTSDBSelector(NewTSDBSelector(relabelCfgs))) + return NewProxyStore(nil, nil, func() []Client { return clients }, component.Query, labelpb.EmptyLabels(), 0*time.Second, RetrievalStrategy(EagerRetrieval), WithTSDBSelector(NewTSDBSelector(relabelCfgs))) } client := startStore(t, labels.EmptyLabels(), func(app storage.Appender) { @@ -1187,14 +1185,14 @@ func TestProxyStoreWithTSDBSelector_Acceptance(t *testing.T) { testutil.Ok(t, client.Series(&storepb.SeriesRequest{ MinTime: minTime.Unix(), MaxTime: maxTime.Unix(), - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "b"}, }, }, srv)) receivedLabels := make([]labels.Labels, 0) for _, s := range srv.SeriesSet { - receivedLabels = append(receivedLabels, s.PromLabels()) + receivedLabels = append(receivedLabels, labelpb.ToPromLabels(s.PromLabels())) } // This fails currently because the method of using matchers cannot drop extLset3 even though we should only @@ -1216,7 +1214,7 @@ func TestProxyStoreWithReplicas_Acceptance(t *testing.T) { tt.Cleanup(func() { testutil.Ok(tt, db.Close()) }) appendFn(db.Appender(context.Background())) - return NewTSDBStore(nil, db, component.Rule, extLset) + return NewTSDBStore(nil, db, component.Rule, labelpb.FromPromLabels(extLset)) } @@ -1227,11 +1225,11 @@ func TestProxyStoreWithReplicas_Acceptance(t *testing.T) { p2 := startNestedStore(tt, extLset2, appendFn) clients := []Client{ - storetestutil.TestClient{StoreClient: storepb.ServerAsClient(p1), ExtLset: []labels.Labels{extLset1}}, - storetestutil.TestClient{StoreClient: storepb.ServerAsClient(p2), ExtLset: []labels.Labels{extLset2}}, + &storetestutil.TestClient{StoreClient: storepb.ServerAsClient(p1), ExtLset: []labelpb.Labels{labelpb.FromPromLabels(extLset1)}}, + &storetestutil.TestClient{StoreClient: storepb.ServerAsClient(p2), ExtLset: []labelpb.Labels{labelpb.FromPromLabels(extLset2)}}, } - return NewProxyStore(nil, nil, func() []Client { return clients }, component.Query, labels.EmptyLabels(), 0*time.Second, RetrievalStrategy(EagerRetrieval)) + return NewProxyStore(nil, nil, func() []Client { return clients }, component.Query, labelpb.EmptyLabels(), 0*time.Second, RetrievalStrategy(EagerRetrieval)) } testStoreAPIsAcceptance(t, startStore) diff --git a/pkg/store/bucket.go b/pkg/store/bucket.go index d8f1b57701e..8f2e293024c 100644 --- a/pkg/store/bucket.go +++ b/pkg/store/bucket.go @@ -23,7 +23,6 @@ import ( "github.com/cespare/xxhash" "github.com/go-kit/log" "github.com/go-kit/log/level" - "github.com/gogo/protobuf/types" "github.com/oklog/ulid" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" @@ -41,6 +40,8 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/anypb" + "google.golang.org/protobuf/types/known/durationpb" "github.com/thanos-io/objstore" @@ -387,6 +388,8 @@ type BlockEstimator func(meta metadata.Meta) uint64 // This makes them smaller, but takes extra CPU and memory. // When used with in-memory cache, memory usage should decrease overall, thanks to postings being smaller. type BucketStore struct { + storepb.UnimplementedStoreServer + logger log.Logger reg prometheus.Registerer // TODO(metalmatze) remove and add via BucketStoreOption metrics *bucketStoreMetrics @@ -424,7 +427,7 @@ type BucketStore struct { partitioner Partitioner filterConfig *FilterConfig - advLabelSets []labelpb.ZLabelSet + advLabelSets []*labelpb.LabelSet enableCompatibilityLabel bool // Every how many posting offset entry we pool in heap memory. Default in Prometheus is 32. @@ -744,12 +747,12 @@ func (s *BucketStore) SyncBlocks(ctx context.Context) error { // Sync advertise labels. s.mtx.Lock() - s.advLabelSets = make([]labelpb.ZLabelSet, 0, len(s.advLabelSets)) + s.advLabelSets = make([]*labelpb.LabelSet, 0, len(s.advLabelSets)) for _, bs := range s.blockSets { - s.advLabelSets = append(s.advLabelSets, labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(bs.labels.Copy())}) + s.advLabelSets = append(s.advLabelSets, &labelpb.LabelSet{Labels: bs.labels.Copy()}) } sort.Slice(s.advLabelSets, func(i, j int) bool { - return strings.Compare(s.advLabelSets[i].String(), s.advLabelSets[j].String()) < 0 + return strings.Compare(labelpb.Labels(s.advLabelSets[i].Labels).String(), labelpb.Labels(s.advLabelSets[j].Labels).String()) < 0 }) s.mtx.Unlock() return nil @@ -822,7 +825,7 @@ func (s *BucketStore) addBlock(ctx context.Context, meta *metadata.Meta) (err er }() s.metrics.blockLoads.Inc() - lset := labels.FromMap(meta.Thanos.Labels) + lset := labelpb.FromMap(meta.Thanos.Labels) h := lset.Hash() indexHeaderReader, err := s.indexReaderPool.NewBinaryReader( @@ -888,7 +891,7 @@ func (s *BucketStore) removeBlock(id ulid.ULID) error { s.mtx.Lock() b, ok := s.blocks[id] if ok { - lset := labels.FromMap(b.meta.Thanos.Labels) + lset := labelpb.FromMap(b.meta.Thanos.Labels) s.blockSets[lset.Hash()].remove(id) delete(s.blocks, id) } @@ -934,25 +937,23 @@ func (s *BucketStore) TimeRange() (mint, maxt int64) { } // TSDBInfos returns a list of infopb.TSDBInfos for blocks in the bucket store. -func (s *BucketStore) TSDBInfos() []infopb.TSDBInfo { +func (s *BucketStore) TSDBInfos() []*infopb.TSDBInfo { s.mtx.RLock() defer s.mtx.RUnlock() - infoMap := make(map[uint64][]infopb.TSDBInfo, len(s.blocks)) + infoMap := make(map[uint64][]*infopb.TSDBInfo, len(s.blocks)) for _, b := range s.blocks { - lbls := labels.FromMap(b.meta.Thanos.Labels) + lbls := labelpb.FromMap(b.meta.Thanos.Labels) hash := lbls.Hash() - infoMap[hash] = append(infoMap[hash], infopb.TSDBInfo{ - Labels: labelpb.ZLabelSet{ - Labels: labelpb.ZLabelsFromPromLabels(lbls), - }, + infoMap[hash] = append(infoMap[hash], &infopb.TSDBInfo{ + Labels: &labelpb.LabelSet{Labels: lbls}, MinTime: b.meta.MinTime, MaxTime: b.meta.MaxTime, }) } // join adjacent blocks so we emit less TSDBInfos - res := make([]infopb.TSDBInfo, 0, len(s.blocks)) + res := make([]*infopb.TSDBInfo, 0, len(s.blocks)) for _, infos := range infoMap { sort.Slice(infos, func(i, j int) bool { return infos[i].MinTime < infos[j].MinTime }) @@ -971,13 +972,13 @@ func (s *BucketStore) TSDBInfos() []infopb.TSDBInfo { return res } -func (s *BucketStore) LabelSet() []labelpb.ZLabelSet { +func (s *BucketStore) LabelSet() []*labelpb.LabelSet { s.mtx.RLock() labelSets := s.advLabelSets s.mtx.RUnlock() if s.enableCompatibilityLabel && len(labelSets) > 0 { - labelSets = append(labelSets, labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: CompatibilityTypeLabelName, Value: "store"}}}) + labelSets = append(labelSets, labelpb.LabelSetFromStrings(CompatibilityTypeLabelName, "store")) } return labelSets @@ -1012,9 +1013,9 @@ func (s *BucketStore) limitMaxTime(maxt int64) int64 { } type seriesEntry struct { - lset labels.Labels + lset labelpb.Labels refs []chunks.ChunkRef - chks []storepb.AggrChunk + chks []*storepb.AggrChunk } // blockSeriesClient is a storepb.Store_SeriesClient for a @@ -1023,7 +1024,7 @@ type blockSeriesClient struct { grpc.ClientStream ctx context.Context logger log.Logger - extLset labels.Labels + extLset labelpb.Labels extLsetToRemove map[string]struct{} mint int64 @@ -1056,7 +1057,7 @@ type blockSeriesClient struct { lazyPostings *lazyExpandedPostings expandedPostings []storage.SeriesRef chkMetas []chunks.Meta - lset labels.Labels + lset labelpb.Labels b *labels.Builder symbolizedLset []symbolizedLabel entries []seriesEntry @@ -1093,7 +1094,7 @@ func newBlockSeriesClient( extLset := b.extLset if extLsetToRemove != nil { - extLset = rmLabels(extLset.Copy(), extLsetToRemove) + extLset = labelpb.RmLabels(extLset, extLsetToRemove) } return &blockSeriesClient{ @@ -1128,7 +1129,7 @@ func newBlockSeriesClient( batchSize: batchSize, tenant: tenant, - b: labels.NewBuilder(labels.EmptyLabels()), + b: labels.NewBuilder(labels.EmptyLabels()), // TSDB boundary: Builder used for index symbol lookup } } @@ -1224,7 +1225,7 @@ func (b *blockSeriesClient) Recv() (*storepb.SeriesResponse, error) { b.entries = b.entries[1:] return storepb.NewSeriesResponse(&storepb.Series{ - Labels: labelpb.ZLabelsFromPromLabels(next.lset), + Labels: next.lset, Chunks: next.chks, }), nil } @@ -1288,7 +1289,7 @@ OUTER: if err := b.indexr.LookupLabelsSymbols(b.ctx, b.symbolizedLset, b.b); err != nil { return errors.Wrap(err, "Lookup labels symbols") } - b.lset = b.b.Labels() + b.lset = labelpb.FromPromLabels(b.b.Labels()) for _, matcher := range b.lazyPostings.matchers { val := b.lset.Get(matcher.Name) @@ -1311,7 +1312,7 @@ OUTER: completeLabelset := labelpb.ExtendSortedLabels(b.lset, b.extLset) if b.extLsetToRemove != nil { - completeLabelset = rmLabels(completeLabelset, b.extLsetToRemove) + completeLabelset = labelpb.RmLabelsInPlace(completeLabelset, b.extLsetToRemove) } if !b.shardMatcher.MatchesLabels(completeLabelset) { @@ -1332,13 +1333,13 @@ OUTER: // Schedule loading chunks. s.refs = make([]chunks.ChunkRef, 0, len(b.chkMetas)) - s.chks = make([]storepb.AggrChunk, 0, len(b.chkMetas)) + s.chks = make([]*storepb.AggrChunk, 0, len(b.chkMetas)) for j, meta := range b.chkMetas { if err := b.chunkr.addLoad(meta.Ref, len(b.entries), j); err != nil { return errors.Wrap(err, "add chunk load") } - s.chks = append(s.chks, storepb.AggrChunk{ + s.chks = append(s.chks, &storepb.AggrChunk{ MinTime: meta.MinTime, MaxTime: meta.MaxTime, }) @@ -1463,7 +1464,7 @@ func hashChunk(hasher hash.Hash64, b []byte, doHash bool) uint64 { // labels and resolution. This is important because we allow mixed resolution results, so it is quite crucial // to be aware what exactly resolution we see on query. // TODO(bplotka): Consider adding resolution label to all results to propagate that info to UI and Query API. -func debugFoundBlockSetOverview(logger log.Logger, mint, maxt, maxResolutionMillis int64, lset labels.Labels, bs []*bucketBlock) { +func debugFoundBlockSetOverview(logger log.Logger, mint, maxt, maxResolutionMillis int64, lset labelpb.Labels, bs []*bucketBlock) { if len(bs) == 0 { level.Debug(logger).Log("msg", "No block found", "mint", mint, "maxt", maxt, "lset", lset.String()) return @@ -1538,7 +1539,7 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, seriesSrv storepb.Store if req.Hints != nil { reqHints := &hintspb.SeriesRequestHints{} - if err := types.UnmarshalAny(req.Hints, reqHints); err != nil { + if err := req.Hints.UnmarshalTo(reqHints); err != nil { return status.Error(codes.InvalidArgument, errors.Wrap(err, "unmarshal series request hints").Error()) } queryStatsEnabled = reqHints.EnableQueryStats @@ -1639,7 +1640,7 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, seriesSrv storepb.Store span, 10*time.Minute, blk.meta.ULID.String(), - []labels.Labels{blk.extLset}, + []labelpb.Labels{blk.extLset}, onClose, blockClient, shardMatcher, @@ -1657,7 +1658,7 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, seriesSrv storepb.Store span, 10*time.Minute, blk.meta.ULID.String(), - []labels.Labels{blk.extLset}, + []labelpb.Labels{blk.extLset}, onClose, blockClient, shardMatcher, @@ -1777,12 +1778,12 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, seriesSrv storepb.Store } if s.enableSeriesResponseHints { - var anyHints *types.Any + var anyHints *anypb.Any if queryStatsEnabled { resHints.QueryStats = stats.toHints() } - if anyHints, err = types.MarshalAny(resHints); err != nil { + if anyHints, err = anypb.New(resHints); err != nil { err = status.Error(codes.Unknown, errors.Wrap(err, "marshal series response hints").Error()) return } @@ -1799,9 +1800,9 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, seriesSrv storepb.Store return srv.Flush() } -func chunksSize(chks []storepb.AggrChunk) (size int) { +func chunksSize(chks []*storepb.AggrChunk) (size int) { for _, chk := range chks { - size += chk.Size() // This gets the encoded proto size. + size += chk.SizeVT() } return size } @@ -1820,7 +1821,7 @@ func (s *BucketStore) LabelNames(ctx context.Context, req *storepb.LabelNamesReq var reqBlockMatchers []*labels.Matcher if req.Hints != nil { reqHints := &hintspb.LabelNamesRequestHints{} - err := types.UnmarshalAny(req.Hints, reqHints) + err := req.Hints.UnmarshalTo(reqHints) if err != nil { return nil, status.Error(codes.InvalidArgument, errors.Wrap(err, "unmarshal label names request hints").Error()) } @@ -1892,8 +1893,8 @@ func (s *BucketStore) LabelNames(ctx context.Context, req *storepb.LabelNamesReq // Add a set for the external labels as well. // We're not adding them directly to refs because there could be duplicates. // b.extLset is already sorted by label name, no need to sort it again. - extRes := make([]string, 0, b.extLset.Len()) - b.extLset.Range(func(l labels.Label) { + extRes := make([]string, 0, len(b.extLset)) + b.extLset.Range(func(l *labelpb.Label) { if _, ok := extLsetToRemove[l.Name]; !ok { extRes = append(extRes, l.Name) } @@ -1989,7 +1990,7 @@ func (s *BucketStore) LabelNames(ctx context.Context, req *storepb.LabelNamesReq return nil, status.Error(code, err.Error()) } - anyHints, err := types.MarshalAny(resHints) + anyHints, err := anypb.New(resHints) if err != nil { return nil, status.Error(codes.Unknown, errors.Wrap(err, "marshal label names response hints").Error()) } @@ -2049,7 +2050,7 @@ func (s *BucketStore) LabelValues(ctx context.Context, req *storepb.LabelValuesR var reqBlockMatchers []*labels.Matcher if req.Hints != nil { reqHints := &hintspb.LabelValuesRequestHints{} - err := types.UnmarshalAny(req.Hints, reqHints) + err := req.Hints.UnmarshalTo(reqHints) if err != nil { return nil, status.Error(codes.InvalidArgument, errors.Wrap(err, "unmarshal label values request hints").Error()) } @@ -2188,7 +2189,7 @@ func (s *BucketStore) LabelValues(ctx context.Context, req *storepb.LabelValuesR continue } - val := labelpb.ZLabelsToPromLabels(ls.GetSeries().Labels).Get(req.Label) + val := labelpb.Labels(ls.GetSeries().Labels).Get(req.Label) if val != "" { values[val] = struct{}{} } @@ -2230,7 +2231,7 @@ func (s *BucketStore) LabelValues(ctx context.Context, req *storepb.LabelValuesR return nil, status.Error(code, err.Error()) } - anyHints, err := types.MarshalAny(resHints) + anyHints, err := anypb.New(resHints) if err != nil { return nil, status.Error(codes.Unknown, errors.Wrap(err, "marshal label values response hints").Error()) } @@ -2246,7 +2247,7 @@ func (s *BucketStore) LabelValues(ctx context.Context, req *storepb.LabelValuesR // bucketBlockSet holds all blocks of an equal label set. It internally splits // them up by downsampling resolution and allows querying. type bucketBlockSet struct { - labels labels.Labels + labels labelpb.Labels mtx sync.RWMutex resolutions []int64 // Available resolution, high to low (in milliseconds). blocks [][]*bucketBlock // Ordered buckets for the existing resolutions. @@ -2254,7 +2255,7 @@ type bucketBlockSet struct { // newBucketBlockSet initializes a new set with the known downsampling windows hard-configured. // The set currently does not support arbitrary ranges. -func newBucketBlockSet(lset labels.Labels) *bucketBlockSet { +func newBucketBlockSet(lset labelpb.Labels) *bucketBlockSet { return &bucketBlockSet{ labels: lset, resolutions: []int64{downsample.ResLevel2, downsample.ResLevel1, downsample.ResLevel0}, @@ -2263,7 +2264,7 @@ func newBucketBlockSet(lset labels.Labels) *bucketBlockSet { } func (s *bucketBlockSet) add(b *bucketBlock) error { - if !labels.Equal(s.labels, labels.FromMap(b.meta.Thanos.Labels)) { + if !labelpb.Equal(s.labels, labelpb.FromMap(b.meta.Thanos.Labels)) { return errors.New("block's label set does not match set") } s.mtx.Lock() @@ -2387,7 +2388,7 @@ type bucketBlock struct { dir string indexCache storecache.IndexCache chunkPool pool.Pool[byte] - extLset labels.Labels + extLset labelpb.Labels indexHeaderReader indexheader.Reader @@ -2399,7 +2400,7 @@ type bucketBlock struct { // Block's labels used by block-level matchers to filter blocks to query. These are used to select blocks using // request hints' BlockMatchers. - relabelLabels labels.Labels + relabelLabels labelpb.Labels estimatedMaxChunkSize int estimatedMaxSeriesSize int @@ -2428,8 +2429,8 @@ func newBucketBlock( } // Translate the block's labels and inject the block ID as a label // to allow to match blocks also by ID. - extLset := labels.FromMap(meta.Thanos.Labels) - relabelLabels := labels.NewBuilder(extLset).Set(block.BlockIDLabel, meta.ULID.String()).Labels() + extLset := labelpb.FromMap(meta.Thanos.Labels) + relabelLabels := labelpb.ExtendSortedLabels(extLset, labelpb.Labels{{Name: block.BlockIDLabel, Value: meta.ULID.String()}}) b = &bucketBlock{ metrics: metrics, bkt: bkt, @@ -3708,7 +3709,7 @@ func (r *bucketChunkReader) loadChunks(ctx context.Context, res []seriesEntry, a chunkLen = n + 1 + int(chunkDataLen) if chunkLen <= len(cb) { c := rawChunk(cb[n:chunkLen]) - err = populateChunk(&(res[pIdx.seriesEntry].chks[pIdx.chunk]), &c, aggrs, r.save, calculateChunkChecksum) + err = populateChunk(res[pIdx.seriesEntry].chks[pIdx.chunk], &c, aggrs, r.save, calculateChunkChecksum) if err != nil { return errors.Wrap(err, "populate chunk") } @@ -3735,7 +3736,7 @@ func (r *bucketChunkReader) loadChunks(ctx context.Context, res []seriesEntry, a stats.add(ChunksFetched, 1, len(*nb)) c := rawChunk((*nb)[n:]) - err = populateChunk(&(res[pIdx.seriesEntry].chks[pIdx.chunk]), &c, aggrs, r.save, calculateChunkChecksum) + err = populateChunk(res[pIdx.seriesEntry].chks[pIdx.chunk], &c, aggrs, r.save, calculateChunkChecksum) if err != nil { r.block.chunkPool.Put(nb) return errors.Wrap(err, "populate chunk") @@ -3940,8 +3941,8 @@ func (s *queryStats) toHints() *hintspb.QueryStats { MergedSeriesCount: int64(s.mergedSeriesCount), MergedChunksCount: int64(s.mergedChunksCount), DataDownloadedSizeSum: int64(s.DataDownloadedSizeSum), - GetAllDuration: s.GetAllDuration, - MergeDuration: s.MergeDuration, + GetAllDuration: durationpb.New(s.GetAllDuration), + MergeDuration: durationpb.New(s.MergeDuration), } } diff --git a/pkg/store/bucket_e2e_test.go b/pkg/store/bucket_e2e_test.go index 12a970437d9..bd7d2260fce 100644 --- a/pkg/store/bucket_e2e_test.go +++ b/pkg/store/bucket_e2e_test.go @@ -37,6 +37,7 @@ import ( storecache "github.com/thanos-io/thanos/pkg/store/cache" "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" + thanostestutil "github.com/thanos-io/thanos/pkg/testutil" "github.com/thanos-io/thanos/pkg/testutil/e2eutil" ) @@ -242,19 +243,19 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { // TODO(bwplotka): Add those test cases to TSDB querier_test.go as well, there are no tests for matching. for i, tcase := range []struct { req *storepb.SeriesRequest - expected [][]labelpb.ZLabel + expected []labelpb.Labels expectedChunkLen int }{ { req: &storepb.SeriesRequest{ - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "a", Value: "1|2"}, }, MinTime: mint, MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]labelpb.ZLabel{ + expected: []labelpb.Labels{ {{Name: "a", Value: "1"}, {Name: "b", Value: "1"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}, {Name: "ext2", Value: "value2"}}, @@ -267,7 +268,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { }, { req: &storepb.SeriesRequest{ - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "a", Value: "1|2"}, }, MinTime: mint, @@ -275,7 +276,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { WithoutReplicaLabels: []string{"ext1", "ext2"}, }, expectedChunkLen: 3, - expected: [][]labelpb.ZLabel{ + expected: []labelpb.Labels{ {{Name: "a", Value: "1"}, {Name: "b", Value: "1"}}, {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}}, @@ -288,14 +289,14 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { }, { req: &storepb.SeriesRequest{ - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "a", Value: "1"}, }, MinTime: mint, MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]labelpb.ZLabel{ + expected: []labelpb.Labels{ {{Name: "a", Value: "1"}, {Name: "b", Value: "1"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}, {Name: "ext2", Value: "value2"}}, @@ -304,14 +305,14 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { }, { req: &storepb.SeriesRequest{ - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_NRE, Name: "a", Value: "2"}, }, MinTime: mint, MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]labelpb.ZLabel{ + expected: []labelpb.Labels{ {{Name: "a", Value: "1"}, {Name: "b", Value: "1"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}, {Name: "ext2", Value: "value2"}}, @@ -320,14 +321,14 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { }, { req: &storepb.SeriesRequest{ - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_NRE, Name: "a", Value: "not_existing"}, }, MinTime: mint, MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]labelpb.ZLabel{ + expected: []labelpb.Labels{ {{Name: "a", Value: "1"}, {Name: "b", Value: "1"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}, {Name: "ext2", Value: "value2"}}, @@ -340,14 +341,14 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { }, { req: &storepb.SeriesRequest{ - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_NRE, Name: "not_existing", Value: "1"}, }, MinTime: mint, MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]labelpb.ZLabel{ + expected: []labelpb.Labels{ {{Name: "a", Value: "1"}, {Name: "b", Value: "1"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}, {Name: "ext2", Value: "value2"}}, @@ -360,14 +361,14 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { }, { req: &storepb.SeriesRequest{ - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "b", Value: "2"}, }, MinTime: mint, MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]labelpb.ZLabel{ + expected: []labelpb.Labels{ {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "2"}, {Name: "b", Value: "2"}, {Name: "ext1", Value: "value1"}}, }, @@ -375,7 +376,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { { // Matching by external label should work as well. req: &storepb.SeriesRequest{ - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "1"}, {Type: storepb.LabelMatcher_EQ, Name: "ext2", Value: "value2"}, }, @@ -383,14 +384,14 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]labelpb.ZLabel{ + expected: []labelpb.Labels{ {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}, {Name: "ext2", Value: "value2"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "2"}, {Name: "ext2", Value: "value2"}}, }, }, { req: &storepb.SeriesRequest{ - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "1"}, {Type: storepb.LabelMatcher_EQ, Name: "ext2", Value: "wrong-value"}, }, @@ -400,14 +401,14 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { }, { req: &storepb.SeriesRequest{ - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_NEQ, Name: "a", Value: "2"}, }, MinTime: mint, MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]labelpb.ZLabel{ + expected: []labelpb.Labels{ {{Name: "a", Value: "1"}, {Name: "b", Value: "1"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}, {Name: "ext2", Value: "value2"}}, @@ -416,14 +417,14 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { }, { req: &storepb.SeriesRequest{ - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_NEQ, Name: "a", Value: "not_existing"}, }, MinTime: mint, MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]labelpb.ZLabel{ + expected: []labelpb.Labels{ {{Name: "a", Value: "1"}, {Name: "b", Value: "1"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}, {Name: "ext2", Value: "value2"}}, @@ -438,7 +439,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { // Problem: Matcher that was selecting NO series, was ignored instead of passed as emptyPosting to Intersect. { req: &storepb.SeriesRequest{ - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "1"}, {Type: storepb.LabelMatcher_RE, Name: "non_existing", Value: "something"}, }, @@ -449,7 +450,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { // Test skip-chunk option. { req: &storepb.SeriesRequest{ - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "1"}, }, MinTime: mint, @@ -457,7 +458,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { SkipChunks: true, }, expectedChunkLen: 0, - expected: [][]labelpb.ZLabel{ + expected: []labelpb.Labels{ {{Name: "a", Value: "1"}, {Name: "b", Value: "1"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}, {Name: "ext2", Value: "value2"}}, @@ -472,7 +473,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { testutil.Equals(t, len(tcase.expected), len(srv.SeriesSet)) for i, s := range srv.SeriesSet { - testutil.Equals(t, tcase.expected[i], s.Labels) + thanostestutil.ProtoEquals(t, tcase.expected[i], labelpb.Labels(s.Labels)) testutil.Equals(t, tcase.expectedChunkLen, len(s.Chunks)) } }); !ok { @@ -580,14 +581,14 @@ func TestBucketStore_TimePartitioning_e2e(t *testing.T) { testutil.Equals(t, filterMaxTime.PrometheusTimestamp(), maxt) req := &storepb.SeriesRequest{ - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "1"}, }, MinTime: mint, MaxTime: timestamp.FromTime(time.Now().AddDate(0, 0, 1)), } - expectedLabels := [][]labelpb.ZLabel{ + expectedLabels := []labelpb.Labels{ {{Name: "a", Value: "1"}, {Name: "b", Value: "1"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}, {Name: "ext1", Value: "value1"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}, {Name: "ext2", Value: "value2"}}, @@ -601,7 +602,7 @@ func TestBucketStore_TimePartitioning_e2e(t *testing.T) { testutil.Equals(t, len(expectedLabels), len(srv.SeriesSet)) for i, s := range srv.SeriesSet { - testutil.Equals(t, expectedLabels[i], s.Labels) + thanostestutil.ProtoEquals(t, expectedLabels[i], labelpb.Labels(s.Labels)) // prepareTestBlocks makes 3 chunks containing 2 hour data, // we should only get 1, as we are filtering by time. @@ -679,7 +680,7 @@ func TestBucketStore_Series_ChunksLimiter_e2e(t *testing.T) { testutil.Ok(t, s.store.SyncBlocks(ctx)) req := &storepb.SeriesRequest{ - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "1"}, }, MinTime: minTimeDuration.PrometheusTimestamp(), @@ -726,7 +727,7 @@ func TestBucketStore_Series_CustomBytesLimiters_e2e(t *testing.T) { testutil.Ok(t, s.store.SyncBlocks(ctx)) req := &storepb.SeriesRequest{ - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "1"}, }, MinTime: minTimeDuration.PrometheusTimestamp(), @@ -781,7 +782,7 @@ func TestBucketStore_LabelNames_e2e(t *testing.T) { req: &storepb.LabelNamesRequest{ Start: timestamp.FromTime(minTime), End: timestamp.FromTime(maxTime), - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ { Type: storepb.LabelMatcher_EQ, Name: "a", @@ -795,7 +796,7 @@ func TestBucketStore_LabelNames_e2e(t *testing.T) { req: &storepb.LabelNamesRequest{ Start: timestamp.FromTime(minTime), End: timestamp.FromTime(maxTime), - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ { Type: storepb.LabelMatcher_EQ, Name: "b", @@ -810,7 +811,7 @@ func TestBucketStore_LabelNames_e2e(t *testing.T) { req: &storepb.LabelNamesRequest{ Start: timestamp.FromTime(minTime), End: timestamp.FromTime(maxTime), - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ { Type: storepb.LabelMatcher_EQ, Name: "b", @@ -824,7 +825,7 @@ func TestBucketStore_LabelNames_e2e(t *testing.T) { req: &storepb.LabelNamesRequest{ Start: timestamp.FromTime(time.Now().Add(-24 * time.Hour)), End: timestamp.FromTime(time.Now().Add(-23 * time.Hour)), - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ { Type: storepb.LabelMatcher_EQ, Name: "a", @@ -877,7 +878,7 @@ func TestBucketStore_LabelNames_SeriesLimiter_e2e(t *testing.T) { s := prepareStoreWithTestBlocks(t, dir, bkt, false, NewChunksLimiterFactory(0), NewSeriesLimiterFactory(testData.maxSeriesLimit), NewBytesLimiterFactory(0), emptyRelabelConfig, allowAllFilterConf) testutil.Ok(t, s.store.SyncBlocks(ctx)) req := &storepb.LabelNamesRequest{ - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "1"}, }, Start: minTimeDuration.PrometheusTimestamp(), @@ -941,7 +942,7 @@ func TestBucketStore_LabelValues_e2e(t *testing.T) { Label: "a", Start: timestamp.FromTime(minTime), End: timestamp.FromTime(maxTime), - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ { Type: storepb.LabelMatcher_EQ, Name: "a", @@ -956,7 +957,7 @@ func TestBucketStore_LabelValues_e2e(t *testing.T) { Label: "a", Start: timestamp.FromTime(minTime), End: timestamp.FromTime(maxTime), - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ { Type: storepb.LabelMatcher_EQ, Name: "a", @@ -984,7 +985,7 @@ func TestBucketStore_LabelValues_e2e(t *testing.T) { Label: "ext1", Start: timestamp.FromTime(minTime), End: timestamp.FromTime(maxTime), - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ { Type: storepb.LabelMatcher_EQ, Name: "c", @@ -1042,7 +1043,7 @@ func TestBucketStore_LabelValues_SeriesLimiter_e2e(t *testing.T) { Label: "a", Start: minTimeDuration.PrometheusTimestamp(), End: maxTimeDuration.PrometheusTimestamp(), - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ { Type: storepb.LabelMatcher_EQ, Name: "a", diff --git a/pkg/store/bucket_test.go b/pkg/store/bucket_test.go index f2f923d7264..8860002ddfd 100644 --- a/pkg/store/bucket_test.go +++ b/pkg/store/bucket_test.go @@ -26,8 +26,6 @@ import ( "github.com/cespare/xxhash" "github.com/efficientgo/core/testutil" "github.com/go-kit/log" - "github.com/gogo/protobuf/proto" - "github.com/gogo/protobuf/types" "github.com/leanovate/gopter" "github.com/leanovate/gopter/gen" "github.com/leanovate/gopter/prop" @@ -45,6 +43,8 @@ import ( "github.com/prometheus/prometheus/tsdb/index" "go.uber.org/atomic" "golang.org/x/exp/slices" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" "github.com/thanos-io/objstore" "github.com/thanos-io/objstore/providers/filesystem" @@ -63,6 +63,7 @@ import ( "github.com/thanos-io/thanos/pkg/store/storepb" storetestutil "github.com/thanos-io/thanos/pkg/store/storepb/testutil" "github.com/thanos-io/thanos/pkg/tenancy" + thanostestutil "github.com/thanos-io/thanos/pkg/testutil" "github.com/thanos-io/thanos/pkg/testutil/e2eutil" ) @@ -84,7 +85,7 @@ func TestBucketBlock_Property(t *testing.T) { parameters.MinSuccessfulTests = 20000 properties := gopter.NewProperties(parameters) - set := newBucketBlockSet(labels.Labels{}) + set := newBucketBlockSet(labelpb.EmptyLabels()) type resBlock struct { mint, maxt int64 @@ -365,7 +366,7 @@ func TestBucketBlock_matchLabels(t *testing.T) { func TestBucketBlockSet_addGet(t *testing.T) { t.Parallel() - set := newBucketBlockSet(labels.Labels{}) + set := newBucketBlockSet(labelpb.EmptyLabels()) type resBlock struct { mint, maxt int64 @@ -476,7 +477,7 @@ func TestBucketBlockSet_addGet(t *testing.T) { func TestBucketBlockSet_remove(t *testing.T) { t.Parallel() - set := newBucketBlockSet(labels.Labels{}) + set := newBucketBlockSet(labelpb.EmptyLabels()) type resBlock struct { id ulid.ULID @@ -506,7 +507,7 @@ func TestBucketBlockSet_remove(t *testing.T) { func TestBucketBlockSet_labelMatchers(t *testing.T) { t.Parallel() - set := newBucketBlockSet(labels.FromStrings("a", "b", "c", "d")) + set := newBucketBlockSet(labelpb.FromStrings("a", "b", "c", "d")) cases := []struct { in []*labels.Matcher @@ -721,32 +722,32 @@ func TestBucketStore_TSDBInfo(t *testing.T) { testutil.Ok(t, bucketStore.SyncBlocks(ctx)) infos := bucketStore.TSDBInfos() - slices.SortFunc(infos, func(a, b infopb.TSDBInfo) int { + slices.SortFunc(infos, func(a, b *infopb.TSDBInfo) int { return strings.Compare(a.Labels.String(), b.Labels.String()) }) - testutil.Equals(t, infos, []infopb.TSDBInfo{ + thanostestutil.ProtoEquals(t, infos, []*infopb.TSDBInfo{ { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "a", Value: "b"}}}, + Labels: labelpb.LabelSetFromStrings("a", "b"), MinTime: 0, MaxTime: 2000, }, { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "a", Value: "b"}}}, + Labels: labelpb.LabelSetFromStrings("a", "b"), MinTime: 3000, MaxTime: 5000, }, { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "a", Value: "c"}}}, + Labels: labelpb.LabelSetFromStrings("a", "c"), MinTime: 0, MaxTime: 2000, }, { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "a", Value: "d"}}}, + Labels: labelpb.LabelSetFromStrings("a", "d"), MinTime: 0, MaxTime: 1000, }, { - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: "a", Value: "d"}}}, + Labels: labelpb.LabelSetFromStrings("a", "d"), MinTime: 2000, MaxTime: 3000, }, @@ -825,35 +826,16 @@ func testSharding(t *testing.T, reuseDisk string, bkt objstore.Bucket, all ...ul name string relabel string expectedIDs []ulid.ULID - expectedAdvLabels []labelpb.ZLabelSet + expectedAdvLabels []*labelpb.LabelSet }{ { name: "no sharding", expectedIDs: all, - expectedAdvLabels: []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "cluster", Value: "a"}, - {Name: "region", Value: "r1"}, - }, - }, - { - Labels: []labelpb.ZLabel{ - {Name: "cluster", Value: "a"}, - {Name: "region", Value: "r2"}, - }, - }, - { - Labels: []labelpb.ZLabel{ - {Name: "cluster", Value: "b"}, - {Name: "region", Value: "r1"}, - }, - }, - { - Labels: []labelpb.ZLabel{ - {Name: CompatibilityTypeLabelName, Value: "store"}, - }, - }, + expectedAdvLabels: []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("cluster", "a", "region", "r1"), + labelpb.LabelSetFromStrings("cluster", "a", "region", "r2"), + labelpb.LabelSetFromStrings("cluster", "b", "region", "r1"), + labelpb.LabelSetFromStrings(CompatibilityTypeLabelName, "store"), }, }, { @@ -865,18 +847,9 @@ func testSharding(t *testing.T, reuseDisk string, bkt objstore.Bucket, all ...ul - cluster `, expectedIDs: []ulid.ULID{all[2]}, - expectedAdvLabels: []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "cluster", Value: "b"}, - {Name: "region", Value: "r1"}, - }, - }, - { - Labels: []labelpb.ZLabel{ - {Name: CompatibilityTypeLabelName, Value: "store"}, - }, - }, + expectedAdvLabels: []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("cluster", "b", "region", "r1"), + labelpb.LabelSetFromStrings(CompatibilityTypeLabelName, "store"), }, }, { @@ -888,24 +861,10 @@ func testSharding(t *testing.T, reuseDisk string, bkt objstore.Bucket, all ...ul - cluster `, expectedIDs: []ulid.ULID{all[0], all[1], all[3]}, - expectedAdvLabels: []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "cluster", Value: "a"}, - {Name: "region", Value: "r1"}, - }, - }, - { - Labels: []labelpb.ZLabel{ - {Name: "cluster", Value: "a"}, - {Name: "region", Value: "r2"}, - }, - }, - { - Labels: []labelpb.ZLabel{ - {Name: CompatibilityTypeLabelName, Value: "store"}, - }, - }, + expectedAdvLabels: []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("cluster", "a", "region", "r1"), + labelpb.LabelSetFromStrings("cluster", "a", "region", "r2"), + labelpb.LabelSetFromStrings(CompatibilityTypeLabelName, "store"), }, }, { @@ -921,18 +880,9 @@ func testSharding(t *testing.T, reuseDisk string, bkt objstore.Bucket, all ...ul - region `, expectedIDs: []ulid.ULID{all[0], all[1]}, - expectedAdvLabels: []labelpb.ZLabelSet{ - { - Labels: []labelpb.ZLabel{ - {Name: "cluster", Value: "a"}, - {Name: "region", Value: "r1"}, - }, - }, - { - Labels: []labelpb.ZLabel{ - {Name: CompatibilityTypeLabelName, Value: "store"}, - }, - }, + expectedAdvLabels: []*labelpb.LabelSet{ + labelpb.LabelSetFromStrings("cluster", "a", "region", "r1"), + labelpb.LabelSetFromStrings(CompatibilityTypeLabelName, "store"), }, }, { @@ -948,7 +898,7 @@ func testSharding(t *testing.T, reuseDisk string, bkt objstore.Bucket, all ...ul - region `, expectedIDs: []ulid.ULID{}, - expectedAdvLabels: []labelpb.ZLabelSet{}, + expectedAdvLabels: []*labelpb.LabelSet{}, }, } { t.Run(sc.name, func(t *testing.T) { @@ -1482,7 +1432,7 @@ func benchBucketSeries(t testutil.TB, sampleType chunkenc.ValueType, skipChunk, TSDBDir: filepath.Join(tmpDir, fmt.Sprintf("%d", bi)), SamplesPerSeries: samplesPerSeriesPerBlock, Series: seriesPerBlock, - PrependLabels: extLset, + PrependLabels: labelpb.FromPromLabels(extLset), Random: random, SkipChunks: t.IsBenchmark() || skipChunk, SampleType: sampleType, @@ -1509,7 +1459,7 @@ func benchBucketSeries(t testutil.TB, sampleType chunkenc.ValueType, skipChunk, // instead of the in-memory one. diskBlock, err := tsdb.OpenBlock(logger, blockIDDir, nil) testutil.Ok(t, err) - series = append(series, storetestutil.ReadSeriesFromBlock(t, diskBlock, extLset, skipChunk)...) + series = append(series, storetestutil.ReadSeriesFromBlock(t, diskBlock, labelpb.FromPromLabels(extLset), skipChunk)...) meta, err = metadata.InjectThanos(logger, blockIDDir, thanosMeta, nil) testutil.Ok(t, err) @@ -1777,7 +1727,7 @@ func TestBucketSeries_OneBlock_InMemIndexCacheSegfault(t *testing.T) { indexReaderPool: indexheader.NewReaderPool(log.NewNopLogger(), false, 0, indexheader.NewReaderPoolMetrics(nil), indexheader.AlwaysEagerDownloadIndexHeader), metrics: newBucketStoreMetrics(nil), blockSets: map[uint64]*bucketBlockSet{ - labels.FromStrings("ext1", "1").Hash(): {blocks: [][]*bucketBlock{{b1, b2}}}, + labelpb.Hash(labelpb.FromStrings("ext1", "1")): {blocks: [][]*bucketBlock{{b1, b2}}}, }, blocks: map[ulid.ULID]*bucketBlock{ b1.meta.ULID: b1, @@ -1797,7 +1747,7 @@ func TestBucketSeries_OneBlock_InMemIndexCacheSegfault(t *testing.T) { testutil.Ok(t, store.Series(&storepb.SeriesRequest{ MinTime: 0, MaxTime: int64(numSeries) - 1, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "foo", Value: "bar"}, {Type: storepb.LabelMatcher_EQ, Name: "b", Value: "1"}, // This bug shows only when we use lot's of symbols for matching. @@ -1812,7 +1762,7 @@ func TestBucketSeries_OneBlock_InMemIndexCacheSegfault(t *testing.T) { testutil.Ok(t, store.Series(&storepb.SeriesRequest{ MinTime: 0, MaxTime: int64(numSeries) - 1, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "foo", Value: "bar"}, {Type: storepb.LabelMatcher_EQ, Name: "b", Value: "2"}, // This bug shows only when we use lot's of symbols for matching. @@ -1829,7 +1779,7 @@ func TestBucketSeries_OneBlock_InMemIndexCacheSegfault(t *testing.T) { testutil.Ok(t, store.Series(&storepb.SeriesRequest{ MinTime: 0, MaxTime: int64(numSeries) - 1, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "foo", Value: "bar"}, {Type: storepb.LabelMatcher_EQ, Name: "b", Value: "1"}, // This bug shows only when we use lot's of symbols for matching. @@ -1853,14 +1803,14 @@ func TestSeries_RequestAndResponseHints(t *testing.T) { Req: &storepb.SeriesRequest{ MinTime: 0, MaxTime: 1, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "foo", Value: "bar"}, }, }, ExpectedSeries: seriesSet1, - ExpectedHints: []hintspb.SeriesResponseHints{ + ExpectedHints: []*hintspb.SeriesResponseHints{ { - QueriedBlocks: []hintspb.Block{ + QueriedBlocks: []*hintspb.Block{ {Id: block1.String()}, }, }, @@ -1871,14 +1821,14 @@ func TestSeries_RequestAndResponseHints(t *testing.T) { Req: &storepb.SeriesRequest{ MinTime: 0, MaxTime: 3, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "foo", Value: "bar"}, }, }, ExpectedSeries: append(append([]*storepb.Series{}, seriesSet1...), seriesSet2...), - ExpectedHints: []hintspb.SeriesResponseHints{ + ExpectedHints: []*hintspb.SeriesResponseHints{ { - QueriedBlocks: []hintspb.Block{ + QueriedBlocks: []*hintspb.Block{ {Id: block1.String()}, {Id: block2.String()}, }, @@ -1890,19 +1840,19 @@ func TestSeries_RequestAndResponseHints(t *testing.T) { Req: &storepb.SeriesRequest{ MinTime: 0, MaxTime: 3, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "foo", Value: "bar"}, }, Hints: mustMarshalAny(&hintspb.SeriesRequestHints{ - BlockMatchers: []storepb.LabelMatcher{ + BlockMatchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: block.BlockIDLabel, Value: block1.String()}, }, }), }, ExpectedSeries: seriesSet1, - ExpectedHints: []hintspb.SeriesResponseHints{ + ExpectedHints: []*hintspb.SeriesResponseHints{ { - QueriedBlocks: []hintspb.Block{ + QueriedBlocks: []*hintspb.Block{ {Id: block1.String()}, }, }, @@ -1913,20 +1863,20 @@ func TestSeries_RequestAndResponseHints(t *testing.T) { Req: &storepb.SeriesRequest{ MinTime: 0, MaxTime: 3, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "foo", Value: "bar"}, }, Hints: mustMarshalAny(&hintspb.SeriesRequestHints{ - BlockMatchers: []storepb.LabelMatcher{ + BlockMatchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: block.BlockIDLabel, Value: block1.String()}, }, EnableQueryStats: true, }), }, ExpectedSeries: seriesSet1, - ExpectedHints: []hintspb.SeriesResponseHints{ + ExpectedHints: []*hintspb.SeriesResponseHints{ { - QueriedBlocks: []hintspb.Block{ + QueriedBlocks: []*hintspb.Block{ {Id: block1.String()}, }, QueryStats: &hintspb.QueryStats{ @@ -1942,17 +1892,17 @@ func TestSeries_RequestAndResponseHints(t *testing.T) { }, }, }, - HintsCompareFunc: func(t testutil.TB, expected, actual hintspb.SeriesResponseHints) { - testutil.Equals(t, expected.QueriedBlocks, actual.QueriedBlocks) - testutil.Equals(t, expected.QueryStats.BlocksQueried, actual.QueryStats.BlocksQueried) - testutil.Equals(t, expected.QueryStats.PostingsTouched, actual.QueryStats.PostingsTouched) - testutil.Equals(t, expected.QueryStats.PostingsFetched, actual.QueryStats.PostingsFetched) - testutil.Equals(t, expected.QueryStats.SeriesTouched, actual.QueryStats.SeriesTouched) - testutil.Equals(t, expected.QueryStats.SeriesFetched, actual.QueryStats.SeriesFetched) - testutil.Equals(t, expected.QueryStats.ChunksTouched, actual.QueryStats.ChunksTouched) - testutil.Equals(t, expected.QueryStats.ChunksFetched, actual.QueryStats.ChunksFetched) - testutil.Equals(t, expected.QueryStats.MergedSeriesCount, actual.QueryStats.MergedSeriesCount) - testutil.Equals(t, expected.QueryStats.MergedChunksCount, actual.QueryStats.MergedChunksCount) + HintsCompareFunc: func(t testutil.TB, expected, actual *hintspb.SeriesResponseHints) { + thanostestutil.ProtoEquals(t, expected.QueriedBlocks, actual.QueriedBlocks) + thanostestutil.ProtoEquals(t, expected.QueryStats.BlocksQueried, actual.QueryStats.BlocksQueried) + thanostestutil.ProtoEquals(t, expected.QueryStats.PostingsTouched, actual.QueryStats.PostingsTouched) + thanostestutil.ProtoEquals(t, expected.QueryStats.PostingsFetched, actual.QueryStats.PostingsFetched) + thanostestutil.ProtoEquals(t, expected.QueryStats.SeriesTouched, actual.QueryStats.SeriesTouched) + thanostestutil.ProtoEquals(t, expected.QueryStats.SeriesFetched, actual.QueryStats.SeriesFetched) + thanostestutil.ProtoEquals(t, expected.QueryStats.ChunksTouched, actual.QueryStats.ChunksTouched) + thanostestutil.ProtoEquals(t, expected.QueryStats.ChunksFetched, actual.QueryStats.ChunksFetched) + thanostestutil.ProtoEquals(t, expected.QueryStats.MergedSeriesCount, actual.QueryStats.MergedSeriesCount) + thanostestutil.ProtoEquals(t, expected.QueryStats.MergedChunksCount, actual.QueryStats.MergedChunksCount) }, }, } @@ -2011,7 +1961,7 @@ func TestSeries_ErrorUnmarshallingRequestHints(t *testing.T) { req := &storepb.SeriesRequest{ MinTime: 0, MaxTime: 3, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "foo", Value: "bar"}, }, Hints: mustMarshalAny(&hintspb.SeriesResponseHints{}), @@ -2135,7 +2085,7 @@ func TestSeries_BlockWithMultipleChunks(t *testing.T) { req := &storepb.SeriesRequest{ MinTime: testData.reqMinTime, MaxTime: testData.reqMaxTime, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "__name__", Value: "test"}, }, } @@ -2267,7 +2217,7 @@ func TestSeries_SeriesSortedWithoutReplicaLabels(t *testing.T) { req := &storepb.SeriesRequest{ MinTime: math.MinInt, MaxTime: math.MaxInt64, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "a", Value: ".+"}, }, WithoutReplicaLabels: testData.replicaLabels, @@ -2280,7 +2230,7 @@ func TestSeries_SeriesSortedWithoutReplicaLabels(t *testing.T) { var response []labels.Labels for _, respSeries := range srv.SeriesSet { - promLabels := labelpb.ZLabelsToPromLabels(respSeries.Labels) + promLabels := labelpb.ToPromLabels(respSeries.Labels) response = append(response, promLabels) } @@ -2324,8 +2274,8 @@ func uploadSeriesToBucket(t *testing.T, bkt *filesystem.Bucket, replica string, return h } -func mustMarshalAny(pb proto.Message) *types.Any { - out, err := types.MarshalAny(pb) +func mustMarshalAny(pb proto.Message) *anypb.Any { + out, err := anypb.New(pb) if err != nil { panic(err) } @@ -2405,7 +2355,7 @@ func setupStoreForHintsTest(t *testing.T) (testutil.TB, *BucketStore, []*storepb TSDBDir: filepath.Join(tmpDir, "0"), SamplesPerSeries: 1, Series: 2, - PrependLabels: extLset, + PrependLabels: labelpb.FromPromLabels(extLset), Random: random, }) block1 := storetestutil.CreateBlockFromHead(t, bktDir, head) @@ -2414,7 +2364,7 @@ func setupStoreForHintsTest(t *testing.T) (testutil.TB, *BucketStore, []*storepb TSDBDir: filepath.Join(tmpDir, "1"), SamplesPerSeries: 1, Series: 2, - PrependLabels: extLset, + PrependLabels: labelpb.FromPromLabels(extLset), Random: random, }) block2 := storetestutil.CreateBlockFromHead(t, bktDir, head2) @@ -2473,11 +2423,11 @@ func TestLabelNamesAndValuesHints(t *testing.T) { labelNamesReq *storepb.LabelNamesRequest expectedNames []string - expectedNamesHints hintspb.LabelNamesResponseHints + expectedNamesHints *hintspb.LabelNamesResponseHints labelValuesReq *storepb.LabelValuesRequest expectedValues []string - expectedValuesHints hintspb.LabelValuesResponseHints + expectedValuesHints *hintspb.LabelValuesResponseHints } testCases := []labelNamesValuesCase{ @@ -2489,8 +2439,8 @@ func TestLabelNamesAndValuesHints(t *testing.T) { End: 1, }, expectedNames: labelNamesFromSeriesSet(seriesSet1), - expectedNamesHints: hintspb.LabelNamesResponseHints{ - QueriedBlocks: []hintspb.Block{ + expectedNamesHints: &hintspb.LabelNamesResponseHints{ + QueriedBlocks: []*hintspb.Block{ {Id: block1.String()}, }, }, @@ -2501,8 +2451,8 @@ func TestLabelNamesAndValuesHints(t *testing.T) { End: 1, }, expectedValues: []string{"1"}, - expectedValuesHints: hintspb.LabelValuesResponseHints{ - QueriedBlocks: []hintspb.Block{ + expectedValuesHints: &hintspb.LabelValuesResponseHints{ + QueriedBlocks: []*hintspb.Block{ {Id: block1.String()}, }, }, @@ -2517,8 +2467,8 @@ func TestLabelNamesAndValuesHints(t *testing.T) { expectedNames: labelNamesFromSeriesSet( append(append([]*storepb.Series{}, seriesSet1...), seriesSet2...), ), - expectedNamesHints: hintspb.LabelNamesResponseHints{ - QueriedBlocks: []hintspb.Block{ + expectedNamesHints: &hintspb.LabelNamesResponseHints{ + QueriedBlocks: []*hintspb.Block{ {Id: block1.String()}, {Id: block2.String()}, }, @@ -2530,8 +2480,8 @@ func TestLabelNamesAndValuesHints(t *testing.T) { End: 3, }, expectedValues: []string{"1"}, - expectedValuesHints: hintspb.LabelValuesResponseHints{ - QueriedBlocks: []hintspb.Block{ + expectedValuesHints: &hintspb.LabelValuesResponseHints{ + QueriedBlocks: []*hintspb.Block{ {Id: block1.String()}, {Id: block2.String()}, }, @@ -2543,14 +2493,14 @@ func TestLabelNamesAndValuesHints(t *testing.T) { Start: 0, End: 3, Hints: mustMarshalAny(&hintspb.LabelNamesRequestHints{ - BlockMatchers: []storepb.LabelMatcher{ + BlockMatchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: block.BlockIDLabel, Value: block1.String()}, }, }), }, expectedNames: labelNamesFromSeriesSet(seriesSet1), - expectedNamesHints: hintspb.LabelNamesResponseHints{ - QueriedBlocks: []hintspb.Block{ + expectedNamesHints: &hintspb.LabelNamesResponseHints{ + QueriedBlocks: []*hintspb.Block{ {Id: block1.String()}, }, }, @@ -2560,14 +2510,14 @@ func TestLabelNamesAndValuesHints(t *testing.T) { Start: 0, End: 3, Hints: mustMarshalAny(&hintspb.LabelValuesRequestHints{ - BlockMatchers: []storepb.LabelMatcher{ + BlockMatchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: block.BlockIDLabel, Value: block1.String()}, }, }), }, expectedValues: []string{"1"}, - expectedValuesHints: hintspb.LabelValuesResponseHints{ - QueriedBlocks: []hintspb.Block{ + expectedValuesHints: &hintspb.LabelValuesResponseHints{ + QueriedBlocks: []*hintspb.Block{ {Id: block1.String()}, }, }, @@ -2580,25 +2530,25 @@ func TestLabelNamesAndValuesHints(t *testing.T) { testutil.Ok(t, err) testutil.Equals(t, tc.expectedNames, namesResp.Names) - var namesHints hintspb.LabelNamesResponseHints - testutil.Ok(t, types.UnmarshalAny(namesResp.Hints, &namesHints)) + namesHints := &hintspb.LabelNamesResponseHints{} + testutil.Ok(t, namesResp.Hints.UnmarshalTo(namesHints)) // The order is not determinate, so we are sorting them. sort.Slice(namesHints.QueriedBlocks, func(i, j int) bool { return namesHints.QueriedBlocks[i].Id < namesHints.QueriedBlocks[j].Id }) - testutil.Equals(t, tc.expectedNamesHints, namesHints) + thanostestutil.ProtoEquals(t, tc.expectedNamesHints, namesHints) valuesResp, err := store.LabelValues(context.Background(), tc.labelValuesReq) testutil.Ok(t, err) testutil.Equals(t, tc.expectedValues, valuesResp.Values) - var valuesHints hintspb.LabelValuesResponseHints - testutil.Ok(t, types.UnmarshalAny(valuesResp.Hints, &valuesHints)) + valuesHints := &hintspb.LabelValuesResponseHints{} + testutil.Ok(t, valuesResp.Hints.UnmarshalTo(valuesHints)) // The order is not determinate, so we are sorting them. sort.Slice(valuesHints.QueriedBlocks, func(i, j int) bool { return valuesHints.QueriedBlocks[i].Id < valuesHints.QueriedBlocks[j].Id }) - testutil.Equals(t, tc.expectedValuesHints, valuesHints) + thanostestutil.ProtoEquals(t, tc.expectedValuesHints, valuesHints) }) } } @@ -2692,7 +2642,7 @@ func TestSeries_ChunksHaveHashRepresentation(t *testing.T) { req := &storepb.SeriesRequest{ MinTime: int64(reqMinTime), MaxTime: int64(reqMaxTime), - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "__name__", Value: "test"}, }, } @@ -2820,7 +2770,7 @@ func prepareBucket(b *testing.B, resolutionLevel compact.ResolutionLevel) (*buck SamplesPerSeries: 86400 / 15, // Simulate 1 day block with 15s scrape interval. ScrapeInterval: 15 * time.Second, Series: 1000, - PrependLabels: labels.EmptyLabels(), + PrependLabels: labelpb.EmptyLabels(), Random: rand.New(rand.NewSource(120)), SkipChunks: true, }) @@ -2894,7 +2844,7 @@ func benchmarkBlockSeriesWithConcurrency(b *testing.B, concurrency int, blockMet req := &storepb.SeriesRequest{ MinTime: blockMeta.MinTime, MaxTime: blockMeta.MaxTime, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "i", Value: labelMatcher}, }, SkipChunks: false, @@ -3505,7 +3455,7 @@ func TestExpandedPostingsRace(t *testing.T) { SamplesPerSeries: 10, ScrapeInterval: 15 * time.Second, Series: 1000, - PrependLabels: labels.EmptyLabels(), + PrependLabels: labelpb.EmptyLabels(), Random: rand.New(rand.NewSource(120)), SkipChunks: true, }) @@ -3699,13 +3649,13 @@ func TestBucketStoreDedupOnBlockSeriesSet(t *testing.T) { WithoutReplicaLabels: []string{"replica"}, MinTime: timestamp.FromTime(minTime), MaxTime: timestamp.FromTime(maxTime), - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_NEQ, Name: "z", Value: ""}, }, }, srv)) - testutil.Equals(t, true, slices.IsSortedFunc(srv.SeriesSet, func(x, y storepb.Series) int { - return labels.Compare(x.PromLabels(), y.PromLabels()) + testutil.Equals(t, true, slices.IsSortedFunc(srv.SeriesSet, func(x, y *storepb.Series) int { + return labelpb.Compare(labelpb.Labels(x.Labels), labelpb.Labels(y.Labels)) })) testutil.Equals(t, 2, len(srv.SeriesSet)) } @@ -3943,7 +3893,7 @@ func TestBucketStoreStreamingSeriesLimit(t *testing.T) { req := &storepb.SeriesRequest{ MinTime: timestamp.FromTime(minTime), MaxTime: timestamp.FromTime(maxTime), - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "1"}, {Type: storepb.LabelMatcher_RE, Name: "z", Value: "1|2"}, }, @@ -4039,7 +3989,7 @@ func TestBucketStoreMetadataLimit(t *testing.T) { MinTime: timestamp.FromTime(minTime), MaxTime: timestamp.FromTime(maxTime), Limit: testData.limit, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "j", Value: "foo"}, }, } @@ -4070,7 +4020,7 @@ func TestBucketStoreMetadataLimit(t *testing.T) { Start: timestamp.FromTime(minTime), End: timestamp.FromTime(maxTime), Limit: testData.limit, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "j", Value: "foo"}, }, } @@ -4101,7 +4051,7 @@ func TestBucketStoreMetadataLimit(t *testing.T) { End: timestamp.FromTime(maxTime), Label: "j", Limit: testData.limit, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "j", Value: "(foo|bar)"}, }, } diff --git a/pkg/store/cache/matchers_cache.go b/pkg/store/cache/matchers_cache.go index e3b18603a6f..3afabfce9e3 100644 --- a/pkg/store/cache/matchers_cache.go +++ b/pkg/store/cache/matchers_cache.go @@ -180,10 +180,10 @@ func newMatcherCacheMetrics(reg prometheus.Registerer) *matcherCacheMetrics { // MatchersToPromMatchersCached returns Prometheus matchers from proto matchers. // Works analogously to MatchersToPromMatchers but uses cache to avoid unnecessary allocations and conversions. // NOTE: It allocates memory. -func MatchersToPromMatchersCached(cache MatchersCache, ms ...storepb.LabelMatcher) ([]*labels.Matcher, error) { +func MatchersToPromMatchersCached(cache MatchersCache, ms ...*storepb.LabelMatcher) ([]*labels.Matcher, error) { res := make([]*labels.Matcher, 0, len(ms)) for i := range ms { - pm, err := cache.GetOrSet(&ms[i], func() (*labels.Matcher, error) { return storepb.MatcherToPromMatcher(ms[i]) }) + pm, err := cache.GetOrSet(ms[i], func() (*labels.Matcher, error) { return storepb.MatcherToPromMatcher(ms[i]) }) if err != nil { return nil, err } diff --git a/pkg/store/cache/matchers_cache_test.go b/pkg/store/cache/matchers_cache_test.go index f90da976e1c..354f9c71760 100644 --- a/pkg/store/cache/matchers_cache_test.go +++ b/pkg/store/cache/matchers_cache_test.go @@ -56,7 +56,7 @@ func TestMatchersCache(t *testing.T) { newItem := func(matcher *storepb.LabelMatcher) func() (*labels.Matcher, error) { return func() (*labels.Matcher, error) { cacheHit = false - return storepb.MatcherToPromMatcher(*matcher) + return storepb.MatcherToPromMatcher(matcher) } } expected := labels.MustNewMatcher(labels.MatchEqual, "key", "val") @@ -126,7 +126,7 @@ func BenchmarkMatchersCache(b *testing.B) { for i := 0; i < b.N; i++ { matcher := matchers[i%len(matchers)] _, err := cache.GetOrSet(matcher, func() (*labels.Matcher, error) { - return storepb.MatcherToPromMatcher(*matcher) + return storepb.MatcherToPromMatcher(matcher) }) if err != nil { b.Fatalf("failed to get or set cache item: %v", err) diff --git a/pkg/store/detector.go b/pkg/store/detector.go index 023d008ce6e..976ee01f3a6 100644 --- a/pkg/store/detector.go +++ b/pkg/store/detector.go @@ -4,16 +4,17 @@ package store import ( - "strings" + "bytes" "github.com/prometheus/prometheus/model/labels" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" ) // So far we found there is a bug in prometheus tsdb code when OOO is enabled. // This is a workaround to detect the issue when tsdb selects irrelevant matched data. // See https://github.com/thanos-io/thanos/issues/7481 -func detectCorruptLabels(lbls labels.Labels, matchers []storepb.LabelMatcher) bool { +func detectCorruptLabels(lbls labelpb.Labels, matchers []*storepb.LabelMatcher) bool { for _, m := range matchers { v := lbls.Get(m.Name) if v == "" { @@ -22,7 +23,7 @@ func detectCorruptLabels(lbls labels.Labels, matchers []storepb.LabelMatcher) bo if (m.Type == storepb.LabelMatcher_EQ && v != m.Value) || (m.Type == storepb.LabelMatcher_NEQ && v == m.Value) { return true - } else if m.Name == labels.MetricName && + } else if m.Name == labelpb.MetricName && (m.Type == storepb.LabelMatcher_RE || m.Type == storepb.LabelMatcher_NRE) { matcher, err := labels.NewFastRegexMatcher(m.Value) return err != nil || @@ -33,8 +34,8 @@ func detectCorruptLabels(lbls labels.Labels, matchers []storepb.LabelMatcher) bo return false } -func requestMatches(matchers []storepb.LabelMatcher) string { - var b strings.Builder +func requestMatches(matchers []*storepb.LabelMatcher) string { + b := bytes.Buffer{} for _, m := range matchers { b.WriteString(m.String()) } diff --git a/pkg/store/detector_test.go b/pkg/store/detector_test.go index 18b8572fefa..42ff3b61019 100644 --- a/pkg/store/detector_test.go +++ b/pkg/store/detector_test.go @@ -6,16 +6,16 @@ package store import ( "testing" - "github.com/prometheus/prometheus/model/labels" "github.com/stretchr/testify/assert" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" ) func TestDetectCorruptLabels_EQ(t *testing.T) { - good := labels.New(labels.Label{Name: labels.MetricName, Value: "up"}) - bad := labels.New(labels.Label{Name: labels.MetricName, Value: "kube_proxy_corrupt"}) - eq := []storepb.LabelMatcher{{Name: "__name__", Type: storepb.LabelMatcher_EQ, Value: "up"}} - neq := []storepb.LabelMatcher{{Name: "__name__", Type: storepb.LabelMatcher_NEQ, Value: "up"}} + good := labelpb.FromStrings("__name__", "up") + bad := labelpb.FromStrings("__name__", "kube_proxy_corrupt") + eq := []*storepb.LabelMatcher{{Name: "__name__", Type: storepb.LabelMatcher_EQ, Value: "up"}} + neq := []*storepb.LabelMatcher{{Name: "__name__", Type: storepb.LabelMatcher_NEQ, Value: "up"}} assert.False(t, detectCorruptLabels(good, eq)) assert.True(t, detectCorruptLabels(bad, eq)) assert.False(t, detectCorruptLabels(bad, neq)) @@ -23,10 +23,10 @@ func TestDetectCorruptLabels_EQ(t *testing.T) { } func TestDetectCorruptLabels_RE(t *testing.T) { - good := labels.New(labels.Label{Name: labels.MetricName, Value: "usage_database_pool"}) - bad := labels.New(labels.Label{Name: labels.MetricName, Value: "kube_proxy_corrupt"}) - re := []storepb.LabelMatcher{{Name: "__name__", Type: storepb.LabelMatcher_RE, Value: "usage_.+_pool"}} - nre := []storepb.LabelMatcher{{Name: "__name__", Type: storepb.LabelMatcher_NRE, Value: "usage_.+_pool"}} + good := labelpb.FromStrings("__name__", "usage_database_pool") + bad := labelpb.FromStrings("__name__", "kube_proxy_corrupt") + re := []*storepb.LabelMatcher{{Name: "__name__", Type: storepb.LabelMatcher_RE, Value: "usage_.+_pool"}} + nre := []*storepb.LabelMatcher{{Name: "__name__", Type: storepb.LabelMatcher_NRE, Value: "usage_.+_pool"}} assert.False(t, detectCorruptLabels(good, re)) assert.True(t, detectCorruptLabels(bad, re)) assert.False(t, detectCorruptLabels(bad, nre)) diff --git a/pkg/store/flushable.go b/pkg/store/flushable.go index 33680c3c896..fb45c122af5 100644 --- a/pkg/store/flushable.go +++ b/pkg/store/flushable.go @@ -4,7 +4,6 @@ package store import ( - "github.com/prometheus/prometheus/model/labels" "golang.org/x/exp/slices" "github.com/thanos-io/thanos/pkg/store/labelpb" @@ -69,17 +68,13 @@ func (r *resortingServer) Send(response *storepb.SeriesResponse) error { } series := response.GetSeries() - labelpb.ReAllocZLabelsStrings(&series.Labels, false) r.series = append(r.series, series) return nil } func (r *resortingServer) Flush() error { slices.SortFunc(r.series, func(a, b *storepb.Series) int { - return labels.Compare( - labelpb.ZLabelsToPromLabels(a.Labels), - labelpb.ZLabelsToPromLabels(b.Labels), - ) + return labelpb.Compare(a.Labels, b.Labels) }) if r.notSend { return nil diff --git a/pkg/store/hintspb/custom.go b/pkg/store/hintspb/custom.go index bf82d245e24..c163dea461a 100644 --- a/pkg/store/hintspb/custom.go +++ b/pkg/store/hintspb/custom.go @@ -3,22 +3,25 @@ package hintspb -import "github.com/oklog/ulid" +import ( + "github.com/oklog/ulid" + "google.golang.org/protobuf/types/known/durationpb" +) func (m *SeriesResponseHints) AddQueriedBlock(id ulid.ULID) { - m.QueriedBlocks = append(m.QueriedBlocks, Block{ + m.QueriedBlocks = append(m.QueriedBlocks, &Block{ Id: id.String(), }) } func (m *LabelNamesResponseHints) AddQueriedBlock(id ulid.ULID) { - m.QueriedBlocks = append(m.QueriedBlocks, Block{ + m.QueriedBlocks = append(m.QueriedBlocks, &Block{ Id: id.String(), }) } func (m *LabelValuesResponseHints) AddQueriedBlock(id ulid.ULID) { - m.QueriedBlocks = append(m.QueriedBlocks, Block{ + m.QueriedBlocks = append(m.QueriedBlocks, &Block{ Id: id.String(), }) } @@ -48,6 +51,15 @@ func (m *QueryStats) Merge(other *QueryStats) { m.ChunksTouched += other.ChunksTouched m.ChunksTouchedSizeSum += other.ChunksTouchedSizeSum - m.GetAllDuration += other.GetAllDuration - m.MergeDuration += other.MergeDuration + m.GetAllDuration = addDurations(m.GetAllDuration, other.GetAllDuration) + m.MergeDuration = addDurations(m.MergeDuration, other.MergeDuration) +} + +func addDurations(dst *durationpb.Duration, src *durationpb.Duration) *durationpb.Duration { + if dst == nil { + dst = &durationpb.Duration{} + } + dst.Seconds += src.GetSeconds() + dst.Nanos += src.GetNanos() + return dst } diff --git a/pkg/store/hintspb/custom_test.go b/pkg/store/hintspb/custom_test.go index 3d9691f7c10..d230e28af8a 100644 --- a/pkg/store/hintspb/custom_test.go +++ b/pkg/store/hintspb/custom_test.go @@ -7,27 +7,40 @@ import ( "reflect" "testing" - "github.com/efficientgo/core/testutil" + "google.golang.org/protobuf/types/known/durationpb" + + thanostestutil "github.com/thanos-io/thanos/pkg/testutil" ) func TestQueryStatsMerge(t *testing.T) { - s := &QueryStats{} - ps := reflect.Indirect(reflect.ValueOf(s)) - for i := 0; i < ps.NumField(); i++ { - ps.FieldByIndex([]int{i}).SetInt(int64(1)) + // Use reflection for int64 fields so newly added counters are + // automatically covered without updating this test. + setExportedInt64Fields := func(v reflect.Value, val int64) { + for i := 0; i < v.NumField(); i++ { + f := v.Field(i) + if !f.CanSet() || f.Kind() != reflect.Int64 { + continue + } + f.SetInt(val) + } } + + s := &QueryStats{} + setExportedInt64Fields(reflect.Indirect(reflect.ValueOf(s)), 1) + s.GetAllDuration = &durationpb.Duration{Seconds: 1, Nanos: 1} + s.MergeDuration = &durationpb.Duration{Seconds: 1, Nanos: 1} + o := &QueryStats{} - po := reflect.Indirect(reflect.ValueOf(o)) - for i := 0; i < po.NumField(); i++ { - po.FieldByIndex([]int{i}).SetInt(int64(100)) - } + setExportedInt64Fields(reflect.Indirect(reflect.ValueOf(o)), 100) + o.GetAllDuration = &durationpb.Duration{Seconds: 100, Nanos: 100} + o.MergeDuration = &durationpb.Duration{Seconds: 100, Nanos: 100} + s.Merge(o) - // Expected stats. e := &QueryStats{} - pe := reflect.Indirect(reflect.ValueOf(e)) - for i := 0; i < pe.NumField(); i++ { - pe.FieldByIndex([]int{i}).SetInt(int64(101)) - } - testutil.Equals(t, e, s) + setExportedInt64Fields(reflect.Indirect(reflect.ValueOf(e)), 101) + e.GetAllDuration = &durationpb.Duration{Seconds: 101, Nanos: 101} + e.MergeDuration = &durationpb.Duration{Seconds: 101, Nanos: 101} + + thanostestutil.ProtoEquals(t, e, s) } diff --git a/pkg/store/hintspb/hints.pb.go b/pkg/store/hintspb/hints.pb.go index 2098d7489c3..eb9784fddb1 100644 --- a/pkg/store/hintspb/hints.pb.go +++ b/pkg/store/hintspb/hints.pb.go @@ -1,2277 +1,792 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.20.1 // source: store/hintspb/hints.proto package hintspb import ( - fmt "fmt" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - - io "io" - math "math" - math_bits "math/bits" - time "time" + reflect "reflect" + sync "sync" + _ "github.com/srikrsna/protoc-gen-gotag/tagger" storepb "github.com/thanos-io/thanos/pkg/store/storepb" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type SeriesRequestHints struct { - /// block_matchers is a list of label matchers that are evaluated against each single block's - /// labels to filter which blocks get queried. If the list is empty, no per-block filtering - /// is applied. - BlockMatchers []storepb.LabelMatcher `protobuf:"bytes,1,rep,name=block_matchers,json=blockMatchers,proto3" json:"block_matchers"` - EnableQueryStats bool `protobuf:"varint,2,opt,name=enable_query_stats,json=enableQueryStats,proto3" json:"enable_query_stats,omitempty"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // / block_matchers is a list of label matchers that are evaluated against each single block's + // / labels to filter which blocks get queried. If the list is empty, no per-block filtering + // / is applied. + BlockMatchers []*storepb.LabelMatcher `protobuf:"bytes,1,rep,name=block_matchers,json=blockMatchers,proto3" json:"block_matchers"` + EnableQueryStats bool `protobuf:"varint,2,opt,name=enable_query_stats,json=enableQueryStats,proto3" json:"enable_query_stats,omitempty"` } -func (m *SeriesRequestHints) Reset() { *m = SeriesRequestHints{} } -func (m *SeriesRequestHints) String() string { return proto.CompactTextString(m) } -func (*SeriesRequestHints) ProtoMessage() {} -func (*SeriesRequestHints) Descriptor() ([]byte, []int) { - return fileDescriptor_b82aa23c4c11e83f, []int{0} -} -func (m *SeriesRequestHints) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SeriesRequestHints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SeriesRequestHints.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *SeriesRequestHints) Reset() { + *x = SeriesRequestHints{} + mi := &file_store_hintspb_hints_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SeriesRequestHints) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SeriesRequestHints) ProtoMessage() {} + +func (x *SeriesRequestHints) ProtoReflect() protoreflect.Message { + mi := &file_store_hintspb_hints_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *SeriesRequestHints) XXX_Merge(src proto.Message) { - xxx_messageInfo_SeriesRequestHints.Merge(m, src) -} -func (m *SeriesRequestHints) XXX_Size() int { - return m.Size() + +// Deprecated: Use SeriesRequestHints.ProtoReflect.Descriptor instead. +func (*SeriesRequestHints) Descriptor() ([]byte, []int) { + return file_store_hintspb_hints_proto_rawDescGZIP(), []int{0} } -func (m *SeriesRequestHints) XXX_DiscardUnknown() { - xxx_messageInfo_SeriesRequestHints.DiscardUnknown(m) + +func (x *SeriesRequestHints) GetBlockMatchers() []*storepb.LabelMatcher { + if x != nil { + return x.BlockMatchers + } + return nil } -var xxx_messageInfo_SeriesRequestHints proto.InternalMessageInfo +func (x *SeriesRequestHints) GetEnableQueryStats() bool { + if x != nil { + return x.EnableQueryStats + } + return false +} type SeriesResponseHints struct { - /// queried_blocks is the list of blocks that have been queried. - QueriedBlocks []Block `protobuf:"bytes,1,rep,name=queried_blocks,json=queriedBlocks,proto3" json:"queried_blocks"` - /// query_stats contains statistics of querying store gateway. + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // / queried_blocks is the list of blocks that have been queried. + QueriedBlocks []*Block `protobuf:"bytes,1,rep,name=queried_blocks,json=queriedBlocks,proto3" json:"queried_blocks"` + // / query_stats contains statistics of querying store gateway. QueryStats *QueryStats `protobuf:"bytes,2,opt,name=query_stats,json=queryStats,proto3" json:"query_stats,omitempty"` } -func (m *SeriesResponseHints) Reset() { *m = SeriesResponseHints{} } -func (m *SeriesResponseHints) String() string { return proto.CompactTextString(m) } -func (*SeriesResponseHints) ProtoMessage() {} -func (*SeriesResponseHints) Descriptor() ([]byte, []int) { - return fileDescriptor_b82aa23c4c11e83f, []int{1} -} -func (m *SeriesResponseHints) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SeriesResponseHints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SeriesResponseHints.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *SeriesResponseHints) Reset() { + *x = SeriesResponseHints{} + mi := &file_store_hintspb_hints_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SeriesResponseHints) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SeriesResponseHints) ProtoMessage() {} + +func (x *SeriesResponseHints) ProtoReflect() protoreflect.Message { + mi := &file_store_hintspb_hints_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *SeriesResponseHints) XXX_Merge(src proto.Message) { - xxx_messageInfo_SeriesResponseHints.Merge(m, src) -} -func (m *SeriesResponseHints) XXX_Size() int { - return m.Size() + +// Deprecated: Use SeriesResponseHints.ProtoReflect.Descriptor instead. +func (*SeriesResponseHints) Descriptor() ([]byte, []int) { + return file_store_hintspb_hints_proto_rawDescGZIP(), []int{1} } -func (m *SeriesResponseHints) XXX_DiscardUnknown() { - xxx_messageInfo_SeriesResponseHints.DiscardUnknown(m) + +func (x *SeriesResponseHints) GetQueriedBlocks() []*Block { + if x != nil { + return x.QueriedBlocks + } + return nil } -var xxx_messageInfo_SeriesResponseHints proto.InternalMessageInfo +func (x *SeriesResponseHints) GetQueryStats() *QueryStats { + if x != nil { + return x.QueryStats + } + return nil +} type Block struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } -func (m *Block) Reset() { *m = Block{} } -func (m *Block) String() string { return proto.CompactTextString(m) } -func (*Block) ProtoMessage() {} -func (*Block) Descriptor() ([]byte, []int) { - return fileDescriptor_b82aa23c4c11e83f, []int{2} -} -func (m *Block) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Block.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Block) XXX_Merge(src proto.Message) { - xxx_messageInfo_Block.Merge(m, src) -} -func (m *Block) XXX_Size() int { - return m.Size() +func (x *Block) Reset() { + *x = Block{} + mi := &file_store_hintspb_hints_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Block) XXX_DiscardUnknown() { - xxx_messageInfo_Block.DiscardUnknown(m) -} - -var xxx_messageInfo_Block proto.InternalMessageInfo -type LabelNamesRequestHints struct { - /// block_matchers is a list of label matchers that are evaluated against each single block's - /// labels to filter which blocks get queried. If the list is empty, no per-block filtering - /// is applied. - BlockMatchers []storepb.LabelMatcher `protobuf:"bytes,1,rep,name=block_matchers,json=blockMatchers,proto3" json:"block_matchers"` +func (x *Block) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *LabelNamesRequestHints) Reset() { *m = LabelNamesRequestHints{} } -func (m *LabelNamesRequestHints) String() string { return proto.CompactTextString(m) } -func (*LabelNamesRequestHints) ProtoMessage() {} -func (*LabelNamesRequestHints) Descriptor() ([]byte, []int) { - return fileDescriptor_b82aa23c4c11e83f, []int{3} -} -func (m *LabelNamesRequestHints) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelNamesRequestHints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelNamesRequestHints.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (*Block) ProtoMessage() {} + +func (x *Block) ProtoReflect() protoreflect.Message { + mi := &file_store_hintspb_hints_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *LabelNamesRequestHints) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelNamesRequestHints.Merge(m, src) + +// Deprecated: Use Block.ProtoReflect.Descriptor instead. +func (*Block) Descriptor() ([]byte, []int) { + return file_store_hintspb_hints_proto_rawDescGZIP(), []int{2} } -func (m *LabelNamesRequestHints) XXX_Size() int { - return m.Size() + +func (x *Block) GetId() string { + if x != nil { + return x.Id + } + return "" } -func (m *LabelNamesRequestHints) XXX_DiscardUnknown() { - xxx_messageInfo_LabelNamesRequestHints.DiscardUnknown(m) + +type LabelNamesRequestHints struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // / block_matchers is a list of label matchers that are evaluated against each single block's + // / labels to filter which blocks get queried. If the list is empty, no per-block filtering + // / is applied. + BlockMatchers []*storepb.LabelMatcher `protobuf:"bytes,1,rep,name=block_matchers,json=blockMatchers,proto3" json:"block_matchers"` } -var xxx_messageInfo_LabelNamesRequestHints proto.InternalMessageInfo +func (x *LabelNamesRequestHints) Reset() { + *x = LabelNamesRequestHints{} + mi := &file_store_hintspb_hints_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -type LabelNamesResponseHints struct { - /// queried_blocks is the list of blocks that have been queried. - QueriedBlocks []Block `protobuf:"bytes,1,rep,name=queried_blocks,json=queriedBlocks,proto3" json:"queried_blocks"` +func (x *LabelNamesRequestHints) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *LabelNamesResponseHints) Reset() { *m = LabelNamesResponseHints{} } -func (m *LabelNamesResponseHints) String() string { return proto.CompactTextString(m) } -func (*LabelNamesResponseHints) ProtoMessage() {} -func (*LabelNamesResponseHints) Descriptor() ([]byte, []int) { - return fileDescriptor_b82aa23c4c11e83f, []int{4} -} -func (m *LabelNamesResponseHints) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelNamesResponseHints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelNamesResponseHints.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (*LabelNamesRequestHints) ProtoMessage() {} + +func (x *LabelNamesRequestHints) ProtoReflect() protoreflect.Message { + mi := &file_store_hintspb_hints_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *LabelNamesResponseHints) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelNamesResponseHints.Merge(m, src) + +// Deprecated: Use LabelNamesRequestHints.ProtoReflect.Descriptor instead. +func (*LabelNamesRequestHints) Descriptor() ([]byte, []int) { + return file_store_hintspb_hints_proto_rawDescGZIP(), []int{3} } -func (m *LabelNamesResponseHints) XXX_Size() int { - return m.Size() + +func (x *LabelNamesRequestHints) GetBlockMatchers() []*storepb.LabelMatcher { + if x != nil { + return x.BlockMatchers + } + return nil } -func (m *LabelNamesResponseHints) XXX_DiscardUnknown() { - xxx_messageInfo_LabelNamesResponseHints.DiscardUnknown(m) + +type LabelNamesResponseHints struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // / queried_blocks is the list of blocks that have been queried. + QueriedBlocks []*Block `protobuf:"bytes,1,rep,name=queried_blocks,json=queriedBlocks,proto3" json:"queried_blocks"` } -var xxx_messageInfo_LabelNamesResponseHints proto.InternalMessageInfo +func (x *LabelNamesResponseHints) Reset() { + *x = LabelNamesResponseHints{} + mi := &file_store_hintspb_hints_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -type LabelValuesRequestHints struct { - /// block_matchers is a list of label matchers that are evaluated against each single block's - /// labels to filter which blocks get queried. If the list is empty, no per-block filtering - /// is applied. - BlockMatchers []storepb.LabelMatcher `protobuf:"bytes,1,rep,name=block_matchers,json=blockMatchers,proto3" json:"block_matchers"` +func (x *LabelNamesResponseHints) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *LabelValuesRequestHints) Reset() { *m = LabelValuesRequestHints{} } -func (m *LabelValuesRequestHints) String() string { return proto.CompactTextString(m) } -func (*LabelValuesRequestHints) ProtoMessage() {} -func (*LabelValuesRequestHints) Descriptor() ([]byte, []int) { - return fileDescriptor_b82aa23c4c11e83f, []int{5} -} -func (m *LabelValuesRequestHints) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelValuesRequestHints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelValuesRequestHints.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (*LabelNamesResponseHints) ProtoMessage() {} + +func (x *LabelNamesResponseHints) ProtoReflect() protoreflect.Message { + mi := &file_store_hintspb_hints_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *LabelValuesRequestHints) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelValuesRequestHints.Merge(m, src) -} -func (m *LabelValuesRequestHints) XXX_Size() int { - return m.Size() -} -func (m *LabelValuesRequestHints) XXX_DiscardUnknown() { - xxx_messageInfo_LabelValuesRequestHints.DiscardUnknown(m) -} - -var xxx_messageInfo_LabelValuesRequestHints proto.InternalMessageInfo -type LabelValuesResponseHints struct { - /// queried_blocks is the list of blocks that have been queried. - QueriedBlocks []Block `protobuf:"bytes,1,rep,name=queried_blocks,json=queriedBlocks,proto3" json:"queried_blocks"` +// Deprecated: Use LabelNamesResponseHints.ProtoReflect.Descriptor instead. +func (*LabelNamesResponseHints) Descriptor() ([]byte, []int) { + return file_store_hintspb_hints_proto_rawDescGZIP(), []int{4} } -func (m *LabelValuesResponseHints) Reset() { *m = LabelValuesResponseHints{} } -func (m *LabelValuesResponseHints) String() string { return proto.CompactTextString(m) } -func (*LabelValuesResponseHints) ProtoMessage() {} -func (*LabelValuesResponseHints) Descriptor() ([]byte, []int) { - return fileDescriptor_b82aa23c4c11e83f, []int{6} -} -func (m *LabelValuesResponseHints) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelValuesResponseHints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelValuesResponseHints.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *LabelNamesResponseHints) GetQueriedBlocks() []*Block { + if x != nil { + return x.QueriedBlocks } + return nil } -func (m *LabelValuesResponseHints) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelValuesResponseHints.Merge(m, src) + +type LabelValuesRequestHints struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // / block_matchers is a list of label matchers that are evaluated against each single block's + // / labels to filter which blocks get queried. If the list is empty, no per-block filtering + // / is applied. + BlockMatchers []*storepb.LabelMatcher `protobuf:"bytes,1,rep,name=block_matchers,json=blockMatchers,proto3" json:"block_matchers"` } -func (m *LabelValuesResponseHints) XXX_Size() int { - return m.Size() + +func (x *LabelValuesRequestHints) Reset() { + *x = LabelValuesRequestHints{} + mi := &file_store_hintspb_hints_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *LabelValuesResponseHints) XXX_DiscardUnknown() { - xxx_messageInfo_LabelValuesResponseHints.DiscardUnknown(m) + +func (x *LabelValuesRequestHints) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_LabelValuesResponseHints proto.InternalMessageInfo +func (*LabelValuesRequestHints) ProtoMessage() {} -// / QueryStats fields are unstable and might change in the future. -type QueryStats struct { - BlocksQueried int64 `protobuf:"varint,1,opt,name=blocks_queried,json=blocksQueried,proto3" json:"blocks_queried,omitempty"` - MergedSeriesCount int64 `protobuf:"varint,2,opt,name=merged_series_count,json=mergedSeriesCount,proto3" json:"merged_series_count,omitempty"` - MergedChunksCount int64 `protobuf:"varint,3,opt,name=merged_chunks_count,json=mergedChunksCount,proto3" json:"merged_chunks_count,omitempty"` - PostingsTouched int64 `protobuf:"varint,4,opt,name=postings_touched,json=postingsTouched,proto3" json:"postings_touched,omitempty"` - PostingsTouchedSizeSum int64 `protobuf:"varint,5,opt,name=postings_touched_size_sum,json=postingsTouchedSizeSum,proto3" json:"postings_touched_size_sum,omitempty"` - PostingsToFetch int64 `protobuf:"varint,6,opt,name=postings_to_fetch,json=postingsToFetch,proto3" json:"postings_to_fetch,omitempty"` - PostingsFetched int64 `protobuf:"varint,7,opt,name=postings_fetched,json=postingsFetched,proto3" json:"postings_fetched,omitempty"` - PostingsFetchedSizeSum int64 `protobuf:"varint,8,opt,name=postings_fetched_size_sum,json=postingsFetchedSizeSum,proto3" json:"postings_fetched_size_sum,omitempty"` - PostingsFetchCount int64 `protobuf:"varint,9,opt,name=postings_fetch_count,json=postingsFetchCount,proto3" json:"postings_fetch_count,omitempty"` - SeriesTouched int64 `protobuf:"varint,10,opt,name=series_touched,json=seriesTouched,proto3" json:"series_touched,omitempty"` - SeriesTouchedSizeSum int64 `protobuf:"varint,11,opt,name=series_touched_size_sum,json=seriesTouchedSizeSum,proto3" json:"series_touched_size_sum,omitempty"` - SeriesFetched int64 `protobuf:"varint,12,opt,name=series_fetched,json=seriesFetched,proto3" json:"series_fetched,omitempty"` - SeriesFetchedSizeSum int64 `protobuf:"varint,13,opt,name=series_fetched_size_sum,json=seriesFetchedSizeSum,proto3" json:"series_fetched_size_sum,omitempty"` - SeriesFetchCount int64 `protobuf:"varint,14,opt,name=series_fetch_count,json=seriesFetchCount,proto3" json:"series_fetch_count,omitempty"` - ChunksTouched int64 `protobuf:"varint,15,opt,name=chunks_touched,json=chunksTouched,proto3" json:"chunks_touched,omitempty"` - ChunksTouchedSizeSum int64 `protobuf:"varint,16,opt,name=chunks_touched_size_sum,json=chunksTouchedSizeSum,proto3" json:"chunks_touched_size_sum,omitempty"` - ChunksFetched int64 `protobuf:"varint,17,opt,name=chunks_fetched,json=chunksFetched,proto3" json:"chunks_fetched,omitempty"` - ChunksFetchedSizeSum int64 `protobuf:"varint,18,opt,name=chunks_fetched_size_sum,json=chunksFetchedSizeSum,proto3" json:"chunks_fetched_size_sum,omitempty"` - ChunksFetchCount int64 `protobuf:"varint,19,opt,name=chunks_fetch_count,json=chunksFetchCount,proto3" json:"chunks_fetch_count,omitempty"` - DataDownloadedSizeSum int64 `protobuf:"varint,20,opt,name=data_downloaded_size_sum,json=dataDownloadedSizeSum,proto3" json:"data_downloaded_size_sum,omitempty"` - GetAllDuration time.Duration `protobuf:"bytes,21,opt,name=get_all_duration,json=getAllDuration,proto3,stdduration" json:"get_all_duration"` - MergeDuration time.Duration `protobuf:"bytes,22,opt,name=merge_duration,json=mergeDuration,proto3,stdduration" json:"merge_duration"` -} - -func (m *QueryStats) Reset() { *m = QueryStats{} } -func (m *QueryStats) String() string { return proto.CompactTextString(m) } -func (*QueryStats) ProtoMessage() {} -func (*QueryStats) Descriptor() ([]byte, []int) { - return fileDescriptor_b82aa23c4c11e83f, []int{7} -} -func (m *QueryStats) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryStats.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *LabelValuesRequestHints) ProtoReflect() protoreflect.Message { + mi := &file_store_hintspb_hints_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil - } -} -func (m *QueryStats) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryStats.Merge(m, src) -} -func (m *QueryStats) XXX_Size() int { - return m.Size() -} -func (m *QueryStats) XXX_DiscardUnknown() { - xxx_messageInfo_QueryStats.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryStats proto.InternalMessageInfo - -func init() { - proto.RegisterType((*SeriesRequestHints)(nil), "hintspb.SeriesRequestHints") - proto.RegisterType((*SeriesResponseHints)(nil), "hintspb.SeriesResponseHints") - proto.RegisterType((*Block)(nil), "hintspb.Block") - proto.RegisterType((*LabelNamesRequestHints)(nil), "hintspb.LabelNamesRequestHints") - proto.RegisterType((*LabelNamesResponseHints)(nil), "hintspb.LabelNamesResponseHints") - proto.RegisterType((*LabelValuesRequestHints)(nil), "hintspb.LabelValuesRequestHints") - proto.RegisterType((*LabelValuesResponseHints)(nil), "hintspb.LabelValuesResponseHints") - proto.RegisterType((*QueryStats)(nil), "hintspb.QueryStats") -} - -func init() { proto.RegisterFile("store/hintspb/hints.proto", fileDescriptor_b82aa23c4c11e83f) } - -var fileDescriptor_b82aa23c4c11e83f = []byte{ - // 731 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcd, 0x4f, 0xdb, 0x30, - 0x1c, 0x6d, 0x28, 0x1f, 0xc5, 0x1d, 0xa1, 0xb8, 0x05, 0x02, 0x87, 0x80, 0x2a, 0x21, 0xb1, 0x09, - 0xa5, 0x13, 0xd3, 0x34, 0x6d, 0x3b, 0xf1, 0x21, 0x34, 0x4d, 0x63, 0x12, 0xe9, 0xc4, 0xa4, 0x6d, - 0x92, 0x95, 0x34, 0x26, 0x8d, 0x48, 0xe3, 0x12, 0x3b, 0x9a, 0xe0, 0xbe, 0xeb, 0xb4, 0xe3, 0xfe, - 0x24, 0x8e, 0x1c, 0x77, 0xda, 0x07, 0x68, 0xff, 0xc7, 0x14, 0x7f, 0x34, 0x4e, 0xb9, 0xec, 0xd0, - 0x0b, 0xb4, 0xef, 0xf7, 0xde, 0xf3, 0x7b, 0x76, 0x1a, 0x83, 0x35, 0xca, 0x48, 0x8a, 0x3b, 0xfd, - 0x28, 0x61, 0x74, 0xe8, 0x8b, 0xff, 0xce, 0x30, 0x25, 0x8c, 0xc0, 0x39, 0x09, 0xae, 0xb7, 0x42, - 0x12, 0x12, 0x8e, 0x75, 0xf2, 0x4f, 0x62, 0xbc, 0x6e, 0x87, 0x84, 0x84, 0x31, 0xee, 0xf0, 0x6f, - 0x7e, 0x76, 0xd6, 0x09, 0xb2, 0xd4, 0x63, 0x11, 0x49, 0xe4, 0x5c, 0x3a, 0xf3, 0xbf, 0x43, 0xbf, - 0xc3, 0x2e, 0x87, 0x58, 0x3a, 0xb7, 0xbf, 0x18, 0x00, 0x76, 0x71, 0x1a, 0x61, 0xea, 0xe2, 0x8b, - 0x0c, 0x53, 0xf6, 0x2a, 0x5f, 0x09, 0xee, 0x01, 0xd3, 0x8f, 0x49, 0xef, 0x1c, 0x0d, 0x3c, 0xd6, - 0xeb, 0xe3, 0x94, 0x5a, 0xc6, 0x66, 0x75, 0xbb, 0xbe, 0xdb, 0x72, 0x58, 0xdf, 0x4b, 0x08, 0x75, - 0xde, 0x78, 0x3e, 0x8e, 0x8f, 0xc5, 0x70, 0x7f, 0xfa, 0xfa, 0xe7, 0x46, 0xc5, 0x5d, 0xe0, 0x0a, - 0x89, 0x51, 0xb8, 0x03, 0x20, 0x4e, 0x3c, 0x3f, 0xc6, 0xe8, 0x22, 0xc3, 0xe9, 0x25, 0xa2, 0xcc, - 0x63, 0xd4, 0x9a, 0xda, 0x34, 0xb6, 0x6b, 0x6e, 0x43, 0x4c, 0x4e, 0xf2, 0x41, 0x37, 0xc7, 0xdb, - 0x5f, 0x0d, 0xd0, 0x54, 0x39, 0xe8, 0x90, 0x24, 0x14, 0x8b, 0x20, 0x2f, 0x81, 0x99, 0xcb, 0x23, - 0x1c, 0x20, 0x6e, 0xaf, 0x82, 0x98, 0x8e, 0xdc, 0x12, 0x67, 0x3f, 0x87, 0x55, 0x04, 0xc9, 0xe5, - 0x18, 0x85, 0x2f, 0x40, 0x7d, 0x7c, 0xed, 0xfa, 0x6e, 0x73, 0xa4, 0x2c, 0x96, 0xe7, 0x72, 0xc3, - 0x05, 0x17, 0x45, 0xa0, 0x55, 0x30, 0xc3, 0x5d, 0xa0, 0x09, 0xa6, 0xa2, 0xc0, 0x32, 0x36, 0x8d, - 0xed, 0x79, 0x77, 0x2a, 0x0a, 0xda, 0x1f, 0xc1, 0x0a, 0x2f, 0xff, 0xd6, 0x1b, 0x4c, 0x7c, 0xd3, - 0xda, 0xa7, 0x60, 0x55, 0x37, 0x9f, 0xd4, 0x4e, 0xb4, 0x3f, 0x49, 0xdf, 0x53, 0x2f, 0xce, 0x26, - 0x9f, 0xfa, 0x3d, 0xb0, 0x4a, 0xee, 0x13, 0x8b, 0xfd, 0xb7, 0x06, 0x40, 0x71, 0x4a, 0x70, 0x4b, - 0x46, 0xa5, 0x48, 0xd2, 0xf8, 0xb1, 0x54, 0x65, 0x1c, 0x7a, 0x22, 0x40, 0xe8, 0x80, 0xe6, 0x00, - 0xa7, 0x21, 0x0e, 0x10, 0xe5, 0x4f, 0x14, 0xea, 0x91, 0x2c, 0x61, 0xfc, 0xf8, 0xab, 0xee, 0x92, - 0x18, 0x89, 0x67, 0xed, 0x20, 0x1f, 0x68, 0xfc, 0x5e, 0x3f, 0x4b, 0xce, 0x15, 0xbf, 0xaa, 0xf3, - 0x0f, 0xf8, 0x44, 0xf0, 0x1f, 0x82, 0xc6, 0x90, 0x50, 0x16, 0x25, 0x21, 0x45, 0x8c, 0x64, 0xbd, - 0x3e, 0x0e, 0xac, 0x69, 0x4e, 0x5e, 0x54, 0xf8, 0x3b, 0x01, 0xc3, 0xe7, 0x60, 0x6d, 0x9c, 0x8a, - 0x68, 0x74, 0x85, 0x11, 0xcd, 0x06, 0xd6, 0x0c, 0xd7, 0xac, 0x8c, 0x69, 0xba, 0xd1, 0x15, 0xee, - 0x66, 0x03, 0xf8, 0x08, 0x2c, 0x69, 0x52, 0x74, 0x86, 0x59, 0xaf, 0x6f, 0xcd, 0x8e, 0x2f, 0x73, - 0x94, 0xc3, 0xa5, 0x44, 0x9c, 0x88, 0x03, 0x6b, 0xae, 0x4c, 0x3d, 0x12, 0x70, 0x29, 0x91, 0xa4, - 0x16, 0x89, 0x6a, 0xe5, 0x44, 0x52, 0xa3, 0x12, 0x3d, 0x06, 0xad, 0xb2, 0x54, 0x6e, 0xd4, 0x3c, - 0x57, 0xc1, 0x92, 0x4a, 0xec, 0xd4, 0x16, 0x30, 0xe5, 0x11, 0xa8, 0x7d, 0x02, 0xe2, 0xc0, 0x04, - 0xaa, 0x76, 0xe9, 0x29, 0x58, 0x2d, 0xd3, 0x8a, 0x44, 0x75, 0xce, 0x6f, 0x95, 0xf8, 0x2a, 0x4f, - 0xe1, 0xae, 0x3a, 0x3f, 0xd0, 0xdd, 0x55, 0xe3, 0xc2, 0xfd, 0x5e, 0xdf, 0x05, 0xdd, 0x7d, 0xac, - 0xed, 0x0e, 0x80, 0xba, 0x4c, 0x76, 0x35, 0xb9, 0xa2, 0xa1, 0x29, 0x46, 0x4d, 0xe5, 0xc3, 0xa3, - 0x9a, 0x2e, 0x8a, 0x2c, 0x02, 0xd5, 0x9a, 0x96, 0x69, 0x45, 0x96, 0x86, 0xc8, 0x52, 0xe2, 0x6b, - 0x4d, 0xa5, 0x4c, 0x35, 0x5d, 0xd2, 0xdd, 0xb5, 0xa6, 0x65, 0x5a, 0xe1, 0x0e, 0x75, 0xf7, 0xfb, - 0x4d, 0x75, 0x99, 0x6c, 0xda, 0x14, 0x4d, 0x35, 0x85, 0x68, 0xfa, 0x0c, 0x58, 0x81, 0xc7, 0x3c, - 0x14, 0x90, 0xcf, 0x49, 0x4c, 0xbc, 0x40, 0x5f, 0xa5, 0xc5, 0x35, 0xcb, 0xf9, 0xfc, 0x70, 0x34, - 0x56, 0xcb, 0x1c, 0x83, 0x46, 0x88, 0x19, 0xf2, 0xe2, 0x18, 0xa9, 0xfb, 0xc9, 0x5a, 0xe6, 0xaf, - 0xe4, 0x35, 0x47, 0x5c, 0x60, 0x8e, 0xba, 0xc0, 0x9c, 0x43, 0x49, 0xd8, 0xaf, 0xe5, 0xaf, 0x85, - 0xef, 0xbf, 0x36, 0x0c, 0xd7, 0x0c, 0x31, 0xdb, 0x8b, 0x63, 0x35, 0x81, 0xaf, 0x81, 0xc9, 0x7f, - 0x9a, 0x85, 0xd9, 0xca, 0xff, 0x9b, 0x2d, 0x70, 0xe9, 0x68, 0xb0, 0x75, 0xfd, 0xc7, 0xae, 0x5c, - 0xdf, 0xda, 0xc6, 0xcd, 0xad, 0x6d, 0xfc, 0xbe, 0xb5, 0x8d, 0x6f, 0x77, 0x76, 0xe5, 0xe6, 0xce, - 0xae, 0xfc, 0xb8, 0xb3, 0x2b, 0x1f, 0xd4, 0xed, 0xeb, 0xcf, 0x72, 0xcb, 0x27, 0xff, 0x02, 0x00, - 0x00, 0xff, 0xff, 0x49, 0xb6, 0x83, 0x90, 0xaa, 0x07, 0x00, 0x00, -} - -func (m *SeriesRequestHints) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + return ms } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *SeriesRequestHints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use LabelValuesRequestHints.ProtoReflect.Descriptor instead. +func (*LabelValuesRequestHints) Descriptor() ([]byte, []int) { + return file_store_hintspb_hints_proto_rawDescGZIP(), []int{5} } -func (m *SeriesRequestHints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.EnableQueryStats { - i-- - if m.EnableQueryStats { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.BlockMatchers) > 0 { - for iNdEx := len(m.BlockMatchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.BlockMatchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHints(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } +func (x *LabelValuesRequestHints) GetBlockMatchers() []*storepb.LabelMatcher { + if x != nil { + return x.BlockMatchers } - return len(dAtA) - i, nil + return nil } -func (m *SeriesResponseHints) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SeriesResponseHints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesResponseHints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.QueryStats != nil { - { - size, err := m.QueryStats.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHints(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.QueriedBlocks) > 0 { - for iNdEx := len(m.QueriedBlocks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.QueriedBlocks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHints(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} +type LabelValuesResponseHints struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Block) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil + // / queried_blocks is the list of blocks that have been queried. + QueriedBlocks []*Block `protobuf:"bytes,1,rep,name=queried_blocks,json=queriedBlocks,proto3" json:"queried_blocks"` } -func (m *Block) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *LabelValuesResponseHints) Reset() { + *x = LabelValuesResponseHints{} + mi := &file_store_hintspb_hints_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Block) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintHints(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +func (x *LabelValuesResponseHints) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *LabelNamesRequestHints) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LabelNamesRequestHints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelNamesRequestHints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.BlockMatchers) > 0 { - for iNdEx := len(m.BlockMatchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.BlockMatchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHints(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa +func (*LabelValuesResponseHints) ProtoMessage() {} + +func (x *LabelValuesResponseHints) ProtoReflect() protoreflect.Message { + mi := &file_store_hintspb_hints_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - return len(dAtA) - i, nil + return mi.MessageOf(x) } -func (m *LabelNamesResponseHints) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LabelNamesResponseHints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelNamesResponseHints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.QueriedBlocks) > 0 { - for iNdEx := len(m.QueriedBlocks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.QueriedBlocks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHints(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil +// Deprecated: Use LabelValuesResponseHints.ProtoReflect.Descriptor instead. +func (*LabelValuesResponseHints) Descriptor() ([]byte, []int) { + return file_store_hintspb_hints_proto_rawDescGZIP(), []int{6} } -func (m *LabelValuesRequestHints) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LabelValuesRequestHints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelValuesRequestHints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.BlockMatchers) > 0 { - for iNdEx := len(m.BlockMatchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.BlockMatchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHints(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } +func (x *LabelValuesResponseHints) GetQueriedBlocks() []*Block { + if x != nil { + return x.QueriedBlocks } - return len(dAtA) - i, nil + return nil } -func (m *LabelValuesResponseHints) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LabelValuesResponseHints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelValuesResponseHints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.QueriedBlocks) > 0 { - for iNdEx := len(m.QueriedBlocks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.QueriedBlocks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHints(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil +// / QueryStats fields are unstable and might change in the future. +type QueryStats struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlocksQueried int64 `protobuf:"varint,1,opt,name=blocks_queried,json=blocksQueried,proto3" json:"blocks_queried,omitempty"` + MergedSeriesCount int64 `protobuf:"varint,2,opt,name=merged_series_count,json=mergedSeriesCount,proto3" json:"merged_series_count,omitempty"` + MergedChunksCount int64 `protobuf:"varint,3,opt,name=merged_chunks_count,json=mergedChunksCount,proto3" json:"merged_chunks_count,omitempty"` + PostingsTouched int64 `protobuf:"varint,4,opt,name=postings_touched,json=postingsTouched,proto3" json:"postings_touched,omitempty"` + PostingsTouchedSizeSum int64 `protobuf:"varint,5,opt,name=postings_touched_size_sum,json=postingsTouchedSizeSum,proto3" json:"postings_touched_size_sum,omitempty"` + PostingsToFetch int64 `protobuf:"varint,6,opt,name=postings_to_fetch,json=postingsToFetch,proto3" json:"postings_to_fetch,omitempty"` + PostingsFetched int64 `protobuf:"varint,7,opt,name=postings_fetched,json=postingsFetched,proto3" json:"postings_fetched,omitempty"` + PostingsFetchedSizeSum int64 `protobuf:"varint,8,opt,name=postings_fetched_size_sum,json=postingsFetchedSizeSum,proto3" json:"postings_fetched_size_sum,omitempty"` + PostingsFetchCount int64 `protobuf:"varint,9,opt,name=postings_fetch_count,json=postingsFetchCount,proto3" json:"postings_fetch_count,omitempty"` + SeriesTouched int64 `protobuf:"varint,10,opt,name=series_touched,json=seriesTouched,proto3" json:"series_touched,omitempty"` + SeriesTouchedSizeSum int64 `protobuf:"varint,11,opt,name=series_touched_size_sum,json=seriesTouchedSizeSum,proto3" json:"series_touched_size_sum,omitempty"` + SeriesFetched int64 `protobuf:"varint,12,opt,name=series_fetched,json=seriesFetched,proto3" json:"series_fetched,omitempty"` + SeriesFetchedSizeSum int64 `protobuf:"varint,13,opt,name=series_fetched_size_sum,json=seriesFetchedSizeSum,proto3" json:"series_fetched_size_sum,omitempty"` + SeriesFetchCount int64 `protobuf:"varint,14,opt,name=series_fetch_count,json=seriesFetchCount,proto3" json:"series_fetch_count,omitempty"` + ChunksTouched int64 `protobuf:"varint,15,opt,name=chunks_touched,json=chunksTouched,proto3" json:"chunks_touched,omitempty"` + ChunksTouchedSizeSum int64 `protobuf:"varint,16,opt,name=chunks_touched_size_sum,json=chunksTouchedSizeSum,proto3" json:"chunks_touched_size_sum,omitempty"` + ChunksFetched int64 `protobuf:"varint,17,opt,name=chunks_fetched,json=chunksFetched,proto3" json:"chunks_fetched,omitempty"` + ChunksFetchedSizeSum int64 `protobuf:"varint,18,opt,name=chunks_fetched_size_sum,json=chunksFetchedSizeSum,proto3" json:"chunks_fetched_size_sum,omitempty"` + ChunksFetchCount int64 `protobuf:"varint,19,opt,name=chunks_fetch_count,json=chunksFetchCount,proto3" json:"chunks_fetch_count,omitempty"` + DataDownloadedSizeSum int64 `protobuf:"varint,20,opt,name=data_downloaded_size_sum,json=dataDownloadedSizeSum,proto3" json:"data_downloaded_size_sum,omitempty"` + GetAllDuration *durationpb.Duration `protobuf:"bytes,21,opt,name=get_all_duration,json=getAllDuration,proto3" json:"get_all_duration"` + MergeDuration *durationpb.Duration `protobuf:"bytes,22,opt,name=merge_duration,json=mergeDuration,proto3" json:"merge_duration"` +} + +func (x *QueryStats) Reset() { + *x = QueryStats{} + mi := &file_store_hintspb_hints_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QueryStats) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryStats) ProtoMessage() {} + +func (x *QueryStats) ProtoReflect() protoreflect.Message { + mi := &file_store_hintspb_hints_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryStats.ProtoReflect.Descriptor instead. +func (*QueryStats) Descriptor() ([]byte, []int) { + return file_store_hintspb_hints_proto_rawDescGZIP(), []int{7} } -func (m *QueryStats) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *QueryStats) GetBlocksQueried() int64 { + if x != nil { + return x.BlocksQueried } - return dAtA[:n], nil + return 0 } -func (m *QueryStats) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *QueryStats) GetMergedSeriesCount() int64 { + if x != nil { + return x.MergedSeriesCount + } + return 0 } -func (m *QueryStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MergeDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.MergeDuration):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintHints(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xb2 - n3, err3 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.GetAllDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.GetAllDuration):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintHints(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xaa - if m.DataDownloadedSizeSum != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.DataDownloadedSizeSum)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa0 - } - if m.ChunksFetchCount != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.ChunksFetchCount)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x98 - } - if m.ChunksFetchedSizeSum != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.ChunksFetchedSizeSum)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x90 - } - if m.ChunksFetched != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.ChunksFetched)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x88 - } - if m.ChunksTouchedSizeSum != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.ChunksTouchedSizeSum)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x80 - } - if m.ChunksTouched != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.ChunksTouched)) - i-- - dAtA[i] = 0x78 - } - if m.SeriesFetchCount != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.SeriesFetchCount)) - i-- - dAtA[i] = 0x70 - } - if m.SeriesFetchedSizeSum != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.SeriesFetchedSizeSum)) - i-- - dAtA[i] = 0x68 - } - if m.SeriesFetched != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.SeriesFetched)) - i-- - dAtA[i] = 0x60 - } - if m.SeriesTouchedSizeSum != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.SeriesTouchedSizeSum)) - i-- - dAtA[i] = 0x58 - } - if m.SeriesTouched != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.SeriesTouched)) - i-- - dAtA[i] = 0x50 - } - if m.PostingsFetchCount != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.PostingsFetchCount)) - i-- - dAtA[i] = 0x48 +func (x *QueryStats) GetMergedChunksCount() int64 { + if x != nil { + return x.MergedChunksCount } - if m.PostingsFetchedSizeSum != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.PostingsFetchedSizeSum)) - i-- - dAtA[i] = 0x40 - } - if m.PostingsFetched != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.PostingsFetched)) - i-- - dAtA[i] = 0x38 - } - if m.PostingsToFetch != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.PostingsToFetch)) - i-- - dAtA[i] = 0x30 - } - if m.PostingsTouchedSizeSum != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.PostingsTouchedSizeSum)) - i-- - dAtA[i] = 0x28 - } - if m.PostingsTouched != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.PostingsTouched)) - i-- - dAtA[i] = 0x20 - } - if m.MergedChunksCount != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.MergedChunksCount)) - i-- - dAtA[i] = 0x18 - } - if m.MergedSeriesCount != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.MergedSeriesCount)) - i-- - dAtA[i] = 0x10 - } - if m.BlocksQueried != 0 { - i = encodeVarintHints(dAtA, i, uint64(m.BlocksQueried)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil + return 0 } -func encodeVarintHints(dAtA []byte, offset int, v uint64) int { - offset -= sovHints(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (x *QueryStats) GetPostingsTouched() int64 { + if x != nil { + return x.PostingsTouched } - dAtA[offset] = uint8(v) - return base + return 0 } -func (m *SeriesRequestHints) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.BlockMatchers) > 0 { - for _, e := range m.BlockMatchers { - l = e.Size() - n += 1 + l + sovHints(uint64(l)) - } - } - if m.EnableQueryStats { - n += 2 + +func (x *QueryStats) GetPostingsTouchedSizeSum() int64 { + if x != nil { + return x.PostingsTouchedSizeSum } - return n + return 0 } -func (m *SeriesResponseHints) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.QueriedBlocks) > 0 { - for _, e := range m.QueriedBlocks { - l = e.Size() - n += 1 + l + sovHints(uint64(l)) - } +func (x *QueryStats) GetPostingsToFetch() int64 { + if x != nil { + return x.PostingsToFetch } - if m.QueryStats != nil { - l = m.QueryStats.Size() - n += 1 + l + sovHints(uint64(l)) - } - return n + return 0 } -func (m *Block) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovHints(uint64(l)) +func (x *QueryStats) GetPostingsFetched() int64 { + if x != nil { + return x.PostingsFetched } - return n + return 0 } -func (m *LabelNamesRequestHints) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.BlockMatchers) > 0 { - for _, e := range m.BlockMatchers { - l = e.Size() - n += 1 + l + sovHints(uint64(l)) - } +func (x *QueryStats) GetPostingsFetchedSizeSum() int64 { + if x != nil { + return x.PostingsFetchedSizeSum } - return n + return 0 } -func (m *LabelNamesResponseHints) Size() (n int) { - if m == nil { - return 0 +func (x *QueryStats) GetPostingsFetchCount() int64 { + if x != nil { + return x.PostingsFetchCount } - var l int - _ = l - if len(m.QueriedBlocks) > 0 { - for _, e := range m.QueriedBlocks { - l = e.Size() - n += 1 + l + sovHints(uint64(l)) - } - } - return n + return 0 } -func (m *LabelValuesRequestHints) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.BlockMatchers) > 0 { - for _, e := range m.BlockMatchers { - l = e.Size() - n += 1 + l + sovHints(uint64(l)) - } +func (x *QueryStats) GetSeriesTouched() int64 { + if x != nil { + return x.SeriesTouched } - return n + return 0 } -func (m *LabelValuesResponseHints) Size() (n int) { - if m == nil { - return 0 +func (x *QueryStats) GetSeriesTouchedSizeSum() int64 { + if x != nil { + return x.SeriesTouchedSizeSum } - var l int - _ = l - if len(m.QueriedBlocks) > 0 { - for _, e := range m.QueriedBlocks { - l = e.Size() - n += 1 + l + sovHints(uint64(l)) - } - } - return n + return 0 } -func (m *QueryStats) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BlocksQueried != 0 { - n += 1 + sovHints(uint64(m.BlocksQueried)) - } - if m.MergedSeriesCount != 0 { - n += 1 + sovHints(uint64(m.MergedSeriesCount)) - } - if m.MergedChunksCount != 0 { - n += 1 + sovHints(uint64(m.MergedChunksCount)) - } - if m.PostingsTouched != 0 { - n += 1 + sovHints(uint64(m.PostingsTouched)) - } - if m.PostingsTouchedSizeSum != 0 { - n += 1 + sovHints(uint64(m.PostingsTouchedSizeSum)) - } - if m.PostingsToFetch != 0 { - n += 1 + sovHints(uint64(m.PostingsToFetch)) - } - if m.PostingsFetched != 0 { - n += 1 + sovHints(uint64(m.PostingsFetched)) - } - if m.PostingsFetchedSizeSum != 0 { - n += 1 + sovHints(uint64(m.PostingsFetchedSizeSum)) - } - if m.PostingsFetchCount != 0 { - n += 1 + sovHints(uint64(m.PostingsFetchCount)) - } - if m.SeriesTouched != 0 { - n += 1 + sovHints(uint64(m.SeriesTouched)) - } - if m.SeriesTouchedSizeSum != 0 { - n += 1 + sovHints(uint64(m.SeriesTouchedSizeSum)) - } - if m.SeriesFetched != 0 { - n += 1 + sovHints(uint64(m.SeriesFetched)) - } - if m.SeriesFetchedSizeSum != 0 { - n += 1 + sovHints(uint64(m.SeriesFetchedSizeSum)) - } - if m.SeriesFetchCount != 0 { - n += 1 + sovHints(uint64(m.SeriesFetchCount)) - } - if m.ChunksTouched != 0 { - n += 1 + sovHints(uint64(m.ChunksTouched)) - } - if m.ChunksTouchedSizeSum != 0 { - n += 2 + sovHints(uint64(m.ChunksTouchedSizeSum)) - } - if m.ChunksFetched != 0 { - n += 2 + sovHints(uint64(m.ChunksFetched)) - } - if m.ChunksFetchedSizeSum != 0 { - n += 2 + sovHints(uint64(m.ChunksFetchedSizeSum)) - } - if m.ChunksFetchCount != 0 { - n += 2 + sovHints(uint64(m.ChunksFetchCount)) - } - if m.DataDownloadedSizeSum != 0 { - n += 2 + sovHints(uint64(m.DataDownloadedSizeSum)) - } - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.GetAllDuration) - n += 2 + l + sovHints(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.MergeDuration) - n += 2 + l + sovHints(uint64(l)) - return n -} - -func sovHints(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozHints(x uint64) (n int) { - return sovHints(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *SeriesRequestHints) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SeriesRequestHints: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SeriesRequestHints: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockMatchers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthHints - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthHints - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BlockMatchers = append(m.BlockMatchers, storepb.LabelMatcher{}) - if err := m.BlockMatchers[len(m.BlockMatchers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EnableQueryStats", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.EnableQueryStats = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipHints(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthHints - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } +func (x *QueryStats) GetSeriesFetched() int64 { + if x != nil { + return x.SeriesFetched } + return 0 +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *QueryStats) GetSeriesFetchedSizeSum() int64 { + if x != nil { + return x.SeriesFetchedSizeSum } - return nil + return 0 } -func (m *SeriesResponseHints) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SeriesResponseHints: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SeriesResponseHints: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QueriedBlocks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthHints - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthHints - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.QueriedBlocks = append(m.QueriedBlocks, Block{}) - if err := m.QueriedBlocks[len(m.QueriedBlocks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QueryStats", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthHints - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthHints - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.QueryStats == nil { - m.QueryStats = &QueryStats{} - } - if err := m.QueryStats.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipHints(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthHints - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *QueryStats) GetSeriesFetchCount() int64 { + if x != nil { + return x.SeriesFetchCount } - return nil + return 0 } -func (m *Block) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Block: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Block: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthHints - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthHints - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipHints(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthHints - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *QueryStats) GetChunksTouched() int64 { + if x != nil { + return x.ChunksTouched } - return nil + return 0 } -func (m *LabelNamesRequestHints) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LabelNamesRequestHints: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelNamesRequestHints: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockMatchers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthHints - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthHints - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BlockMatchers = append(m.BlockMatchers, storepb.LabelMatcher{}) - if err := m.BlockMatchers[len(m.BlockMatchers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipHints(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthHints - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *QueryStats) GetChunksTouchedSizeSum() int64 { + if x != nil { + return x.ChunksTouchedSizeSum } - return nil + return 0 } -func (m *LabelNamesResponseHints) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LabelNamesResponseHints: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelNamesResponseHints: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QueriedBlocks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthHints - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthHints - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.QueriedBlocks = append(m.QueriedBlocks, Block{}) - if err := m.QueriedBlocks[len(m.QueriedBlocks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipHints(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthHints - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *QueryStats) GetChunksFetched() int64 { + if x != nil { + return x.ChunksFetched } - return nil + return 0 } -func (m *LabelValuesRequestHints) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LabelValuesRequestHints: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelValuesRequestHints: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockMatchers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthHints - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthHints - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BlockMatchers = append(m.BlockMatchers, storepb.LabelMatcher{}) - if err := m.BlockMatchers[len(m.BlockMatchers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipHints(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthHints - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + +func (x *QueryStats) GetChunksFetchedSizeSum() int64 { + if x != nil { + return x.ChunksFetchedSizeSum } + return 0 +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *QueryStats) GetChunksFetchCount() int64 { + if x != nil { + return x.ChunksFetchCount } - return nil + return 0 } -func (m *LabelValuesResponseHints) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LabelValuesResponseHints: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelValuesResponseHints: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QueriedBlocks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthHints - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthHints - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.QueriedBlocks = append(m.QueriedBlocks, Block{}) - if err := m.QueriedBlocks[len(m.QueriedBlocks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipHints(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthHints - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + +func (x *QueryStats) GetDataDownloadedSizeSum() int64 { + if x != nil { + return x.DataDownloadedSizeSum } + return 0 +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *QueryStats) GetGetAllDuration() *durationpb.Duration { + if x != nil { + return x.GetAllDuration } return nil } -func (m *QueryStats) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryStats: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryStats: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlocksQueried", wireType) - } - m.BlocksQueried = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlocksQueried |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MergedSeriesCount", wireType) - } - m.MergedSeriesCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MergedSeriesCount |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MergedChunksCount", wireType) - } - m.MergedChunksCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MergedChunksCount |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PostingsTouched", wireType) - } - m.PostingsTouched = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PostingsTouched |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PostingsTouchedSizeSum", wireType) - } - m.PostingsTouchedSizeSum = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PostingsTouchedSizeSum |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PostingsToFetch", wireType) - } - m.PostingsToFetch = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PostingsToFetch |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PostingsFetched", wireType) - } - m.PostingsFetched = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PostingsFetched |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PostingsFetchedSizeSum", wireType) - } - m.PostingsFetchedSizeSum = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PostingsFetchedSizeSum |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PostingsFetchCount", wireType) - } - m.PostingsFetchCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PostingsFetchCount |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SeriesTouched", wireType) - } - m.SeriesTouched = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SeriesTouched |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SeriesTouchedSizeSum", wireType) - } - m.SeriesTouchedSizeSum = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SeriesTouchedSizeSum |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SeriesFetched", wireType) - } - m.SeriesFetched = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SeriesFetched |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SeriesFetchedSizeSum", wireType) - } - m.SeriesFetchedSizeSum = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SeriesFetchedSizeSum |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SeriesFetchCount", wireType) - } - m.SeriesFetchCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SeriesFetchCount |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ChunksTouched", wireType) - } - m.ChunksTouched = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ChunksTouched |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ChunksTouchedSizeSum", wireType) - } - m.ChunksTouchedSizeSum = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ChunksTouchedSizeSum |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 17: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ChunksFetched", wireType) - } - m.ChunksFetched = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ChunksFetched |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 18: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ChunksFetchedSizeSum", wireType) - } - m.ChunksFetchedSizeSum = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ChunksFetchedSizeSum |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 19: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ChunksFetchCount", wireType) - } - m.ChunksFetchCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ChunksFetchCount |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 20: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DataDownloadedSizeSum", wireType) - } - m.DataDownloadedSizeSum = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DataDownloadedSizeSum |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 21: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GetAllDuration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthHints - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthHints - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.GetAllDuration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 22: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MergeDuration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHints - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthHints - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthHints - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.MergeDuration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipHints(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthHints - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *QueryStats) GetMergeDuration() *durationpb.Duration { + if x != nil { + return x.MergeDuration } return nil } -func skipHints(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowHints - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowHints - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowHints - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthHints - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupHints - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthHints - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF + +var File_store_hintspb_hints_proto protoreflect.FileDescriptor + +var file_store_hintspb_hints_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x70, 0x62, 0x2f, + 0x68, 0x69, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x68, 0x69, 0x6e, + 0x74, 0x73, 0x70, 0x62, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x70, 0x62, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x13, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2f, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9b, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x57, 0x0a, 0x0e, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x42, 0x1a, 0x9a, 0x84, 0x9e, 0x03, 0x15, + 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x72, 0x73, 0x22, 0x52, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x72, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x10, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, + 0x74, 0x73, 0x22, 0x9e, 0x01, 0x0a, 0x13, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x51, 0x0a, 0x0e, 0x71, 0x75, + 0x65, 0x72, 0x69, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x42, 0x1a, 0x9a, 0x84, 0x9e, 0x03, 0x15, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x71, + 0x75, 0x65, 0x72, 0x69, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x22, 0x52, 0x0d, + 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x34, 0x0a, + 0x0b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x0a, 0x71, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, + 0x61, 0x74, 0x73, 0x22, 0x17, 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x71, 0x0a, 0x16, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x48, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x57, 0x0a, 0x0e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x65, 0x72, 0x42, 0x1a, 0x9a, 0x84, 0x9e, 0x03, 0x15, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x22, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x22, + 0x52, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x22, + 0x6c, 0x0a, 0x17, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x51, 0x0a, 0x0e, 0x71, 0x75, + 0x65, 0x72, 0x69, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x42, 0x1a, 0x9a, 0x84, 0x9e, 0x03, 0x15, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x71, + 0x75, 0x65, 0x72, 0x69, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x22, 0x52, 0x0d, + 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x22, 0x72, 0x0a, + 0x17, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x48, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x57, 0x0a, 0x0e, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, + 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x42, 0x1a, 0x9a, 0x84, 0x9e, 0x03, 0x15, 0x6a, 0x73, 0x6f, + 0x6e, 0x3a, 0x22, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, + 0x73, 0x22, 0x52, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, + 0x73, 0x22, 0x6d, 0x0a, 0x18, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x51, 0x0a, + 0x0e, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x70, 0x62, 0x2e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x1a, 0x9a, 0x84, 0x9e, 0x03, 0x15, 0x6a, 0x73, 0x6f, 0x6e, + 0x3a, 0x22, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, + 0x22, 0x52, 0x0d, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, + 0x22, 0x8b, 0x09, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, + 0x25, 0x0a, 0x0e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x51, + 0x75, 0x65, 0x72, 0x69, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x64, + 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x11, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x64, 0x53, 0x65, 0x72, 0x69, 0x65, + 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x13, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x64, + 0x5f, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x11, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b, + 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x6f, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x73, 0x5f, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0f, 0x70, 0x6f, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x54, 0x6f, 0x75, 0x63, 0x68, 0x65, + 0x64, 0x12, 0x39, 0x0a, 0x19, 0x70, 0x6f, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x74, 0x6f, + 0x75, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x16, 0x70, 0x6f, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x54, 0x6f, + 0x75, 0x63, 0x68, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x53, 0x75, 0x6d, 0x12, 0x2a, 0x0a, 0x11, + 0x70, 0x6f, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x66, 0x65, 0x74, 0x63, + 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x70, 0x6f, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x73, 0x54, 0x6f, 0x46, 0x65, 0x74, 0x63, 0x68, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x6f, 0x73, 0x74, + 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x66, 0x65, 0x74, 0x63, 0x68, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0f, 0x70, 0x6f, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x46, 0x65, 0x74, 0x63, + 0x68, 0x65, 0x64, 0x12, 0x39, 0x0a, 0x19, 0x70, 0x6f, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x5f, + 0x66, 0x65, 0x74, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x73, 0x75, 0x6d, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x16, 0x70, 0x6f, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, + 0x46, 0x65, 0x74, 0x63, 0x68, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x53, 0x75, 0x6d, 0x12, 0x30, + 0x0a, 0x14, 0x70, 0x6f, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x66, 0x65, 0x74, 0x63, 0x68, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x70, 0x6f, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x46, 0x65, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5f, 0x74, 0x6f, 0x75, 0x63, 0x68, + 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, + 0x54, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x64, 0x12, 0x35, 0x0a, 0x17, 0x73, 0x65, 0x72, 0x69, 0x65, + 0x73, 0x5f, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x73, + 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x14, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, + 0x54, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x53, 0x75, 0x6d, 0x12, 0x25, + 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5f, 0x66, 0x65, 0x74, 0x63, 0x68, 0x65, 0x64, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x46, 0x65, + 0x74, 0x63, 0x68, 0x65, 0x64, 0x12, 0x35, 0x0a, 0x17, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5f, + 0x66, 0x65, 0x74, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x73, 0x75, 0x6d, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x14, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x46, 0x65, + 0x74, 0x63, 0x68, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x53, 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x12, + 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5f, 0x66, 0x65, 0x74, 0x63, 0x68, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, + 0x46, 0x65, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x68, + 0x75, 0x6e, 0x6b, 0x73, 0x5f, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x64, 0x18, 0x0f, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0d, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x54, 0x6f, 0x75, 0x63, 0x68, 0x65, + 0x64, 0x12, 0x35, 0x0a, 0x17, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x5f, 0x74, 0x6f, 0x75, 0x63, + 0x68, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x18, 0x10, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x14, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x54, 0x6f, 0x75, 0x63, 0x68, 0x65, + 0x64, 0x53, 0x69, 0x7a, 0x65, 0x53, 0x75, 0x6d, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x68, 0x75, 0x6e, + 0x6b, 0x73, 0x5f, 0x66, 0x65, 0x74, 0x63, 0x68, 0x65, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0d, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x46, 0x65, 0x74, 0x63, 0x68, 0x65, 0x64, 0x12, + 0x35, 0x0a, 0x17, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x5f, 0x66, 0x65, 0x74, 0x63, 0x68, 0x65, + 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x14, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x46, 0x65, 0x74, 0x63, 0x68, 0x65, 0x64, 0x53, + 0x69, 0x7a, 0x65, 0x53, 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, + 0x5f, 0x66, 0x65, 0x74, 0x63, 0x68, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x13, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x10, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x46, 0x65, 0x74, 0x63, 0x68, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x37, 0x0a, 0x18, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x64, 0x6f, 0x77, + 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x73, 0x75, 0x6d, + 0x18, 0x14, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, 0x64, 0x61, 0x74, 0x61, 0x44, 0x6f, 0x77, 0x6e, + 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x53, 0x75, 0x6d, 0x12, 0x61, 0x0a, + 0x10, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x1c, 0x9a, 0x84, 0x9e, 0x03, 0x17, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x67, + 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x52, 0x0e, 0x67, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x5c, 0x0a, 0x0e, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x1a, 0x9a, 0x84, 0x9e, 0x03, 0x15, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, + 0x6d, 0x65, 0x72, 0x67, 0x65, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x52, + 0x0d, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x2f, + 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x68, 0x61, + 0x6e, 0x6f, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2f, 0x70, 0x6b, + 0x67, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x70, 0x62, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - ErrInvalidLengthHints = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowHints = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupHints = fmt.Errorf("proto: unexpected end of group") + file_store_hintspb_hints_proto_rawDescOnce sync.Once + file_store_hintspb_hints_proto_rawDescData = file_store_hintspb_hints_proto_rawDesc ) + +func file_store_hintspb_hints_proto_rawDescGZIP() []byte { + file_store_hintspb_hints_proto_rawDescOnce.Do(func() { + file_store_hintspb_hints_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_hintspb_hints_proto_rawDescData) + }) + return file_store_hintspb_hints_proto_rawDescData +} + +var file_store_hintspb_hints_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_store_hintspb_hints_proto_goTypes = []any{ + (*SeriesRequestHints)(nil), // 0: hintspb.SeriesRequestHints + (*SeriesResponseHints)(nil), // 1: hintspb.SeriesResponseHints + (*Block)(nil), // 2: hintspb.Block + (*LabelNamesRequestHints)(nil), // 3: hintspb.LabelNamesRequestHints + (*LabelNamesResponseHints)(nil), // 4: hintspb.LabelNamesResponseHints + (*LabelValuesRequestHints)(nil), // 5: hintspb.LabelValuesRequestHints + (*LabelValuesResponseHints)(nil), // 6: hintspb.LabelValuesResponseHints + (*QueryStats)(nil), // 7: hintspb.QueryStats + (*storepb.LabelMatcher)(nil), // 8: thanos.LabelMatcher + (*durationpb.Duration)(nil), // 9: google.protobuf.Duration +} +var file_store_hintspb_hints_proto_depIdxs = []int32{ + 8, // 0: hintspb.SeriesRequestHints.block_matchers:type_name -> thanos.LabelMatcher + 2, // 1: hintspb.SeriesResponseHints.queried_blocks:type_name -> hintspb.Block + 7, // 2: hintspb.SeriesResponseHints.query_stats:type_name -> hintspb.QueryStats + 8, // 3: hintspb.LabelNamesRequestHints.block_matchers:type_name -> thanos.LabelMatcher + 2, // 4: hintspb.LabelNamesResponseHints.queried_blocks:type_name -> hintspb.Block + 8, // 5: hintspb.LabelValuesRequestHints.block_matchers:type_name -> thanos.LabelMatcher + 2, // 6: hintspb.LabelValuesResponseHints.queried_blocks:type_name -> hintspb.Block + 9, // 7: hintspb.QueryStats.get_all_duration:type_name -> google.protobuf.Duration + 9, // 8: hintspb.QueryStats.merge_duration:type_name -> google.protobuf.Duration + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_store_hintspb_hints_proto_init() } +func file_store_hintspb_hints_proto_init() { + if File_store_hintspb_hints_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_store_hintspb_hints_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_store_hintspb_hints_proto_goTypes, + DependencyIndexes: file_store_hintspb_hints_proto_depIdxs, + MessageInfos: file_store_hintspb_hints_proto_msgTypes, + }.Build() + File_store_hintspb_hints_proto = out.File + file_store_hintspb_hints_proto_rawDesc = nil + file_store_hintspb_hints_proto_goTypes = nil + file_store_hintspb_hints_proto_depIdxs = nil +} diff --git a/pkg/store/hintspb/hints.proto b/pkg/store/hintspb/hints.proto index 69c60d2a7dd..008152101bd 100644 --- a/pkg/store/hintspb/hints.proto +++ b/pkg/store/hintspb/hints.proto @@ -4,36 +4,26 @@ syntax = "proto3"; package hintspb; -import "gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; import "store/storepb/types.proto"; +import "tagger/tagger.proto"; -option go_package = "hintspb"; - -option (gogoproto.sizer_all) = true; -option (gogoproto.marshaler_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; - -// Do not generate XXX fields to reduce memory. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; +option go_package = "github.com/thanos-io/thanos/pkg/store/hintspb"; message SeriesRequestHints { /// block_matchers is a list of label matchers that are evaluated against each single block's /// labels to filter which blocks get queried. If the list is empty, no per-block filtering /// is applied. - repeated thanos.LabelMatcher block_matchers = 1 [(gogoproto.nullable) = false]; + repeated thanos.LabelMatcher block_matchers = 1 [(tagger.tags) = "json:\"block_matchers\""]; bool enable_query_stats = 2; } message SeriesResponseHints { /// queried_blocks is the list of blocks that have been queried. - repeated Block queried_blocks = 1 [(gogoproto.nullable) = false]; + repeated Block queried_blocks = 1 [(tagger.tags) = "json:\"queried_blocks\""]; /// query_stats contains statistics of querying store gateway. - QueryStats query_stats = 2 [(gogoproto.nullable) = true]; + QueryStats query_stats = 2; } message Block { @@ -45,24 +35,24 @@ message LabelNamesRequestHints { /// block_matchers is a list of label matchers that are evaluated against each single block's /// labels to filter which blocks get queried. If the list is empty, no per-block filtering /// is applied. - repeated thanos.LabelMatcher block_matchers = 1 [(gogoproto.nullable) = false]; + repeated thanos.LabelMatcher block_matchers = 1 [(tagger.tags) = "json:\"block_matchers\""]; } message LabelNamesResponseHints { /// queried_blocks is the list of blocks that have been queried. - repeated Block queried_blocks = 1 [(gogoproto.nullable) = false]; + repeated Block queried_blocks = 1 [(tagger.tags) = "json:\"queried_blocks\""]; } message LabelValuesRequestHints { /// block_matchers is a list of label matchers that are evaluated against each single block's /// labels to filter which blocks get queried. If the list is empty, no per-block filtering /// is applied. - repeated thanos.LabelMatcher block_matchers = 1 [(gogoproto.nullable) = false]; + repeated thanos.LabelMatcher block_matchers = 1 [(tagger.tags) = "json:\"block_matchers\""]; } message LabelValuesResponseHints { /// queried_blocks is the list of blocks that have been queried. - repeated Block queried_blocks = 1 [(gogoproto.nullable) = false]; + repeated Block queried_blocks = 1 [(tagger.tags) = "json:\"queried_blocks\""]; } /// QueryStats fields are unstable and might change in the future. @@ -91,6 +81,6 @@ message QueryStats { int64 chunks_fetch_count = 19; int64 data_downloaded_size_sum = 20; - google.protobuf.Duration get_all_duration = 21 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; - google.protobuf.Duration merge_duration = 22 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; -} \ No newline at end of file + google.protobuf.Duration get_all_duration = 21 [(tagger.tags) = "json:\"get_all_duration\""]; + google.protobuf.Duration merge_duration = 22 [(tagger.tags) = "json:\"merge_duration\""]; +} diff --git a/pkg/store/hintspb/hints_vtproto.pb.go b/pkg/store/hintspb/hints_vtproto.pb.go new file mode 100644 index 00000000000..bc30c501a67 --- /dev/null +++ b/pkg/store/hintspb/hints_vtproto.pb.go @@ -0,0 +1,2397 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.1-0.20250313105119-ba97887b0a25 +// source: store/hintspb/hints.proto + +package hintspb + +import ( + fmt "fmt" + io "io" + + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + durationpb1 "github.com/planetscale/vtprotobuf/types/known/durationpb" + storepb "github.com/thanos-io/thanos/pkg/store/storepb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *SeriesRequestHints) CloneVT() *SeriesRequestHints { + if m == nil { + return (*SeriesRequestHints)(nil) + } + r := new(SeriesRequestHints) + r.EnableQueryStats = m.EnableQueryStats + if rhs := m.BlockMatchers; rhs != nil { + tmpContainer := make([]*storepb.LabelMatcher, len(rhs)) + for k, v := range rhs { + if vtpb, ok := interface{}(v).(interface{ CloneVT() *storepb.LabelMatcher }); ok { + tmpContainer[k] = vtpb.CloneVT() + } else { + tmpContainer[k] = proto.Clone(v).(*storepb.LabelMatcher) + } + } + r.BlockMatchers = tmpContainer + } + return r +} + +func (m *SeriesRequestHints) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *SeriesResponseHints) CloneVT() *SeriesResponseHints { + if m == nil { + return (*SeriesResponseHints)(nil) + } + r := new(SeriesResponseHints) + r.QueryStats = m.QueryStats.CloneVT() + if rhs := m.QueriedBlocks; rhs != nil { + tmpContainer := make([]*Block, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.QueriedBlocks = tmpContainer + } + return r +} + +func (m *SeriesResponseHints) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Block) CloneVT() *Block { + if m == nil { + return (*Block)(nil) + } + r := new(Block) + r.Id = m.Id + return r +} + +func (m *Block) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *LabelNamesRequestHints) CloneVT() *LabelNamesRequestHints { + if m == nil { + return (*LabelNamesRequestHints)(nil) + } + r := new(LabelNamesRequestHints) + if rhs := m.BlockMatchers; rhs != nil { + tmpContainer := make([]*storepb.LabelMatcher, len(rhs)) + for k, v := range rhs { + if vtpb, ok := interface{}(v).(interface{ CloneVT() *storepb.LabelMatcher }); ok { + tmpContainer[k] = vtpb.CloneVT() + } else { + tmpContainer[k] = proto.Clone(v).(*storepb.LabelMatcher) + } + } + r.BlockMatchers = tmpContainer + } + return r +} + +func (m *LabelNamesRequestHints) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *LabelNamesResponseHints) CloneVT() *LabelNamesResponseHints { + if m == nil { + return (*LabelNamesResponseHints)(nil) + } + r := new(LabelNamesResponseHints) + if rhs := m.QueriedBlocks; rhs != nil { + tmpContainer := make([]*Block, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.QueriedBlocks = tmpContainer + } + return r +} + +func (m *LabelNamesResponseHints) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *LabelValuesRequestHints) CloneVT() *LabelValuesRequestHints { + if m == nil { + return (*LabelValuesRequestHints)(nil) + } + r := new(LabelValuesRequestHints) + if rhs := m.BlockMatchers; rhs != nil { + tmpContainer := make([]*storepb.LabelMatcher, len(rhs)) + for k, v := range rhs { + if vtpb, ok := interface{}(v).(interface{ CloneVT() *storepb.LabelMatcher }); ok { + tmpContainer[k] = vtpb.CloneVT() + } else { + tmpContainer[k] = proto.Clone(v).(*storepb.LabelMatcher) + } + } + r.BlockMatchers = tmpContainer + } + return r +} + +func (m *LabelValuesRequestHints) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *LabelValuesResponseHints) CloneVT() *LabelValuesResponseHints { + if m == nil { + return (*LabelValuesResponseHints)(nil) + } + r := new(LabelValuesResponseHints) + if rhs := m.QueriedBlocks; rhs != nil { + tmpContainer := make([]*Block, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.QueriedBlocks = tmpContainer + } + return r +} + +func (m *LabelValuesResponseHints) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *QueryStats) CloneVT() *QueryStats { + if m == nil { + return (*QueryStats)(nil) + } + r := new(QueryStats) + r.BlocksQueried = m.BlocksQueried + r.MergedSeriesCount = m.MergedSeriesCount + r.MergedChunksCount = m.MergedChunksCount + r.PostingsTouched = m.PostingsTouched + r.PostingsTouchedSizeSum = m.PostingsTouchedSizeSum + r.PostingsToFetch = m.PostingsToFetch + r.PostingsFetched = m.PostingsFetched + r.PostingsFetchedSizeSum = m.PostingsFetchedSizeSum + r.PostingsFetchCount = m.PostingsFetchCount + r.SeriesTouched = m.SeriesTouched + r.SeriesTouchedSizeSum = m.SeriesTouchedSizeSum + r.SeriesFetched = m.SeriesFetched + r.SeriesFetchedSizeSum = m.SeriesFetchedSizeSum + r.SeriesFetchCount = m.SeriesFetchCount + r.ChunksTouched = m.ChunksTouched + r.ChunksTouchedSizeSum = m.ChunksTouchedSizeSum + r.ChunksFetched = m.ChunksFetched + r.ChunksFetchedSizeSum = m.ChunksFetchedSizeSum + r.ChunksFetchCount = m.ChunksFetchCount + r.DataDownloadedSizeSum = m.DataDownloadedSizeSum + r.GetAllDuration = (*durationpb.Duration)((*durationpb1.Duration)(m.GetAllDuration).CloneVT()) + r.MergeDuration = (*durationpb.Duration)((*durationpb1.Duration)(m.MergeDuration).CloneVT()) + return r +} + +func (m *QueryStats) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *SeriesRequestHints) EqualVT(that *SeriesRequestHints) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.BlockMatchers) != len(that.BlockMatchers) { + return false + } + for i, vx := range this.BlockMatchers { + vy := that.BlockMatchers[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &storepb.LabelMatcher{} + } + if q == nil { + q = &storepb.LabelMatcher{} + } + if equal, ok := interface{}(p).(interface { + EqualVT(*storepb.LabelMatcher) bool + }); ok { + if !equal.EqualVT(q) { + return false + } + } else if !proto.Equal(p, q) { + return false + } + } + } + if this.EnableQueryStats != that.EnableQueryStats { + return false + } + return true +} + +func (this *SeriesRequestHints) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*SeriesRequestHints) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *SeriesResponseHints) EqualVT(that *SeriesResponseHints) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.QueriedBlocks) != len(that.QueriedBlocks) { + return false + } + for i, vx := range this.QueriedBlocks { + vy := that.QueriedBlocks[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Block{} + } + if q == nil { + q = &Block{} + } + if !p.EqualVT(q) { + return false + } + } + } + if !this.QueryStats.EqualVT(that.QueryStats) { + return false + } + return true +} + +func (this *SeriesResponseHints) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*SeriesResponseHints) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Block) EqualVT(that *Block) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Id != that.Id { + return false + } + return true +} + +func (this *Block) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Block) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *LabelNamesRequestHints) EqualVT(that *LabelNamesRequestHints) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.BlockMatchers) != len(that.BlockMatchers) { + return false + } + for i, vx := range this.BlockMatchers { + vy := that.BlockMatchers[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &storepb.LabelMatcher{} + } + if q == nil { + q = &storepb.LabelMatcher{} + } + if equal, ok := interface{}(p).(interface { + EqualVT(*storepb.LabelMatcher) bool + }); ok { + if !equal.EqualVT(q) { + return false + } + } else if !proto.Equal(p, q) { + return false + } + } + } + return true +} + +func (this *LabelNamesRequestHints) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*LabelNamesRequestHints) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *LabelNamesResponseHints) EqualVT(that *LabelNamesResponseHints) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.QueriedBlocks) != len(that.QueriedBlocks) { + return false + } + for i, vx := range this.QueriedBlocks { + vy := that.QueriedBlocks[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Block{} + } + if q == nil { + q = &Block{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *LabelNamesResponseHints) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*LabelNamesResponseHints) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *LabelValuesRequestHints) EqualVT(that *LabelValuesRequestHints) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.BlockMatchers) != len(that.BlockMatchers) { + return false + } + for i, vx := range this.BlockMatchers { + vy := that.BlockMatchers[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &storepb.LabelMatcher{} + } + if q == nil { + q = &storepb.LabelMatcher{} + } + if equal, ok := interface{}(p).(interface { + EqualVT(*storepb.LabelMatcher) bool + }); ok { + if !equal.EqualVT(q) { + return false + } + } else if !proto.Equal(p, q) { + return false + } + } + } + return true +} + +func (this *LabelValuesRequestHints) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*LabelValuesRequestHints) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *LabelValuesResponseHints) EqualVT(that *LabelValuesResponseHints) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.QueriedBlocks) != len(that.QueriedBlocks) { + return false + } + for i, vx := range this.QueriedBlocks { + vy := that.QueriedBlocks[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Block{} + } + if q == nil { + q = &Block{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *LabelValuesResponseHints) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*LabelValuesResponseHints) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *QueryStats) EqualVT(that *QueryStats) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.BlocksQueried != that.BlocksQueried { + return false + } + if this.MergedSeriesCount != that.MergedSeriesCount { + return false + } + if this.MergedChunksCount != that.MergedChunksCount { + return false + } + if this.PostingsTouched != that.PostingsTouched { + return false + } + if this.PostingsTouchedSizeSum != that.PostingsTouchedSizeSum { + return false + } + if this.PostingsToFetch != that.PostingsToFetch { + return false + } + if this.PostingsFetched != that.PostingsFetched { + return false + } + if this.PostingsFetchedSizeSum != that.PostingsFetchedSizeSum { + return false + } + if this.PostingsFetchCount != that.PostingsFetchCount { + return false + } + if this.SeriesTouched != that.SeriesTouched { + return false + } + if this.SeriesTouchedSizeSum != that.SeriesTouchedSizeSum { + return false + } + if this.SeriesFetched != that.SeriesFetched { + return false + } + if this.SeriesFetchedSizeSum != that.SeriesFetchedSizeSum { + return false + } + if this.SeriesFetchCount != that.SeriesFetchCount { + return false + } + if this.ChunksTouched != that.ChunksTouched { + return false + } + if this.ChunksTouchedSizeSum != that.ChunksTouchedSizeSum { + return false + } + if this.ChunksFetched != that.ChunksFetched { + return false + } + if this.ChunksFetchedSizeSum != that.ChunksFetchedSizeSum { + return false + } + if this.ChunksFetchCount != that.ChunksFetchCount { + return false + } + if this.DataDownloadedSizeSum != that.DataDownloadedSizeSum { + return false + } + if !(*durationpb1.Duration)(this.GetAllDuration).EqualVT((*durationpb1.Duration)(that.GetAllDuration)) { + return false + } + if !(*durationpb1.Duration)(this.MergeDuration).EqualVT((*durationpb1.Duration)(that.MergeDuration)) { + return false + } + return true +} + +func (this *QueryStats) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*QueryStats) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *SeriesRequestHints) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SeriesRequestHints) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SeriesRequestHints) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.EnableQueryStats { + i-- + if m.EnableQueryStats { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.BlockMatchers) > 0 { + for iNdEx := len(m.BlockMatchers) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.BlockMatchers[iNdEx]).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.BlockMatchers[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *SeriesResponseHints) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SeriesResponseHints) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SeriesResponseHints) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.QueryStats != nil { + size, err := m.QueryStats.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if len(m.QueriedBlocks) > 0 { + for iNdEx := len(m.QueriedBlocks) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.QueriedBlocks[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Block) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Block) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Block) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LabelNamesRequestHints) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LabelNamesRequestHints) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LabelNamesRequestHints) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BlockMatchers) > 0 { + for iNdEx := len(m.BlockMatchers) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.BlockMatchers[iNdEx]).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.BlockMatchers[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *LabelNamesResponseHints) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LabelNamesResponseHints) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LabelNamesResponseHints) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.QueriedBlocks) > 0 { + for iNdEx := len(m.QueriedBlocks) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.QueriedBlocks[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *LabelValuesRequestHints) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LabelValuesRequestHints) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LabelValuesRequestHints) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BlockMatchers) > 0 { + for iNdEx := len(m.BlockMatchers) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.BlockMatchers[iNdEx]).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.BlockMatchers[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *LabelValuesResponseHints) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LabelValuesResponseHints) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LabelValuesResponseHints) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.QueriedBlocks) > 0 { + for iNdEx := len(m.QueriedBlocks) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.QueriedBlocks[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryStats) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryStats) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *QueryStats) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.MergeDuration != nil { + size, err := (*durationpb1.Duration)(m.MergeDuration).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if m.GetAllDuration != nil { + size, err := (*durationpb1.Duration)(m.GetAllDuration).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + if m.DataDownloadedSizeSum != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DataDownloadedSizeSum)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa0 + } + if m.ChunksFetchCount != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ChunksFetchCount)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 + } + if m.ChunksFetchedSizeSum != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ChunksFetchedSizeSum)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if m.ChunksFetched != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ChunksFetched)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x88 + } + if m.ChunksTouchedSizeSum != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ChunksTouchedSizeSum)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.ChunksTouched != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ChunksTouched)) + i-- + dAtA[i] = 0x78 + } + if m.SeriesFetchCount != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SeriesFetchCount)) + i-- + dAtA[i] = 0x70 + } + if m.SeriesFetchedSizeSum != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SeriesFetchedSizeSum)) + i-- + dAtA[i] = 0x68 + } + if m.SeriesFetched != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SeriesFetched)) + i-- + dAtA[i] = 0x60 + } + if m.SeriesTouchedSizeSum != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SeriesTouchedSizeSum)) + i-- + dAtA[i] = 0x58 + } + if m.SeriesTouched != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SeriesTouched)) + i-- + dAtA[i] = 0x50 + } + if m.PostingsFetchCount != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PostingsFetchCount)) + i-- + dAtA[i] = 0x48 + } + if m.PostingsFetchedSizeSum != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PostingsFetchedSizeSum)) + i-- + dAtA[i] = 0x40 + } + if m.PostingsFetched != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PostingsFetched)) + i-- + dAtA[i] = 0x38 + } + if m.PostingsToFetch != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PostingsToFetch)) + i-- + dAtA[i] = 0x30 + } + if m.PostingsTouchedSizeSum != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PostingsTouchedSizeSum)) + i-- + dAtA[i] = 0x28 + } + if m.PostingsTouched != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PostingsTouched)) + i-- + dAtA[i] = 0x20 + } + if m.MergedChunksCount != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MergedChunksCount)) + i-- + dAtA[i] = 0x18 + } + if m.MergedSeriesCount != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MergedSeriesCount)) + i-- + dAtA[i] = 0x10 + } + if m.BlocksQueried != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.BlocksQueried)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SeriesRequestHints) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.BlockMatchers) > 0 { + for _, e := range m.BlockMatchers { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.EnableQueryStats { + n += 2 + } + return n +} + +func (m *SeriesResponseHints) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.QueriedBlocks) > 0 { + for _, e := range m.QueriedBlocks { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.QueryStats != nil { + l = m.QueryStats.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *Block) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *LabelNamesRequestHints) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.BlockMatchers) > 0 { + for _, e := range m.BlockMatchers { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *LabelNamesResponseHints) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.QueriedBlocks) > 0 { + for _, e := range m.QueriedBlocks { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *LabelValuesRequestHints) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.BlockMatchers) > 0 { + for _, e := range m.BlockMatchers { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *LabelValuesResponseHints) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.QueriedBlocks) > 0 { + for _, e := range m.QueriedBlocks { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *QueryStats) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlocksQueried != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.BlocksQueried)) + } + if m.MergedSeriesCount != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MergedSeriesCount)) + } + if m.MergedChunksCount != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MergedChunksCount)) + } + if m.PostingsTouched != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PostingsTouched)) + } + if m.PostingsTouchedSizeSum != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PostingsTouchedSizeSum)) + } + if m.PostingsToFetch != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PostingsToFetch)) + } + if m.PostingsFetched != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PostingsFetched)) + } + if m.PostingsFetchedSizeSum != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PostingsFetchedSizeSum)) + } + if m.PostingsFetchCount != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PostingsFetchCount)) + } + if m.SeriesTouched != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.SeriesTouched)) + } + if m.SeriesTouchedSizeSum != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.SeriesTouchedSizeSum)) + } + if m.SeriesFetched != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.SeriesFetched)) + } + if m.SeriesFetchedSizeSum != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.SeriesFetchedSizeSum)) + } + if m.SeriesFetchCount != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.SeriesFetchCount)) + } + if m.ChunksTouched != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ChunksTouched)) + } + if m.ChunksTouchedSizeSum != 0 { + n += 2 + protohelpers.SizeOfVarint(uint64(m.ChunksTouchedSizeSum)) + } + if m.ChunksFetched != 0 { + n += 2 + protohelpers.SizeOfVarint(uint64(m.ChunksFetched)) + } + if m.ChunksFetchedSizeSum != 0 { + n += 2 + protohelpers.SizeOfVarint(uint64(m.ChunksFetchedSizeSum)) + } + if m.ChunksFetchCount != 0 { + n += 2 + protohelpers.SizeOfVarint(uint64(m.ChunksFetchCount)) + } + if m.DataDownloadedSizeSum != 0 { + n += 2 + protohelpers.SizeOfVarint(uint64(m.DataDownloadedSizeSum)) + } + if m.GetAllDuration != nil { + l = (*durationpb1.Duration)(m.GetAllDuration).SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.MergeDuration != nil { + l = (*durationpb1.Duration)(m.MergeDuration).SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *SeriesRequestHints) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SeriesRequestHints: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SeriesRequestHints: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockMatchers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockMatchers = append(m.BlockMatchers, &storepb.LabelMatcher{}) + if unmarshal, ok := interface{}(m.BlockMatchers[len(m.BlockMatchers)-1]).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.BlockMatchers[len(m.BlockMatchers)-1]); err != nil { + return err + } + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableQueryStats", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableQueryStats = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SeriesResponseHints) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SeriesResponseHints: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SeriesResponseHints: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueriedBlocks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QueriedBlocks = append(m.QueriedBlocks, &Block{}) + if err := m.QueriedBlocks[len(m.QueriedBlocks)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryStats", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.QueryStats == nil { + m.QueryStats = &QueryStats{} + } + if err := m.QueryStats.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Block) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Block: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Block: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LabelNamesRequestHints) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LabelNamesRequestHints: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LabelNamesRequestHints: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockMatchers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockMatchers = append(m.BlockMatchers, &storepb.LabelMatcher{}) + if unmarshal, ok := interface{}(m.BlockMatchers[len(m.BlockMatchers)-1]).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.BlockMatchers[len(m.BlockMatchers)-1]); err != nil { + return err + } + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LabelNamesResponseHints) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LabelNamesResponseHints: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LabelNamesResponseHints: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueriedBlocks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QueriedBlocks = append(m.QueriedBlocks, &Block{}) + if err := m.QueriedBlocks[len(m.QueriedBlocks)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LabelValuesRequestHints) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LabelValuesRequestHints: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LabelValuesRequestHints: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockMatchers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockMatchers = append(m.BlockMatchers, &storepb.LabelMatcher{}) + if unmarshal, ok := interface{}(m.BlockMatchers[len(m.BlockMatchers)-1]).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.BlockMatchers[len(m.BlockMatchers)-1]); err != nil { + return err + } + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LabelValuesResponseHints) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LabelValuesResponseHints: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LabelValuesResponseHints: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueriedBlocks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QueriedBlocks = append(m.QueriedBlocks, &Block{}) + if err := m.QueriedBlocks[len(m.QueriedBlocks)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryStats) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryStats: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryStats: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlocksQueried", wireType) + } + m.BlocksQueried = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlocksQueried |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MergedSeriesCount", wireType) + } + m.MergedSeriesCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MergedSeriesCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MergedChunksCount", wireType) + } + m.MergedChunksCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MergedChunksCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PostingsTouched", wireType) + } + m.PostingsTouched = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PostingsTouched |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PostingsTouchedSizeSum", wireType) + } + m.PostingsTouchedSizeSum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PostingsTouchedSizeSum |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PostingsToFetch", wireType) + } + m.PostingsToFetch = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PostingsToFetch |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PostingsFetched", wireType) + } + m.PostingsFetched = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PostingsFetched |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PostingsFetchedSizeSum", wireType) + } + m.PostingsFetchedSizeSum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PostingsFetchedSizeSum |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PostingsFetchCount", wireType) + } + m.PostingsFetchCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PostingsFetchCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SeriesTouched", wireType) + } + m.SeriesTouched = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SeriesTouched |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SeriesTouchedSizeSum", wireType) + } + m.SeriesTouchedSizeSum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SeriesTouchedSizeSum |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SeriesFetched", wireType) + } + m.SeriesFetched = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SeriesFetched |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SeriesFetchedSizeSum", wireType) + } + m.SeriesFetchedSizeSum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SeriesFetchedSizeSum |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SeriesFetchCount", wireType) + } + m.SeriesFetchCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SeriesFetchCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChunksTouched", wireType) + } + m.ChunksTouched = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChunksTouched |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChunksTouchedSizeSum", wireType) + } + m.ChunksTouchedSizeSum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChunksTouchedSizeSum |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 17: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChunksFetched", wireType) + } + m.ChunksFetched = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChunksFetched |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChunksFetchedSizeSum", wireType) + } + m.ChunksFetchedSizeSum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChunksFetchedSizeSum |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChunksFetchCount", wireType) + } + m.ChunksFetchCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChunksFetchCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 20: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DataDownloadedSizeSum", wireType) + } + m.DataDownloadedSizeSum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DataDownloadedSizeSum |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GetAllDuration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.GetAllDuration == nil { + m.GetAllDuration = &durationpb.Duration{} + } + if err := (*durationpb1.Duration)(m.GetAllDuration).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MergeDuration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MergeDuration == nil { + m.MergeDuration = &durationpb.Duration{} + } + if err := (*durationpb1.Duration)(m.MergeDuration).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pkg/store/labelpb/label.go b/pkg/store/labelpb/label.go deleted file mode 100644 index 90192d0fac8..00000000000 --- a/pkg/store/labelpb/label.go +++ /dev/null @@ -1,438 +0,0 @@ -// Copyright (c) The Thanos Authors. -// Licensed under the Apache License 2.0. - -// Package containing proto and JSON serializable Labels and ZLabels (no copy) structs used to -// identify series. This package expose no-copy converters to Prometheus labels.Labels. - -package labelpb - -import ( - "encoding/json" - "fmt" - "io" - "sort" - "strings" - "unsafe" - - "github.com/cespare/xxhash/v2" - "github.com/pkg/errors" - "github.com/prometheus/prometheus/model/labels" - "go4.org/intern" -) - -var ( - ErrOutOfOrderLabels = errors.New("out of order labels") - ErrEmptyLabels = errors.New("label set contains a label with empty name or value") - ErrDuplicateLabels = errors.New("label set contains duplicate label names") - - sep = []byte{'\xff'} -) - -func noAllocString(buf []byte) string { - return *(*string)(unsafe.Pointer(&buf)) -} - -func noAllocBytes(buf string) []byte { - return *(*[]byte)(unsafe.Pointer(&buf)) -} - -// ZLabelsFromPromLabels converts Prometheus labels to slice of labelpb.ZLabel in type unsafe manner. -// It reuses the same memory. Caller should abort using passed labels.Labels. -func ZLabelsFromPromLabels(lset labels.Labels) []ZLabel { - return *(*[]ZLabel)(unsafe.Pointer(&lset)) -} - -// ZLabelsToPromLabels convert slice of labelpb.ZLabel to Prometheus labels in type unsafe manner. -// It reuses the same memory. Caller should abort using passed []ZLabel. -// NOTE: Use with care. ZLabels holds memory from the whole protobuf unmarshal, so the returned -// Prometheus Labels will hold this memory as well. -func ZLabelsToPromLabels(lset []ZLabel) labels.Labels { - return *(*labels.Labels)(unsafe.Pointer(&lset)) -} - -// ReAllocAndInternZLabelsStrings re-allocates all underlying bytes for string, detaching it from bigger memory pool. -// If `intern` is set to true, the method will use interning, i.e. reuse already allocated strings, to make the reallocation -// method more efficient. -// -// This is primarily intended to be used before labels are written into TSDB which can hold label strings in the memory long term. -func ReAllocZLabelsStrings(lset *[]ZLabel, intern bool) { - if intern { - for j, l := range *lset { - (*lset)[j].Name = detachAndInternLabelString(l.Name) - (*lset)[j].Value = detachAndInternLabelString(l.Value) - } - return - } - - for j, l := range *lset { - (*lset)[j].Name = string(noAllocBytes(l.Name)) - (*lset)[j].Value = string(noAllocBytes(l.Value)) - } -} - -// internLabelString is a helper method to intern a label string or, -// if the string was previously interned, it returns the existing -// reference and asserts it to a string. -func internLabelString(s string) string { - return intern.GetByString(s).Get().(string) -} - -// detachAndInternLabelString reallocates the label string to detach it -// from a bigger memory pool and interns the string. -func detachAndInternLabelString(s string) string { - return internLabelString(string(noAllocBytes(s))) -} - -// ZLabelSetsToPromLabelSets converts slice of labelpb.ZLabelSet to slice of Prometheus labels. -func ZLabelSetsToPromLabelSets(lss ...ZLabelSet) []labels.Labels { - res := make([]labels.Labels, 0, len(lss)) - for _, ls := range lss { - res = append(res, ls.PromLabels()) - } - return res -} - -// ZLabelSetsFromPromLabels converts []labels.labels to []labelpb.ZLabelSet. -func ZLabelSetsFromPromLabels(lss ...labels.Labels) []ZLabelSet { - sets := make([]ZLabelSet, 0, len(lss)) - for _, ls := range lss { - set := ZLabelSet{ - Labels: make([]ZLabel, 0, ls.Len()), - } - ls.Range(func(lbl labels.Label) { - set.Labels = append(set.Labels, ZLabel{ - Name: lbl.Name, - Value: lbl.Value, - }) - }) - sets = append(sets, set) - } - - return sets -} - -// ZLabel is a Label (also easily transformable to Prometheus labels.Labels) that can be unmarshalled from protobuf -// reusing the same memory address for string bytes. -// NOTE: While unmarshalling it uses exactly same bytes that were allocated for protobuf. This mean that *whole* protobuf -// bytes will be not GC-ed as long as ZLabels are referenced somewhere. Use it carefully, only for short living -// protobuf message processing. -type ZLabel Label - -func (m *ZLabel) MarshalTo(data []byte) (int, error) { - f := Label(*m) - return f.MarshalTo(data) -} - -func (m *ZLabel) MarshalToSizedBuffer(data []byte) (int, error) { - f := Label(*m) - return f.MarshalToSizedBuffer(data) -} - -// Unmarshal unmarshalls gRPC protobuf into ZLabel struct. ZLabel string is directly using bytes passed in `data`. -// To use it add (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel" to proto field tag. -// NOTE: This exists in internal Google protobuf implementation, but not in open source one: https://news.ycombinator.com/item?id=23588882 -func (m *ZLabel) Unmarshal(data []byte) error { - l := len(data) - - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ZLabel: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ZLabel: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = noAllocString(data[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = noAllocString(data[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *ZLabel) UnmarshalJSON(entry []byte) error { - f := Label(*m) - if err := json.Unmarshal(entry, &f); err != nil { - return errors.Wrapf(err, "labels: label field unmarshal: %v", string(entry)) - } - *m = ZLabel(f) - return nil -} - -func (m *ZLabel) Marshal() ([]byte, error) { - f := Label(*m) - return f.Marshal() -} - -func (m *ZLabel) MarshalJSON() ([]byte, error) { - return json.Marshal(Label(*m)) -} - -// Size implements proto.Sizer. -func (m *ZLabel) Size() (n int) { - f := Label(*m) - return f.Size() -} - -// Equal implements proto.Equaler. -func (m *ZLabel) Equal(other ZLabel) bool { - return m.Name == other.Name && m.Value == other.Value -} - -// Compare implements proto.Comparer. -func (m *ZLabel) Compare(other ZLabel) int { - if c := strings.Compare(m.Name, other.Name); c != 0 { - return c - } - return strings.Compare(m.Value, other.Value) -} - -// ExtendSortedLabels extend given labels by extend in labels format. -// The type conversion is done safely, which means we don't modify extend labels underlying array. -// -// In case of existing labels already present in given label set, it will be overwritten by external one. -func ExtendSortedLabels(lset, extend labels.Labels) labels.Labels { - if extend.IsEmpty() { - return lset.Copy() - } - b := labels.NewBuilder(lset) - extend.Range(func(l labels.Label) { - b.Set(l.Name, l.Value) - }) - return b.Labels() -} - -func PromLabelSetsToString(lsets []labels.Labels) string { - return PromLabelSetsToStringN(lsets, 200) -} - -func PromLabelSetsToStringN(lsets []labels.Labels, maxLength int) string { - if len(lsets) == 0 { - return "" - } - s := []string{} - for _, ls := range lsets { - s = append(s, ls.String()) - maxLength -= len(ls.String()) - if maxLength <= 0 { - break - } - } - sort.Strings(s) - return strings.Join(s, ",") -} - -func (m *ZLabelSet) UnmarshalJSON(entry []byte) error { - lbls := labels.Labels{} - if err := lbls.UnmarshalJSON(entry); err != nil { - return errors.Wrapf(err, "labels: labels field unmarshal: %v", string(entry)) - } - m.Labels = ZLabelsFromPromLabels(lbls) - return nil -} - -func (m *ZLabelSet) MarshalJSON() ([]byte, error) { - return m.PromLabels().MarshalJSON() -} - -// PromLabels return Prometheus labels.Labels without extra allocation. -func (m *ZLabelSet) PromLabels() labels.Labels { - return ZLabelsToPromLabels(m.Labels) -} - -// DeepCopy copies labels and each label's string to separate bytes. -func DeepCopy(lbls []ZLabel) []ZLabel { - ret := make([]ZLabel, len(lbls)) - for i := range lbls { - ret[i].Name = string(noAllocBytes(lbls[i].Name)) - ret[i].Value = string(noAllocBytes(lbls[i].Value)) - } - return ret -} - -// HashWithPrefix returns a hash for the given prefix and labels. -func HashWithPrefix(prefix string, lbls []ZLabel) uint64 { - // Use xxhash.Sum64(b) for fast path as it's faster. - b := make([]byte, 0, 1024) - b = append(b, prefix...) - b = append(b, sep[0]) - - for i, v := range lbls { - if len(b)+len(v.Name)+len(v.Value)+2 >= cap(b) { - // If labels entry is 1KB allocate do not allocate whole entry. - h := xxhash.New() - _, _ = h.Write(b) - for _, v := range lbls[i:] { - _, _ = h.WriteString(v.Name) - _, _ = h.Write(sep) - _, _ = h.WriteString(v.Value) - _, _ = h.Write(sep) - } - return h.Sum64() - } - b = append(b, v.Name...) - b = append(b, sep[0]) - b = append(b, v.Value...) - b = append(b, sep[0]) - } - return xxhash.Sum64(b) -} - -// ValidateLabels validates label names and values (checks for empty -// names and values, out of order labels and duplicate label names) -// Returns appropriate error if validation fails on a label. -func ValidateLabels(lbls []ZLabel) error { - if len(lbls) == 0 { - return ErrEmptyLabels - } - - // Check first label. - l0 := lbls[0] - if l0.Name == "" || l0.Value == "" { - return ErrEmptyLabels - } - - // Iterate over the rest, check each for empty / duplicates and - // check lexicographical (alphabetically) ordering. - for _, l := range lbls[1:] { - if l.Name == "" || l.Value == "" { - return ErrEmptyLabels - } - - if l.Name == l0.Name { - return ErrDuplicateLabels - } - - if l.Name < l0.Name { - return ErrOutOfOrderLabels - } - l0 = l - } - - return nil -} - -// ZLabelSets is a sortable list of ZLabelSet. It assumes the label pairs in each ZLabelSet element are already sorted. -type ZLabelSets []ZLabelSet - -func (z ZLabelSets) Len() int { return len(z) } - -func (z ZLabelSets) Swap(i, j int) { z[i], z[j] = z[j], z[i] } - -func (z ZLabelSets) Less(i, j int) bool { - l := 0 - r := 0 - var result int - lenI, lenJ := len(z[i].Labels), len(z[j].Labels) - for l < lenI && r < lenJ { - result = z[i].Labels[l].Compare(z[j].Labels[r]) - if result == 0 { - l++ - r++ - continue - } - return result < 0 - } - - return l == lenI -} diff --git a/pkg/store/labelpb/label_test.go b/pkg/store/labelpb/label_test.go index 4987e8f5faf..e9506fb1ce9 100644 --- a/pkg/store/labelpb/label_test.go +++ b/pkg/store/labelpb/label_test.go @@ -6,45 +6,138 @@ package labelpb import ( "fmt" "io" + "strings" "testing" - "github.com/prometheus/prometheus/model/labels" - "github.com/efficientgo/core/testutil" + "github.com/prometheus/prometheus/model/labels" + "github.com/stretchr/testify/require" + thanostestutil "github.com/thanos-io/thanos/pkg/testutil" ) func TestExtendLabels(t *testing.T) { - testutil.Equals(t, - labels.FromStrings("a", "1", "replica", "01", "xb", "2"), + thanostestutil.ProtoEquals(t, + FromStrings("a", "1", "replica", "01", "xb", "2"), ExtendSortedLabels( - labels.FromStrings("a", "1", "xb", "2"), - labels.FromStrings("replica", "01"), + FromStrings("a", "1", "xb", "2"), + FromStrings("replica", "01"), )) - testutil.Equals(t, - labels.FromStrings("replica", "01"), + thanostestutil.ProtoEquals(t, + FromStrings("replica", "01"), ExtendSortedLabels( - labels.EmptyLabels(), - labels.FromStrings("replica", "01"), + EmptyLabels(), + FromStrings("replica", "01"), )) - testutil.Equals(t, labels.FromStrings("a", "1", "replica", "01", "xb", "2"), + thanostestutil.ProtoEquals(t, FromStrings("a", "1", "replica", "01", "xb", "2"), ExtendSortedLabels( - labels.FromStrings("a", "1", "replica", "NOT01", "xb", "2"), - labels.FromStrings("replica", "01"), + FromStrings("a", "1", "replica", "NOT01", "xb", "2"), + FromStrings("replica", "01"), )) testInjectExtLabels(testutil.NewTB(t)) } +func TestHashMatchesPrometheus(t *testing.T) { + cases := [][]string{ + {"__name__", "test"}, + {"a", "1", "b", "2"}, + {"__name__", "http_requests_total", "method", "GET", "status", "200"}, + {}, // empty + } + + for _, ss := range cases { + pb := FromStrings(ss...) + prom := labels.FromStrings(ss...) + testutil.Equals(t, prom.Hash(), pb.Hash(), + "hash mismatch for labels %v", ss) + } + + // Large label set that exceeds the 1024-byte fast path. + var large []string + for i := 0; i < 100; i++ { + large = append(large, fmt.Sprintf("key_%03d", i), strings.Repeat("v", 20)) + } + pb := FromStrings(large...) + prom := labels.FromStrings(large...) + testutil.Equals(t, prom.Hash(), pb.Hash(), "hash mismatch for large label set") +} + +func TestRmLabels(t *testing.T) { + thanostestutil.ProtoEquals(t, + FromStrings("a", "1", "c", "3"), + RmLabels( + FromStrings("a", "1", "b", "2", "c", "3"), + map[string]struct{}{"b": {}}, + )) + + thanostestutil.ProtoEquals(t, + FromStrings("a", "1", "c", "3"), + RmLabels( + FromStrings("a", "1", "b", "2", "c", "3"), + map[string]struct{}{"b": {}, "d": {}}, + )) + + // Removing all labels. + thanostestutil.ProtoEquals(t, + Labels(nil), + RmLabels( + FromStrings("a", "1"), + map[string]struct{}{"a": {}}, + )) + + // Empty remove set returns a copy. + orig := FromStrings("a", "1", "b", "2") + result := RmLabels(orig, nil) + thanostestutil.ProtoEquals(t, orig, result) + testutil.Assert(t, &orig[0] != &result[0], "RmLabels should return a copy") + + // Empty input. + thanostestutil.ProtoEquals(t, + Labels(nil), + RmLabels(nil, map[string]struct{}{"a": {}}), + ) +} + +func TestRmLabelsInPlace(t *testing.T) { + // Basic removal. + lset := FromStrings("a", "1", "b", "2", "c", "3") + result := RmLabelsInPlace(lset, map[string]struct{}{"b": {}}) + thanostestutil.ProtoEquals(t, FromStrings("a", "1", "c", "3"), result) + + // Verify it reuses the same backing array. + testutil.Assert(t, &lset[0] == &result[0], "RmLabelsInPlace should reuse the backing array") + + // Remove multiple, including one not present. + lset = FromStrings("a", "1", "b", "2", "c", "3") + result = RmLabelsInPlace(lset, map[string]struct{}{"a": {}, "c": {}, "z": {}}) + thanostestutil.ProtoEquals(t, FromStrings("b", "2"), result) + + // Empty remove set returns the same slice unchanged. + lset = FromStrings("a", "1") + result = RmLabelsInPlace(lset, nil) + thanostestutil.ProtoEquals(t, FromStrings("a", "1"), result) + testutil.Assert(t, &lset[0] == &result[0], "empty remove should return same slice") + + // Remove all. + lset = FromStrings("a", "1") + result = RmLabelsInPlace(lset, map[string]struct{}{"a": {}}) + testutil.Equals(t, 0, len(result)) + + // Nil input. + result = RmLabelsInPlace(nil, map[string]struct{}{"a": {}}) + testutil.Equals(t, 0, len(result)) +} + func BenchmarkExtendLabels(b *testing.B) { testInjectExtLabels(testutil.NewTB(b)) } -var x labels.Labels +var x Labels func testInjectExtLabels(tb testutil.TB) { - in := labels.FromStrings( + in := FromStrings( "__name__", "subscription_labels", "_id", "0dfsdfsdsfdsffd1e96-4432-9abe-e33436ea969a", "account", "1afsdfsddsfsdfsdfsdfsdfs", @@ -62,19 +155,19 @@ func testInjectExtLabels(tb testutil.TB) { "prometheus_replica", "prometheus-telemeter-1", "risk", "5", "service", "sdd-acct-mngr-metrics", - "support", "Self-Support", // Should be overwritten. + "support", "Self-Support", + ) + extLset := FromStrings( + "replica", "1", + "support", "Host-Support", + "tenant", "2342", ) - extLset := labels.FromMap(map[string]string{ - "replica": "1", - "support": "Host-Support", - "tenant": "2342", - }) tb.ResetTimer() for i := 0; i < tb.N(); i++ { x = ExtendSortedLabels(in, extLset) if !tb.IsBenchmark() { - testutil.Equals(tb, labels.FromStrings( + thanostestutil.ProtoEquals(tb, FromStrings( "__name__", "subscription_labels", "_id", "0dfsdfsdsfdsffd1e96-4432-9abe-e33436ea969a", "account", "1afsdfsddsfsdfsdfsdfsdfs", @@ -100,3 +193,69 @@ func testInjectExtLabels(tb testutil.TB) { } fmt.Fprint(io.Discard, x) } + +func TestHashWithoutLabels(t *testing.T) { + tests := []struct { + name string + ls Labels + names []string + }{ + { + name: "empty", + ls: Labels{}, + names: nil, + }, + { + name: "no exclusions", + ls: FromStrings("a", "1", "b", "2"), + names: nil, + }, + { + name: "exclude one", + ls: FromStrings("a", "1", "b", "2", "c", "3"), + names: []string{"b"}, + }, + { + name: "exclude metric name", + ls: FromStrings("__name__", "metric", "a", "1"), + names: nil, + }, + { + name: "exclude all", + ls: FromStrings("__name__", "metric", "a", "1"), + names: []string{"a"}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + promLbls := ToPromLabels(tt.ls) + wantHash, _ := promLbls.HashWithoutLabels(nil, tt.names...) + gotHash, _ := tt.ls.HashWithoutLabels(nil, tt.names...) + require.Equal(t, wantHash, gotHash, "hash mismatch for %v excluding %v", tt.ls, tt.names) + }) + } +} + +func TestHashDeterministic(t *testing.T) { + cases := [][]string{ + {"__name__", "test"}, + {"a", "1", "b", "2"}, + {"__name__", "http_requests_total", "method", "GET", "status", "200"}, + {}, // empty + } + + for _, ss := range cases { + pb := FromStrings(ss...) + // Same input must always produce the same hash. + testutil.Equals(t, pb.Hash(), pb.Hash(), + "hash must be deterministic for labels %v", ss) + } + + // Large label set that exceeds the 1024-byte fast path. + var large []string + for i := 0; i < 100; i++ { + large = append(large, fmt.Sprintf("key_%03d", i), strings.Repeat("v", 20)) + } + pb := FromStrings(large...) + testutil.Equals(t, pb.Hash(), pb.Hash(), "hash must be deterministic for large label set") +} diff --git a/pkg/store/labelpb/label_zlabel_test.go b/pkg/store/labelpb/label_zlabel_test.go deleted file mode 100644 index fbe5122e311..00000000000 --- a/pkg/store/labelpb/label_zlabel_test.go +++ /dev/null @@ -1,533 +0,0 @@ -// Copyright (c) The Thanos Authors. -// Licensed under the Apache License 2.0. - -//go:build !stringlabels - -package labelpb - -import ( - "fmt" - "reflect" - "sort" - "strings" - "testing" - - "github.com/prometheus/prometheus/model/labels" - - "github.com/efficientgo/core/testutil" -) - -var testLsetMap = map[string]string{ - "a": "1", - "c": "2", - "d": "dsfsdfsdfsdf123414234", - "124134235423534534ffdasdfsf": "1", - "": "", - "b": "", -} - -func TestLabelsToPromLabels_LabelsToPromLabels(t *testing.T) { - testutil.Equals(t, labels.FromMap(testLsetMap), ZLabelsToPromLabels(ZLabelsFromPromLabels(labels.FromMap(testLsetMap)))) - - lset := labels.FromMap(testLsetMap) - zlset := ZLabelsFromPromLabels(lset) - for i := range zlset { - if zlset[i].Name != "a" { - continue - } - zlset[i].Value += "yolo" - } - - m := lset.Map() - testutil.Equals(t, "1yolo", m["a"]) - - m["a"] = "1" - testutil.Equals(t, testLsetMap, m) -} - -func TestLabelMarshal_Unmarshal(t *testing.T) { - l := ZLabelsFromPromLabels(labels.FromStrings("aaaaaaa", "bbbbb"))[0] - b, err := (&l).Marshal() - testutil.Ok(t, err) - - l2 := &ZLabel{} - testutil.Ok(t, l2.Unmarshal(b)) - testutil.Equals(t, labels.FromStrings("aaaaaaa", "bbbbb"), ZLabelsToPromLabels([]ZLabel{*l2})) -} - -func TestValidateLabels(t *testing.T) { - testCases := []struct { - labelSet []ZLabel - expectedErr error - }{ - { - // No labels at all. - labelSet: []ZLabel{}, - expectedErr: ErrEmptyLabels, - }, - { - // Empty label. - labelSet: []ZLabel{ - { - Name: "foo", - Value: "bar", - }, - { - Name: "", - Value: "baz", - }, - }, - expectedErr: ErrEmptyLabels, - }, - { - // Empty label (first label). - labelSet: []ZLabel{ - { - Name: "", - Value: "bar", - }, - { - Name: "foo", - Value: "baz", - }, - }, - expectedErr: ErrEmptyLabels, - }, - { - // Empty label (empty value). - labelSet: []ZLabel{ - { - Name: "foo", - Value: "bar", - }, - { - Name: "baz", - Value: "", - }, - }, - expectedErr: ErrEmptyLabels, - }, - { - // Out-of-order and duplicate label (out-of-order comes first). - labelSet: []ZLabel{ - { - Name: "foo", - Value: "bar", - }, - { - Name: "test", - Value: "baz", - }, - { - Name: "foo", - Value: "bar", - }, - }, - expectedErr: ErrOutOfOrderLabels, - }, - { - // Out-of-order and duplicate label (out-of-order comes first). - labelSet: []ZLabel{ - { - Name: "__test__", - Value: "baz", - }, - { - Name: "foo", - Value: "bar", - }, - { - Name: "foo", - Value: "bar", - }, - { - Name: "test", - Value: "baz", - }, - }, - expectedErr: ErrDuplicateLabels, - }, - { - // Empty and duplicate label (empty comes first). - labelSet: []ZLabel{ - { - Name: "foo", - Value: "bar", - }, - { - Name: "", - Value: "baz", - }, - { - Name: "foo", - Value: "bar", - }, - }, - expectedErr: ErrEmptyLabels, - }, - { - // Wrong order. - labelSet: []ZLabel{ - { - Name: "a", - Value: "bar", - }, - { - Name: "b", - Value: "baz", - }, - { - Name: "__name__", - Value: "test", - }, - }, - expectedErr: ErrOutOfOrderLabels, - }, - { - // Wrong order and duplicate (wrong order comes first). - labelSet: []ZLabel{ - { - Name: "a", - Value: "bar", - }, - { - Name: "__name__", - Value: "test", - }, - { - Name: "a", - Value: "bar", - }, - }, - expectedErr: ErrOutOfOrderLabels, - }, - { - // All good. - labelSet: []ZLabel{ - { - Name: "__name__", - Value: "test", - }, - { - Name: "a1", - Value: "bar", - }, - { - Name: "a2", - Value: "baz", - }, - }, - expectedErr: nil, - }, - } - - for i, tc := range testCases { - t.Run(fmt.Sprintf("case %d", i+1), func(t *testing.T) { - err := ValidateLabels(tc.labelSet) - testutil.Equals(t, tc.expectedErr, err) - }) - } - -} - -var ( - zdest ZLabel - dest Label -) - -func BenchmarkZLabelsMarshalUnmarshal(b *testing.B) { - const ( - fmtLbl = "%07daaaaaaaaaabbbbbbbbbbccccccccccdddddddddd" - num = 1000000 - ) - - b.Run("Label", func(b *testing.B) { - b.ReportAllocs() - lbls := LabelSet{Labels: make([]Label, 0, num)} - for i := 0; i < num; i++ { - lbls.Labels = append(lbls.Labels, Label{Name: fmt.Sprintf(fmtLbl, i), Value: fmt.Sprintf(fmtLbl, i)}) - } - b.ResetTimer() - - for i := 0; i < b.N; i++ { - data, err := lbls.Marshal() - testutil.Ok(b, err) - - dest = Label{} - testutil.Ok(b, (&dest).Unmarshal(data)) - } - }) - - b.Run("ZLabel", func(b *testing.B) { - b.ReportAllocs() - lbls := ZLabelSet{Labels: make([]ZLabel, 0, num)} - for i := 0; i < num; i++ { - lbls.Labels = append(lbls.Labels, ZLabel{Name: fmt.Sprintf(fmtLbl, i), Value: fmt.Sprintf(fmtLbl, i)}) - } - b.ResetTimer() - - for i := 0; i < b.N; i++ { - data, err := lbls.Marshal() - testutil.Ok(b, err) - - zdest = ZLabel{} - testutil.Ok(b, (&zdest).Unmarshal(data)) - } - }) -} - -func BenchmarkTransformWithAndWithoutCopyWithSingleLabel(b *testing.B) { - benchmarkTransformWithAndWithoutCopy(b, 1) -} - -func BenchmarkTransformWithAndWithoutCopyWith1000Labels(b *testing.B) { - benchmarkTransformWithAndWithoutCopy(b, 1000) -} - -func BenchmarkTransformWithAndWithoutCopyWith100000Labels(b *testing.B) { - benchmarkTransformWithAndWithoutCopy(b, 100000) -} - -var ret labels.Labels - -func benchmarkTransformWithAndWithoutCopy(b *testing.B, num int) { - const fmtLbl = "%07daaaaaaaaaabbbbbbbbbbccccccccccdddddddddd" - - b.Run("ZLabelsToPromLabels", func(b *testing.B) { - b.ReportAllocs() - lbls := make([]ZLabel, num) - for i := 0; i < num; i++ { - lbls[i] = ZLabel{Name: fmt.Sprintf(fmtLbl, i), Value: fmt.Sprintf(fmtLbl, i)} - } - b.ResetTimer() - - for i := 0; i < b.N; i++ { - ret = ZLabelsToPromLabels(lbls) - } - }) - b.Run("ZLabelsToPromLabelsWithRealloc", func(b *testing.B) { - b.ReportAllocs() - lbls := make([]ZLabel, num) - for i := 0; i < num; i++ { - lbls[i] = ZLabel{Name: fmt.Sprintf(fmtLbl, i), Value: fmt.Sprintf(fmtLbl, i)} - } - b.ResetTimer() - - for i := 0; i < b.N; i++ { - ReAllocZLabelsStrings(&lbls, true) - ret = ZLabelsToPromLabels(lbls) - } - }) -} - -func TestSortZLabelSets(t *testing.T) { - expectedResult := ZLabelSets{ - { - Labels: ZLabelsFromPromLabels( - labels.FromMap(map[string]string{ - "__name__": "grpc_client_handled_total", - "cluster": "test", - "grpc_code": "OK", - "grpc_method": "Info", - }), - ), - }, - { - Labels: ZLabelsFromPromLabels( - labels.FromMap(map[string]string{ - "__name__": "grpc_client_handled_total", - "cluster": "test", - "grpc_code": "OK", - "grpc_method": "LabelNames", - }), - ), - }, - { - Labels: ZLabelsFromPromLabels( - labels.FromMap(map[string]string{ - "__name__": "grpc_client_handled_total", - "cluster": "test", - "grpc_code": "OK", - "aa": "1", - "bb": "2", - "cc": "3", - "dd": "4", - "ee": "5", - }), - ), - }, - { - Labels: ZLabelsFromPromLabels( - labels.FromMap(map[string]string{ - "__name__": "grpc_client_handled_total", - "cluster": "test", - "grpc_code": "OK", - "aa": "1", - "bb": "2", - "cc": "3", - "dd": "4", - "ee": "5", - }), - ), - }, - { - Labels: ZLabelsFromPromLabels( - labels.FromMap(map[string]string{ - "__name__": "grpc_server_handled_total", - "cluster": "test", - "grpc_code": "OK", - "grpc_method": "Info", - }), - ), - }, - { - Labels: ZLabelsFromPromLabels( - labels.FromMap(map[string]string{ - "__name__": "up", - "instance": "localhost:10908", - }), - ), - }, - } - - list := ZLabelSets{ - { - Labels: ZLabelsFromPromLabels( - labels.FromMap(map[string]string{ - "__name__": "up", - "instance": "localhost:10908", - }), - ), - }, - { - Labels: ZLabelsFromPromLabels( - labels.FromMap(map[string]string{ - "__name__": "grpc_server_handled_total", - "cluster": "test", - "grpc_code": "OK", - "grpc_method": "Info", - }), - ), - }, - { - Labels: ZLabelsFromPromLabels( - labels.FromMap(map[string]string{ - "__name__": "grpc_client_handled_total", - "cluster": "test", - "grpc_code": "OK", - "grpc_method": "LabelNames", - }), - ), - }, - { - Labels: ZLabelsFromPromLabels( - labels.FromMap(map[string]string{ - "__name__": "grpc_client_handled_total", - "cluster": "test", - "grpc_code": "OK", - "grpc_method": "Info", - }), - ), - }, - { - Labels: ZLabelsFromPromLabels( - labels.FromMap(map[string]string{ - "__name__": "grpc_client_handled_total", - "cluster": "test", - "grpc_code": "OK", - "aa": "1", - "bb": "2", - "cc": "3", - "dd": "4", - "ee": "5", - }), - ), - }, - // This label set is the same as the previous one, which should correctly return 0 in Less() function. - { - Labels: ZLabelsFromPromLabels( - labels.FromMap(map[string]string{ - "cluster": "test", - "__name__": "grpc_client_handled_total", - "grpc_code": "OK", - "aa": "1", - "bb": "2", - "cc": "3", - "dd": "4", - "ee": "5", - }), - ), - }, - } - - sort.Sort(list) - reflect.DeepEqual(expectedResult, list) -} - -func TestHashWithPrefix(t *testing.T) { - lbls := []ZLabel{ - {Name: "foo", Value: "bar"}, - {Name: "baz", Value: "qux"}, - } - testutil.Equals(t, HashWithPrefix("a", lbls), HashWithPrefix("a", lbls)) - testutil.Assert(t, HashWithPrefix("a", lbls) != HashWithPrefix("a", []ZLabel{lbls[0]})) - testutil.Assert(t, HashWithPrefix("a", lbls) != HashWithPrefix("a", []ZLabel{lbls[1], lbls[0]})) - testutil.Assert(t, HashWithPrefix("a", lbls) != HashWithPrefix("b", lbls)) -} - -var benchmarkLabelsResult uint64 - -func BenchmarkHasWithPrefix(b *testing.B) { - for _, tcase := range []struct { - name string - lbls []ZLabel - }{ - { - name: "typical labels under 1KB", - lbls: func() []ZLabel { - lbls := make([]ZLabel, 10) - for i := 0; i < len(lbls); i++ { - // ZLabel ~20B name, 50B value. - lbls[i] = ZLabel{Name: fmt.Sprintf("abcdefghijabcdefghijabcdefghij%d", i), Value: fmt.Sprintf("abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij%d", i)} - } - return lbls - }(), - }, - { - name: "bigger labels over 1KB", - lbls: func() []ZLabel { - lbls := make([]ZLabel, 10) - for i := 0; i < len(lbls); i++ { - //ZLabel ~50B name, 50B value. - lbls[i] = ZLabel{Name: fmt.Sprintf("abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij%d", i), Value: fmt.Sprintf("abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij%d", i)} - } - return lbls - }(), - }, - { - name: "extremely large label value 10MB", - lbls: func() []ZLabel { - lbl := &strings.Builder{} - lbl.Grow(1024 * 1024 * 10) // 10MB. - word := "abcdefghij" - for i := 0; i < lbl.Cap()/len(word); i++ { - _, _ = lbl.WriteString(word) - } - return []ZLabel{{Name: "__name__", Value: lbl.String()}} - }(), - }, - } { - b.Run(tcase.name, func(b *testing.B) { - var h uint64 - - const prefix = "test-" - - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - h = HashWithPrefix(prefix, tcase.lbls) - } - benchmarkLabelsResult = h - }) - } -} diff --git a/pkg/store/labelpb/labels.go b/pkg/store/labelpb/labels.go new file mode 100644 index 00000000000..b6025f3f605 --- /dev/null +++ b/pkg/store/labelpb/labels.go @@ -0,0 +1,520 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Labels provides a sorted label set type built on []*Label (proto-generated pointers). +// This replaces the role of github.com/prometheus/prometheus/model/labels.Labels +// with a type that embraces pointer semantics and vtproto pooling. + +package labelpb + +import ( + "bytes" + "encoding/json" + "slices" + "sort" + "strconv" + "strings" + + "github.com/cespare/xxhash/v2" + "github.com/pkg/errors" + "github.com/prometheus/common/model" + "github.com/prometheus/prometheus/model/labels" +) + +const ( + MetricName = "__name__" + labelSep = '\xff' +) + +var labelSeps = []byte{labelSep} + +// Labels is a sorted set of labels. Order has to be guaranteed upon +// instantiation. It is a slice of proto-generated *Label pointers, +// making it compatible with protobuf message fields and vtproto pooling. +type Labels []*Label + +// sort.Interface implementation. + +func (ls Labels) Len() int { return len(ls) } +func (ls Labels) Swap(i, j int) { ls[i], ls[j] = ls[j], ls[i] } +func (ls Labels) Less(i, j int) bool { return ls[i].Name < ls[j].Name } + +// Compare compares two individual labels by name, then value. +func (m *Label) Compare(other *Label) int { + if c := strings.Compare(m.Name, other.Name); c != 0 { + return c + } + return strings.Compare(m.Value, other.Value) +} + +// Hash returns a hash value for the label set. +// Uses the same xxhash algorithm as Prometheus for compatibility. +// The encoding varies by build tag to match Prometheus (see labels_hash*.go). +func (ls Labels) Hash() uint64 { return Hash(ls) } + +// HashWithoutLabels returns a hash value for all labels except those matching +// the provided names. __name__ is always excluded. +// 'names' must be sorted in ascending order. +func HashWithoutLabels(ls []*Label, b []byte, names ...string) (uint64, []byte) { + b = b[:0] + j := 0 + for _, l := range ls { + for j < len(names) && names[j] < l.Name { + j++ + } + if l.Name == MetricName || (j < len(names) && l.Name == names[j]) { + continue + } + b = append(b, l.Name...) + b = append(b, labelSep) + b = append(b, l.Value...) + b = append(b, labelSep) + } + return xxhash.Sum64(b), b +} + +// HashWithoutLabels calls the free function HashWithoutLabels. +func (ls Labels) HashWithoutLabels(b []byte, names ...string) (uint64, []byte) { + return HashWithoutLabels(ls, b, names...) +} + +// Copy returns a copy of the label set. The underlying *Label pointers +// are shared (shallow copy of the slice). +func (ls Labels) Copy() Labels { + res := make(Labels, len(ls)) + copy(res, ls) + return res +} + +// DeepCopy returns a new Labels where each *Label is cloned via CloneVT. +// String references are shared (not byte-copied), which preserves vtproto +// string interning from unmarshal. Use this when you need an independent +// label set whose individual *Label pointers won't alias the originals. +func (ls Labels) DeepCopy() Labels { + if ls == nil { + return nil + } + res := make(Labels, len(ls)) + for i, l := range ls { + res[i] = l.CloneVT() + } + return res +} + +// FindValue returns the value for the label with the given name +// in a []*Label without requiring a type cast. +// Returns an empty string if the label doesn't exist. +func FindValue(ls []*Label, name string) string { + for _, l := range ls { + if l.Name == name { + return l.Value + } + } + return "" +} + +// Get calls the free function FindValue. +func (ls Labels) Get(name string) string { + return FindValue(ls, name) +} + +// Has returns true if the label with the given name is present. +func (ls Labels) Has(name string) bool { + for _, l := range ls { + if l.Name == name { + return true + } + } + return false +} + +// Equal returns whether two label sets are equal. +func Equal(a, b Labels) bool { + if len(a) != len(b) { + return false + } + for i, l := range a { + if l.Name != b[i].Name || l.Value != b[i].Value { + return false + } + } + return true +} + +// EmptyLabels returns an empty Labels value. +// deprecated: this is an unnecessary indirection and is not idiomatic go; use nil instead. +func EmptyLabels() Labels { + return Labels{} +} + +// NewLabels returns a sorted Labels from the given label pointers. +// The caller must guarantee that all label names are unique. +func NewLabels(ls ...*Label) Labels { + set := make(Labels, len(ls)) + copy(set, ls) + sort.Sort(set) + return set +} + +// FromStrings creates new sorted Labels from pairs of strings. +// Panics if an odd number of strings is provided. +func FromStrings(ss ...string) Labels { + if len(ss)%2 != 0 { + panic("invalid number of strings") + } + res := make(Labels, 0, len(ss)/2) + for i := 0; i < len(ss); i += 2 { + res = append(res, &Label{Name: ss[i], Value: ss[i+1]}) + } + slices.SortFunc(res, func(a, b *Label) int { return strings.Compare(a.Name, b.Name) }) + return res +} + +// Compare compares two label sets lexicographically. +// Returns 0 if a==b, <0 if a < b, and >0 if a > b. +func Compare(a, b []*Label) int { + l := len(a) + if len(b) < l { + l = len(b) + } + for i := 0; i < l; i++ { + if c := a[i].Compare(b[i]); c != 0 { + return c + } + } + return len(a) - len(b) +} + +// IsEmpty returns true if the label set has no labels. +func (ls Labels) IsEmpty() bool { + return len(ls) == 0 +} + +// Range calls f on each label. +func (ls Labels) Range(f func(l *Label)) { + for _, l := range ls { + f(l) + } +} + +// Validate calls f on each label. If f returns a non-nil error, that +// error is returned immediately, canceling the iteration. +func (ls Labels) Validate(f func(l *Label) error) error { + for _, l := range ls { + if err := f(l); err != nil { + return err + } + } + return nil +} + +// DropMetricName returns Labels with the __name__ label removed. +func (ls Labels) DropMetricName() Labels { + for i, l := range ls { + if l.Name == MetricName { + if i == 0 { + return ls[1:] + } + return append(ls[:i:i], ls[i+1:]...) + } + } + return ls +} + +// ToPromLabels converts a slice of *Label to prometheus/model/labels.Labels. +// This must ONLY be used at the boundary of Prometheus PromQL or Prometheus TSDB. +func ToPromLabels(ls []*Label) labels.Labels { + b := labels.NewScratchBuilder(len(ls)) + for _, l := range ls { + b.Add(l.Name, l.Value) + } + b.Sort() + return b.Labels() +} + +// PromLabels converts a LabelSet to prometheus/model/labels.Labels. +// Nil-safe: returns empty labels for a nil receiver. +// This must ONLY be used at the boundary of Prometheus PromQL or Prometheus TSDB. +func (m *LabelSet) PromLabels() labels.Labels { + return ToPromLabels(m.GetLabels()) +} + +// FromPromLabels converts prometheus/model/labels.Labels to labelpb.Labels. +// This must ONLY be used at the boundary of Prometheus PromQL or Prometheus TSDB. +func FromPromLabels(ls labels.Labels) Labels { + result := make(Labels, 0, ls.Len()) + ls.Range(func(l labels.Label) { + result = append(result, &Label{Name: l.Name, Value: l.Value}) + }) + return result +} + +// String returns the label set in the form {name="value", ...}. +func (ls Labels) String() string { + var bytea [1024]byte // On stack to avoid memory allocation while building the output. + b := bytes.NewBuffer(bytea[:0]) + + b.WriteByte('{') + for i, l := range ls { + if i > 0 { + b.WriteString(", ") + } + b.WriteString(l.Name) + b.WriteByte('=') + b.Write(strconv.AppendQuote(b.AvailableBuffer(), l.Value)) + } + b.WriteByte('}') + return b.String() +} + +// MarshalJSON implements json.Marshaler. Encodes as a JSON object +// mapping label names to values: {"name":"value",...}. +func (ls Labels) MarshalJSON() ([]byte, error) { + return json.Marshal(ls.Map()) +} + +// UnmarshalJSON implements json.Unmarshaler. Expects a JSON object +// mapping label names to values: {"name":"value",...}. +func (ls *Labels) UnmarshalJSON(b []byte) error { + var m map[string]string + if err := json.Unmarshal(b, &m); err != nil { + return err + } + *ls = FromMap(m) + return nil +} + +// MarshalJSON implements json.Marshaler for LabelSet. +// Encodes the labels as a flat JSON object {"name":"value",...} for +// backward compatibility with the Prometheus API JSON format. +func (ls *LabelSet) MarshalJSON() ([]byte, error) { + return Labels(ls.GetLabels()).MarshalJSON() +} + +// UnmarshalJSON implements json.Unmarshaler for LabelSet. +// Expects a flat JSON object {"name":"value",...}. +func (ls *LabelSet) UnmarshalJSON(b []byte) error { + if string(b) == "null" { + return nil + } + var parsed Labels + if err := parsed.UnmarshalJSON(b); err != nil { + return err + } + ls.Labels = parsed + return nil +} + +// MarshalYAML implements yaml.Marshaler. +func (ls Labels) MarshalYAML() (interface{}, error) { + return ls.Map(), nil +} + +// UnmarshalYAML implements yaml.Unmarshaler. +func (ls *Labels) UnmarshalYAML(unmarshal func(interface{}) error) error { + var m map[string]string + if err := unmarshal(&m); err != nil { + return err + } + *ls = FromMap(m) + return nil +} + +// IsValid checks if the metric name or label names are valid. +func (ls Labels) IsValid(validationScheme model.ValidationScheme) bool { + err := ls.Validate(func(l *Label) error { + if l.Name == model.MetricNameLabel { + if validationScheme == model.LegacyValidation && model.NameValidationScheme == model.UTF8Validation && !model.IsValidLegacyMetricName(string(model.LabelValue(l.Value))) { + return strconv.ErrSyntax + } + if !model.IsValidMetricName(model.LabelValue(l.Value)) { + return strconv.ErrSyntax + } + } + if validationScheme == model.LegacyValidation && model.NameValidationScheme == model.UTF8Validation { + if !model.LabelName(l.Name).IsValidLegacy() || !model.LabelValue(l.Value).IsValid() { + return strconv.ErrSyntax + } + } else if !model.LabelName(l.Name).IsValid() || !model.LabelValue(l.Value).IsValid() { + return strconv.ErrSyntax + } + return nil + }) + return err == nil +} + +// Map returns a string map of the labels. +func (ls Labels) Map() map[string]string { + m := make(map[string]string, len(ls)) + ls.Range(func(l *Label) { + m[l.Name] = l.Value + }) + return m +} + +// FromMap returns new sorted Labels from the given map. +func FromMap(m map[string]string) Labels { + res := make(Labels, 0, len(m)) + for k, v := range m { + res = append(res, &Label{Name: k, Value: v}) + } + slices.SortFunc(res, func(a, b *Label) int { return strings.Compare(a.Name, b.Name) }) + return res +} + +// LabelSetFromStrings creates a *LabelSet from key-value string pairs. +func LabelSetFromStrings(ss ...string) *LabelSet { + return &LabelSet{Labels: FromStrings(ss...)} +} + +var ( + ErrOutOfOrderLabels = errors.New("out of order labels") + ErrEmptyLabels = errors.New("label set contains a label with empty name or value") + ErrDuplicateLabels = errors.New("label set contains duplicate label names") +) + +// ExtendSortedLabels returns a new label set that is the result of merging two sorted label sets. +// Labels in 'extend' override labels with the same name in 'lset'. Both inputs must be sorted. +func ExtendSortedLabels(lset, extend Labels) Labels { + if extend.IsEmpty() { + return lset.Copy() + } + if lset.IsEmpty() { + return extend.Copy() + } + + res := make(Labels, 0, len(lset)+len(extend)) + i, j := 0, 0 + for i < len(lset) && j < len(extend) { + switch strings.Compare(lset[i].Name, extend[j].Name) { + case -1: + res = append(res, lset[i]) + i++ + case 0: + res = append(res, extend[j]) + i++ + j++ + case 1: + res = append(res, extend[j]) + j++ + } + } + res = append(res, lset[i:]...) + res = append(res, extend[j:]...) + return res +} + +// RmLabels returns a new Labels slice without the labels that are in the remove set. +// The input slice is never modified. +// Use when the caller still needs the original slice (e.g. a struct field +// or a variable referenced later). +func RmLabels(lset Labels, remove map[string]struct{}) Labels { + if len(remove) == 0 { + return lset.Copy() + } + res := make(Labels, 0, len(lset)) + for _, l := range lset { + if _, ok := remove[l.Name]; !ok { + res = append(res, l) + } + } + return res +} + +// RmLabelsInPlace filters lset in place, removing labels that are in the remove set. +// in the remove set. It reuses the underlying array and returns the +// shortened slice. The caller must not use the original slice header after +// this call — always reassign: lset = RmLabelsInPlace(lset, remove). +func RmLabelsInPlace(lset Labels, remove map[string]struct{}) Labels { + if len(remove) == 0 { + return lset + } + n := 0 + for _, l := range lset { + if _, ok := remove[l.Name]; !ok { + lset[n] = l + n++ + } + } + // Nil out the tail so removed *Label pointers can be GC'd. + clear(lset[n:]) + return lset[:n] +} + +func LabelSetsToString(lsets []Labels) string { + return LabelSetsToStringN(lsets, 200) +} + +func LabelSetsToStringN(lsets []Labels, maxLength int) string { + if len(lsets) == 0 { + return "" + } + s := []string{} + for _, ls := range lsets { + str := ls.String() + s = append(s, str) + maxLength -= len(str) + if maxLength <= 0 { + break + } + } + sort.Strings(s) + return strings.Join(s, ",") +} + +// HashWithPrefix returns a hash for the given prefix and labels. +func HashWithPrefix(prefix string, lbls Labels) uint64 { + b := make([]byte, 0, 1024) + b = append(b, prefix...) + b = append(b, labelSep) + + for i, v := range lbls { + if len(b)+len(v.Name)+len(v.Value)+2 >= cap(b) { + h := xxhash.New() + _, _ = h.Write(b) + for _, v := range lbls[i:] { + _, _ = h.WriteString(v.Name) + _, _ = h.Write(labelSeps) + _, _ = h.WriteString(v.Value) + _, _ = h.Write(labelSeps) + } + return h.Sum64() + } + b = append(b, v.Name...) + b = append(b, labelSep) + b = append(b, v.Value...) + b = append(b, labelSep) + } + return xxhash.Sum64(b) +} + +// ValidateLabels validates label names and values (checks for empty +// names and values, out of order labels and duplicate label names). +// Returns appropriate error if validation fails on a label. +func ValidateLabels(lbls Labels) error { + if len(lbls) == 0 { + return ErrEmptyLabels + } + + l0 := lbls[0] + if l0.Name == "" || l0.Value == "" { + return ErrEmptyLabels + } + + for _, l := range lbls[1:] { + if l.Name == "" || l.Value == "" { + return ErrEmptyLabels + } + + if l.Name == l0.Name { + return ErrDuplicateLabels + } + + if l.Name < l0.Name { + return ErrOutOfOrderLabels + } + l0 = l + } + + return nil +} diff --git a/pkg/store/labelpb/labels_hash.go b/pkg/store/labelpb/labels_hash.go new file mode 100644 index 00000000000..b00dd089fe8 --- /dev/null +++ b/pkg/store/labelpb/labels_hash.go @@ -0,0 +1,36 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +//go:build !stringlabels + +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +package labelpb + +import "github.com/cespare/xxhash/v2" + +// Hash computes a hash of the label set using the same encoding as +// Prometheus's default (non-stringlabels) labels.Hash(): +// name + \xff + value + \xff for each label. +func Hash(ls []*Label) uint64 { + b := make([]byte, 0, 1024) + for i, v := range ls { + if len(b)+len(v.Name)+len(v.Value)+2 >= cap(b) { + h := xxhash.New() + _, _ = h.Write(b) + for _, v := range ls[i:] { + _, _ = h.WriteString(v.Name) + _, _ = h.Write(labelSeps) + _, _ = h.WriteString(v.Value) + _, _ = h.Write(labelSeps) + } + return h.Sum64() + } + b = append(b, v.Name...) + b = append(b, labelSep) + b = append(b, v.Value...) + b = append(b, labelSep) + } + return xxhash.Sum64(b) +} diff --git a/pkg/store/labelpb/labels_hash_stringlabels.go b/pkg/store/labelpb/labels_hash_stringlabels.go new file mode 100644 index 00000000000..140bf87733e --- /dev/null +++ b/pkg/store/labelpb/labels_hash_stringlabels.go @@ -0,0 +1,54 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +//go:build stringlabels + +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +package labelpb + +import ( + "encoding/binary" + + "github.com/cespare/xxhash/v2" +) + +// Hash computes a hash of the label set using the same encoding as +// Prometheus's stringlabels labels.Hash(): each label name and value +// is preceded by its length as a varint, producing the same byte +// sequence that Prometheus stores internally. +func Hash(ls []*Label) uint64 { + b := make([]byte, 0, 1024) + for i, v := range ls { + needed := sizeVarint(len(v.Name)) + len(v.Name) + + sizeVarint(len(v.Value)) + len(v.Value) + if len(b)+needed > cap(b) { + h := xxhash.New() + _, _ = h.Write(b) + var vbuf [binary.MaxVarintLen64]byte + for _, v := range ls[i:] { + n := binary.PutUvarint(vbuf[:], uint64(len(v.Name))) + _, _ = h.Write(vbuf[:n]) + _, _ = h.WriteString(v.Name) + n = binary.PutUvarint(vbuf[:], uint64(len(v.Value))) + _, _ = h.Write(vbuf[:n]) + _, _ = h.WriteString(v.Value) + } + return h.Sum64() + } + b = binary.AppendUvarint(b, uint64(len(v.Name))) + b = append(b, v.Name...) + b = binary.AppendUvarint(b, uint64(len(v.Value))) + b = append(b, v.Value...) + } + return xxhash.Sum64(b) +} + +func sizeVarint(x int) int { + n := 1 + for u := uint64(x); u >= 0x80; u >>= 7 { + n++ + } + return n +} diff --git a/pkg/store/labelpb/types.pb.go b/pkg/store/labelpb/types.pb.go index 3dd6d97299c..1b9768a8e56 100644 --- a/pkg/store/labelpb/types.pb.go +++ b/pkg/store/labelpb/types.pb.go @@ -1,705 +1,201 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.20.1 // source: store/labelpb/types.proto package labelpb import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" + reflect "reflect" + sync "sync" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/planetscale/vtprotobuf/vtproto" + _ "github.com/srikrsna/protoc-gen-gotag/tagger" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type Label struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } -func (m *Label) Reset() { *m = Label{} } -func (m *Label) String() string { return proto.CompactTextString(m) } -func (*Label) ProtoMessage() {} -func (*Label) Descriptor() ([]byte, []int) { - return fileDescriptor_cdcc9e7dae4870e8, []int{0} -} -func (m *Label) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Label) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Label.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Label) XXX_Merge(src proto.Message) { - xxx_messageInfo_Label.Merge(m, src) -} -func (m *Label) XXX_Size() int { - return m.Size() -} -func (m *Label) XXX_DiscardUnknown() { - xxx_messageInfo_Label.DiscardUnknown(m) -} - -var xxx_messageInfo_Label proto.InternalMessageInfo - -type LabelSet struct { - Labels []Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` +func (x *Label) Reset() { + *x = Label{} + mi := &file_store_labelpb_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *LabelSet) Reset() { *m = LabelSet{} } -func (m *LabelSet) String() string { return proto.CompactTextString(m) } -func (*LabelSet) ProtoMessage() {} -func (*LabelSet) Descriptor() ([]byte, []int) { - return fileDescriptor_cdcc9e7dae4870e8, []int{1} -} -func (m *LabelSet) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelSet.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LabelSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelSet.Merge(m, src) -} -func (m *LabelSet) XXX_Size() int { - return m.Size() -} -func (m *LabelSet) XXX_DiscardUnknown() { - xxx_messageInfo_LabelSet.DiscardUnknown(m) +func (x *Label) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_LabelSet proto.InternalMessageInfo +func (*Label) ProtoMessage() {} -type ZLabelSet struct { - Labels []ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=ZLabel" json:"labels"` -} - -func (m *ZLabelSet) Reset() { *m = ZLabelSet{} } -func (m *ZLabelSet) String() string { return proto.CompactTextString(m) } -func (*ZLabelSet) ProtoMessage() {} -func (*ZLabelSet) Descriptor() ([]byte, []int) { - return fileDescriptor_cdcc9e7dae4870e8, []int{2} -} -func (m *ZLabelSet) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ZLabelSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ZLabelSet.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *Label) ProtoReflect() protoreflect.Message { + mi := &file_store_labelpb_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *ZLabelSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_ZLabelSet.Merge(m, src) -} -func (m *ZLabelSet) XXX_Size() int { - return m.Size() -} -func (m *ZLabelSet) XXX_DiscardUnknown() { - xxx_messageInfo_ZLabelSet.DiscardUnknown(m) -} - -var xxx_messageInfo_ZLabelSet proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Label)(nil), "thanos.Label") - proto.RegisterType((*LabelSet)(nil), "thanos.LabelSet") - proto.RegisterType((*ZLabelSet)(nil), "thanos.ZLabelSet") -} - -func init() { proto.RegisterFile("store/labelpb/types.proto", fileDescriptor_cdcc9e7dae4870e8) } -var fileDescriptor_cdcc9e7dae4870e8 = []byte{ - // 212 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2c, 0x2e, 0xc9, 0x2f, - 0x4a, 0xd5, 0xcf, 0x49, 0x4c, 0x4a, 0xcd, 0x29, 0x48, 0xd2, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2b, 0xc9, 0x48, 0xcc, 0xcb, 0x2f, 0x96, 0x12, 0x49, - 0xcf, 0x4f, 0xcf, 0x07, 0x0b, 0xe9, 0x83, 0x58, 0x10, 0x59, 0x25, 0x43, 0x2e, 0x56, 0x1f, 0x90, - 0x26, 0x21, 0x21, 0x2e, 0x96, 0xbc, 0xc4, 0xdc, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, - 0x30, 0x5b, 0x48, 0x84, 0x8b, 0xb5, 0x2c, 0x31, 0xa7, 0x34, 0x55, 0x82, 0x09, 0x2c, 0x08, 0xe1, - 0x28, 0x99, 0x73, 0x71, 0x80, 0xb5, 0x04, 0xa7, 0x96, 0x08, 0x69, 0x73, 0xb1, 0x81, 0xed, 0x2c, - 0x96, 0x60, 0x54, 0x60, 0xd6, 0xe0, 0x36, 0xe2, 0xd5, 0x83, 0xd8, 0xa6, 0x07, 0x56, 0xe1, 0xc4, - 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x54, 0x89, 0x92, 0x13, 0x17, 0x67, 0x14, 0x5c, 0xa7, 0x29, - 0x7e, 0x9d, 0x7c, 0x20, 0x9d, 0xb7, 0xee, 0xc9, 0xb3, 0x41, 0x74, 0xc0, 0xcc, 0x70, 0x52, 0x3d, - 0xf1, 0x50, 0x8e, 0xe1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, - 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xd8, 0xa1, - 0x01, 0x90, 0xc4, 0x06, 0xf6, 0x9d, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x80, 0xe8, 0x16, - 0x18, 0x01, 0x00, 0x00, -} - -func (m *Label) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Label) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Label) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +// Deprecated: Use Label.ProtoReflect.Descriptor instead. +func (*Label) Descriptor() ([]byte, []int) { + return file_store_labelpb_types_proto_rawDescGZIP(), []int{0} } -func (m *LabelSet) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *Label) GetName() string { + if x != nil { + return x.Name } - return dAtA[:n], nil -} - -func (m *LabelSet) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return "" } -func (m *LabelSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } +func (x *Label) GetValue() string { + if x != nil { + return x.Value } - return len(dAtA) - i, nil + return "" } -func (m *ZLabelSet) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} +type LabelSet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ZLabelSet) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + Labels []*Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` } -func (m *ZLabelSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil +func (x *LabelSet) Reset() { + *x = LabelSet{} + mi := &file_store_labelpb_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Label) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n +func (x *LabelSet) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *LabelSet) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} +func (*LabelSet) ProtoMessage() {} -func (m *ZLabelSet) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) +func (x *LabelSet) ProtoReflect() protoreflect.Message { + mi := &file_store_labelpb_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 + return mi.MessageOf(x) } -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Label) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Label: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Label: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +// Deprecated: Use LabelSet.ProtoReflect.Descriptor instead. +func (*LabelSet) Descriptor() ([]byte, []int) { + return file_store_labelpb_types_proto_rawDescGZIP(), []int{1} } -func (m *LabelSet) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LabelSet: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelSet: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, Label{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *LabelSet) GetLabels() []*Label { + if x != nil { + return x.Labels } return nil } -func (m *ZLabelSet) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ZLabelSet: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ZLabelSet: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, ZLabel{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF +var File_store_labelpb_types_proto protoreflect.FileDescriptor + +var file_store_labelpb_types_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x70, 0x62, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x74, 0x68, 0x61, + 0x6e, 0x6f, 0x73, 0x1a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x76, 0x74, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, + 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, + 0x2f, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x47, 0x0a, + 0x05, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xb2, 0xa9, 0x1f, 0x02, 0x08, 0x01, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x06, 0xb2, 0xa9, 0x1f, 0x02, 0x08, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x04, 0xa8, 0xa6, 0x1f, 0x01, 0x22, 0x4b, 0x0a, 0x08, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, + 0x65, 0x74, 0x12, 0x39, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x42, 0x12, 0x9a, 0x84, 0x9e, 0x03, 0x0d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x22, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x3a, 0x04, 0xa8, + 0xa6, 0x1f, 0x01, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x74, 0x68, 0x61, 0x6e, + 0x6f, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x6c, 0x61, 0x62, + 0x65, 0x6c, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") + file_store_labelpb_types_proto_rawDescOnce sync.Once + file_store_labelpb_types_proto_rawDescData = file_store_labelpb_types_proto_rawDesc ) + +func file_store_labelpb_types_proto_rawDescGZIP() []byte { + file_store_labelpb_types_proto_rawDescOnce.Do(func() { + file_store_labelpb_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_labelpb_types_proto_rawDescData) + }) + return file_store_labelpb_types_proto_rawDescData +} + +var file_store_labelpb_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_store_labelpb_types_proto_goTypes = []any{ + (*Label)(nil), // 0: thanos.Label + (*LabelSet)(nil), // 1: thanos.LabelSet +} +var file_store_labelpb_types_proto_depIdxs = []int32{ + 0, // 0: thanos.LabelSet.labels:type_name -> thanos.Label + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_store_labelpb_types_proto_init() } +func file_store_labelpb_types_proto_init() { + if File_store_labelpb_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_store_labelpb_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_store_labelpb_types_proto_goTypes, + DependencyIndexes: file_store_labelpb_types_proto_depIdxs, + MessageInfos: file_store_labelpb_types_proto_msgTypes, + }.Build() + File_store_labelpb_types_proto = out.File + file_store_labelpb_types_proto_rawDesc = nil + file_store_labelpb_types_proto_goTypes = nil + file_store_labelpb_types_proto_depIdxs = nil +} diff --git a/pkg/store/labelpb/types.proto b/pkg/store/labelpb/types.proto index 65aa195ec12..e180d6105cc 100644 --- a/pkg/store/labelpb/types.proto +++ b/pkg/store/labelpb/types.proto @@ -4,30 +4,20 @@ syntax = "proto3"; package thanos; -option go_package = "labelpb"; +option go_package = "github.com/thanos-io/thanos/pkg/store/labelpb"; -import "gogoproto/gogo.proto"; - -option (gogoproto.sizer_all) = true; -option (gogoproto.marshaler_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; +import "github.com/planetscale/vtprotobuf/vtproto/ext.proto"; +import "tagger/tagger.proto"; message Label { - string name = 1; - string value = 2; -} + option (vtproto.mempool) = true; -message LabelSet { - repeated Label labels = 1 [(gogoproto.nullable) = false]; + string name = 1 [(vtproto.options).unique = true]; + string value = 2 [(vtproto.options).unique = true]; } -message ZLabelSet { - repeated Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "ZLabel"]; +message LabelSet { + option (vtproto.mempool) = true; + + repeated Label labels = 1 [(tagger.tags) = "json:\"labels\""]; } diff --git a/pkg/store/labelpb/types_vtproto.pb.go b/pkg/store/labelpb/types_vtproto.pb.go new file mode 100644 index 00000000000..8f7df47faed --- /dev/null +++ b/pkg/store/labelpb/types_vtproto.pb.go @@ -0,0 +1,489 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.1-0.20250313105119-ba97887b0a25 +// source: store/labelpb/types.proto + +package labelpb + +import ( + fmt "fmt" + io "io" + sync "sync" + unsafe "unsafe" + + unique "github.com/thanos-io/thanos/pkg/unique" + + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *Label) CloneVT() *Label { + if m == nil { + return (*Label)(nil) + } + r := LabelFromVTPool() + r.Name = m.Name + r.Value = m.Value + return r +} + +func (m *Label) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *LabelSet) CloneVT() *LabelSet { + if m == nil { + return (*LabelSet)(nil) + } + r := LabelSetFromVTPool() + if rhs := m.Labels; rhs != nil { + tmpContainer := make([]*Label, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Labels = tmpContainer + } + return r +} + +func (m *LabelSet) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *Label) EqualVT(that *Label) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Name != that.Name { + return false + } + if this.Value != that.Value { + return false + } + return true +} + +func (this *Label) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Label) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *LabelSet) EqualVT(that *LabelSet) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Labels) != len(that.Labels) { + return false + } + for i, vx := range this.Labels { + vy := that.Labels[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Label{} + } + if q == nil { + q = &Label{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *LabelSet) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*LabelSet) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *Label) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Label) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Label) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LabelSet) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LabelSet) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LabelSet) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Labels) > 0 { + for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Labels[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +var vtprotoPool_Label = sync.Pool{ + New: func() interface{} { + return &Label{} + }, +} + +func (m *Label) ResetVT() { + if m != nil { + m.Reset() + } +} +func (m *Label) ReturnToVTPool() { + if m != nil { + m.ResetVT() + vtprotoPool_Label.Put(m) + } +} +func LabelFromVTPool() *Label { + return vtprotoPool_Label.Get().(*Label) +} + +var vtprotoPool_LabelSet = sync.Pool{ + New: func() interface{} { + return &LabelSet{} + }, +} + +func (m *LabelSet) ResetVT() { + if m != nil { + for _, mm := range m.Labels { + mm.ResetVT() + } + f0 := m.Labels[:0] + m.Reset() + m.Labels = f0 + } +} +func (m *LabelSet) ReturnToVTPool() { + if m != nil { + m.ResetVT() + vtprotoPool_LabelSet.Put(m) + } +} +func LabelSetFromVTPool() *LabelSet { + return vtprotoPool_LabelSet.Get().(*LabelSet) +} +func (m *Label) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *LabelSet) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Labels) > 0 { + for _, e := range m.Labels { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *Label) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Label: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Label: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unique.Make(unsafe.String(&dAtA[iNdEx], intStringLen)).Value() + } + m.Name = stringValue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unique.Make(unsafe.String(&dAtA[iNdEx], intStringLen)).Value() + } + m.Value = stringValue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LabelSet) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LabelSet: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LabelSet: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if len(m.Labels) == cap(m.Labels) { + m.Labels = append(m.Labels, &Label{}) + } else { + m.Labels = m.Labels[:len(m.Labels)+1] + if m.Labels[len(m.Labels)-1] == nil { + m.Labels[len(m.Labels)-1] = &Label{} + } + } + if err := m.Labels[len(m.Labels)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pkg/store/limiter_test.go b/pkg/store/limiter_test.go index b713f0574c3..4a32624d9e4 100644 --- a/pkg/store/limiter_test.go +++ b/pkg/store/limiter_test.go @@ -13,8 +13,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" prom_testutil "github.com/prometheus/client_golang/prometheus/testutil" - "github.com/prometheus/prometheus/model/labels" - + labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" ) @@ -42,9 +41,9 @@ func TestRateLimitedServer(t *testing.T) { numSamples := 60 series := []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("series", "1"), makeSamples(numSamples)), - storeSeriesResponse(t, labels.FromStrings("series", "2"), makeSamples(numSamples)), - storeSeriesResponse(t, labels.FromStrings("series", "3"), makeSamples(numSamples)), + storeSeriesResponse(t, labelpb.FromStrings("series", "1"), makeSamples(numSamples)), + storeSeriesResponse(t, labelpb.FromStrings("series", "2"), makeSamples(numSamples)), + storeSeriesResponse(t, labelpb.FromStrings("series", "3"), makeSamples(numSamples)), } tests := []struct { name string diff --git a/pkg/store/local.go b/pkg/store/local.go index a397b49cfbf..d17614b7396 100644 --- a/pkg/store/local.go +++ b/pkg/store/local.go @@ -12,12 +12,11 @@ import ( "github.com/go-kit/log" "github.com/go-kit/log/level" - "github.com/gogo/protobuf/jsonpb" "github.com/pkg/errors" - "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb/fileutil" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/encoding/protojson" "github.com/thanos-io/thanos/pkg/component" "github.com/thanos-io/thanos/pkg/runutil" @@ -30,8 +29,10 @@ import ( // Inefficient implementation for quick StoreAPI view. // Chunk order is exactly the same as in a given file. type LocalStore struct { + storepb.UnimplementedStoreServer + logger log.Logger - extLabels labels.Labels + extLabels labelpb.Labels c io.Closer @@ -48,7 +49,7 @@ type LocalStore struct { func NewLocalStoreFromJSONMmappableFile( logger log.Logger, component component.StoreAPI, - extLabels labels.Labels, + extLabels labelpb.Labels, path string, split bufio.SplitFunc, ) (*LocalStore, error) { @@ -82,7 +83,7 @@ func NewLocalStoreFromJSONMmappableFile( skanner := NewNoCopyScanner(content, split) resp := &storepb.SeriesResponse{} for skanner.Scan() { - if err := jsonpb.Unmarshal(bytes.NewReader(skanner.Bytes()), resp); err != nil { + if err := protojson.Unmarshal(skanner.Bytes(), resp); err != nil { return nil, errors.Wrapf(err, "unmarshal storepb.SeriesResponse frame for file %s", path) } series := resp.GetSeries() @@ -144,10 +145,9 @@ func (s *LocalStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesSe var chosen []int for si, series := range s.series { - lbls := labelpb.ZLabelsToPromLabels(series.Labels) var noMatch bool for _, m := range matchers { - extValue := lbls.Get(m.Name) + extValue := labelpb.FindValue(series.Labels, m.Name) if extValue == "" { continue } @@ -163,8 +163,8 @@ func (s *LocalStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesSe chosen = chosen[:0] resp := &storepb.Series{ // Copy labels as in-process clients like proxy tend to work on same memory for labels. - Labels: labelpb.DeepCopy(series.Labels), - Chunks: make([]storepb.AggrChunk, 0, len(s.sortedChunks[si])), + Labels: labelpb.Labels(series.Labels).DeepCopy(), + Chunks: make([]*storepb.AggrChunk, 0, len(s.sortedChunks[si])), } for _, ci := range s.sortedChunks[si] { @@ -213,8 +213,7 @@ func (s *LocalStore) LabelValues(_ context.Context, r *storepb.LabelValuesReques ) { vals := map[string]struct{}{} for _, series := range s.series { - lbls := labelpb.ZLabelsToPromLabels(series.Labels) - val := lbls.Get(r.Label) + val := labelpb.FindValue(series.Labels, r.Label) if val == "" { continue } diff --git a/pkg/store/prometheus.go b/pkg/store/prometheus.go index 3c30d70e8e8..49cce53a37f 100644 --- a/pkg/store/prometheus.go +++ b/pkg/store/prometheus.go @@ -19,7 +19,6 @@ import ( "github.com/blang/semver/v4" "github.com/go-kit/log" "github.com/go-kit/log/level" - "github.com/gogo/protobuf/proto" "github.com/golang/snappy" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" @@ -45,12 +44,14 @@ import ( // PrometheusStore implements the store node API on top of the Prometheus remote read API. type PrometheusStore struct { + storepb.UnimplementedStoreServer + logger log.Logger base *url.URL client *promclient.Client buffers sync.Pool component component.StoreAPI - externalLabelsFn func() labels.Labels + externalLabelsFn func() labelpb.Labels promVersion func() string timestamps func() (mint int64, maxt int64) @@ -75,7 +76,7 @@ func NewPrometheusStore( client *promclient.Client, baseURL *url.URL, component component.StoreAPI, - externalLabelsFn func() labels.Labels, + externalLabelsFn func() labelpb.Labels, timestamps func() (mint int64, maxt int64), promVersion func() string, ) (*PrometheusStore, error) { @@ -149,22 +150,14 @@ func (p *PrometheusStore) Series(r *storepb.SeriesRequest, seriesSrv storepb.Sto } if r.SkipChunks { - finalExtLset := rmLabels(extLset.Copy(), extLsetToRemove) + finalExtLset := labelpb.RmLabels(extLset, extLsetToRemove) labelMaps, err := p.client.SeriesInGRPC(s.Context(), p.base, matchers, r.MinTime, r.MaxTime, int(r.Limit)) if err != nil { return err } - var b labels.Builder for _, lbm := range labelMaps { - b.Reset(labels.EmptyLabels()) - for k, v := range lbm { - b.Set(k, v) - } // external labels should take precedence - finalExtLset.Range(func(l labels.Label) { - b.Set(l.Name, l.Value) - }) - lset := labelpb.ZLabelsFromPromLabels(b.Labels()) + lset := labelpb.ExtendSortedLabels(labelpb.FromMap(lbm), finalExtLset) if err = s.Send(storepb.NewSeriesResponse(&storepb.Series{Labels: lset})); err != nil { return err } @@ -220,7 +213,7 @@ func (p *PrometheusStore) handleSampledPrometheusResponse( s flushableServer, httpResp *http.Response, querySpan tracing.Span, - extLset labels.Labels, + extLset labelpb.Labels, calculateChecksums bool, extLsetToRemove map[string]struct{}, ) error { @@ -240,7 +233,7 @@ func (p *PrometheusStore) handleSampledPrometheusResponse( // https://github.com/prometheus/prometheus/blob/3f6f5d3357e232abe53f1775f893fdf8f842712c/storage/remote/read_handler.go#L166 // MergeLabels() prefers local labels over external labels but we prefer // external labels hence we need to do this: - lset := rmLabels(labelpb.ExtendSortedLabels(labelpb.ZLabelsToPromLabels(e.Labels), extLset), extLsetToRemove) + lset := labelpb.RmLabelsInPlace(labelpb.ExtendSortedLabels(e.Labels, extLset), extLsetToRemove) if len(e.Samples) == 0 { // As found in https://github.com/thanos-io/thanos/issues/381 // Prometheus can give us completely empty time series. Ignore these with log until we figure out that @@ -260,7 +253,7 @@ func (p *PrometheusStore) handleSampledPrometheusResponse( } if err := s.Send(storepb.NewSeriesResponse(&storepb.Series{ - Labels: labelpb.ZLabelsFromPromLabels(lset), + Labels: lset, Chunks: aggregatedChunks, })); err != nil { return err @@ -275,7 +268,7 @@ func (p *PrometheusStore) handleStreamedPrometheusResponse( shardMatcher *storepb.ShardMatcher, httpResp *http.Response, querySpan tracing.Span, - extLset labels.Labels, + extLset labelpb.Labels, calculateChecksums bool, extLsetToRemove map[string]struct{}, ) error { @@ -319,17 +312,17 @@ func (p *PrometheusStore) handleStreamedPrometheusResponse( // MergeLabels() prefers local labels over external labels but we prefer // external labels hence we need to do this: // https://github.com/prometheus/prometheus/blob/3f6f5d3357e232abe53f1775f893fdf8f842712c/storage/remote/codec.go#L210. - completeLabelset := rmLabels(labelpb.ExtendSortedLabels(labelpb.ZLabelsToPromLabels(series.Labels), extLset), extLsetToRemove) + completeLabelset := labelpb.RmLabelsInPlace(labelpb.ExtendSortedLabels(series.Labels, extLset), extLsetToRemove) if !shardMatcher.MatchesLabels(completeLabelset) { continue } seriesStats.CountSeries(series.Labels) - thanosChks := make([]storepb.AggrChunk, len(series.Chunks)) + thanosChks := make([]*storepb.AggrChunk, len(series.Chunks)) for i, chk := range series.Chunks { chkHash := hashChunk(hasher, chk.Data, calculateChecksums) - thanosChks[i] = storepb.AggrChunk{ + thanosChks[i] = &storepb.AggrChunk{ MaxTime: chk.MaxTimeMs, MinTime: chk.MinTimeMs, Raw: &storepb.Chunk{ @@ -349,7 +342,7 @@ func (p *PrometheusStore) handleStreamedPrometheusResponse( } r := storepb.NewSeriesResponse(&storepb.Series{ - Labels: labelpb.ZLabelsFromPromLabels(completeLabelset), + Labels: completeLabelset, Chunks: thanosChks, }) if err := s.Send(r); err != nil { @@ -408,7 +401,7 @@ func (p *PrometheusStore) fetchSampledResponse(ctx context.Context, resp *http.R var data prompb.ReadResponse tracing.DoInSpan(ctx, "unmarshal_response", func(ctx context.Context) { - err = proto.Unmarshal(decomp, &data) + err = data.UnmarshalVT(decomp) }) if err != nil { return nil, errors.Wrap(err, "unmarshal response") @@ -420,7 +413,7 @@ func (p *PrometheusStore) fetchSampledResponse(ctx context.Context, resp *http.R return &data, nil } -func (p *PrometheusStore) chunkSamples(series *prompb.TimeSeries, maxSamplesPerChunk int, calculateChecksums bool) (chks []storepb.AggrChunk, err error) { +func (p *PrometheusStore) chunkSamples(series *prompb.TimeSeries, maxSamplesPerChunk int, calculateChecksums bool) (chks []*storepb.AggrChunk, err error) { samples := series.Samples hasher := hashPool.Get().(hash.Hash64) defer hashPool.Put(hasher) @@ -437,7 +430,7 @@ func (p *PrometheusStore) chunkSamples(series *prompb.TimeSeries, maxSamplesPerC } chkHash := hashChunk(hasher, cb, calculateChecksums) - chks = append(chks, storepb.AggrChunk{ + chks = append(chks, &storepb.AggrChunk{ MinTime: samples[0].Timestamp, MaxTime: samples[chunkSize-1].Timestamp, Raw: &storepb.Chunk{Type: enc, Data: cb, Hash: chkHash}, @@ -450,10 +443,11 @@ func (p *PrometheusStore) chunkSamples(series *prompb.TimeSeries, maxSamplesPerC } func (p *PrometheusStore) startPromRemoteRead(ctx context.Context, q *prompb.Query) (presp *http.Response, err error) { - reqb, err := proto.Marshal(&prompb.ReadRequest{ + readReq := &prompb.ReadRequest{ Queries: []*prompb.Query{q}, AcceptedResponseTypes: p.remoteReadAcceptableResponses, - }) + } + reqb, err := readReq.MarshalVT() if err != nil { return nil, errors.Wrap(err, "marshal read request") } @@ -489,7 +483,7 @@ func (p *PrometheusStore) startPromRemoteRead(ctx context.Context, q *prompb.Que // matchesExternalLabels returns false if given matchers are not matching external labels. // If true, matchesExternalLabels also returns Prometheus matchers without those matching external labels. -func matchesExternalLabels(ms []storepb.LabelMatcher, externalLabels labels.Labels, cache storecache.MatchersCache) (bool, []*labels.Matcher, error) { +func matchesExternalLabels(ms []*storepb.LabelMatcher, externalLabels labelpb.Labels, cache storecache.MatchersCache) (bool, []*labels.Matcher, error) { var ( tms []*labels.Matcher err error @@ -526,7 +520,7 @@ func matchesExternalLabels(ms []storepb.LabelMatcher, externalLabels labels.Labe // encodeChunk translates the sample pairs into a chunk. // TODO(kakkoyun): Linter - result 0 (github.com/thanos-io/thanos/pkg/store/storepb.Chunk_Encoding) is always 0. -func (p *PrometheusStore) encodeChunk(ss []prompb.Sample) (storepb.Chunk_Encoding, []byte, error) { //nolint:unparam +func (p *PrometheusStore) encodeChunk(ss []*prompb.Sample) (storepb.Chunk_Encoding, []byte, error) { //nolint:unparam c := chunkenc.NewXORChunk() a, err := c.Appender() @@ -582,7 +576,7 @@ func (p *PrometheusStore) LabelNames(ctx context.Context, r *storepb.LabelNamesR } if len(lbls) > 0 { - extLset.Range(func(l labels.Label) { + extLset.Range(func(l *labelpb.Label) { if _, ok := extLsetToRemove[l.Name]; !ok { lbls = append(lbls, l.Name) } @@ -661,31 +655,24 @@ func (p *PrometheusStore) LabelValues(ctx context.Context, r *storepb.LabelValue return &storepb.LabelValuesResponse{Values: vals}, nil } -func (p *PrometheusStore) LabelSet() []labelpb.ZLabelSet { - labels := labelpb.ZLabelsFromPromLabels(p.externalLabelsFn()) - - labelset := []labelpb.ZLabelSet{} - if len(labels) > 0 { - labelset = append(labelset, labelpb.ZLabelSet{ - Labels: labels, - }) +func (p *PrometheusStore) LabelSet() []*labelpb.LabelSet { + lbls := p.externalLabelsFn() + if len(lbls) == 0 { + return []*labelpb.LabelSet{} } - - return labelset + return []*labelpb.LabelSet{{Labels: lbls}} } -func (p *PrometheusStore) TSDBInfos() []infopb.TSDBInfo { - labels := p.LabelSet() - if len(labels) == 0 { - return []infopb.TSDBInfo{} +func (p *PrometheusStore) TSDBInfos() []*infopb.TSDBInfo { + labelSets := p.LabelSet() + if len(labelSets) == 0 { + return []*infopb.TSDBInfo{} } mint, maxt := p.Timestamps() - return []infopb.TSDBInfo{ + return []*infopb.TSDBInfo{ { - Labels: labelpb.ZLabelSet{ - Labels: labels[0].Labels, - }, + Labels: labelSets[0], MinTime: mint, MaxTime: maxt, }, diff --git a/pkg/store/prometheus_test.go b/pkg/store/prometheus_test.go index 8fc6f1ef33b..4a3e8ec529e 100644 --- a/pkg/store/prometheus_test.go +++ b/pkg/store/prometheus_test.go @@ -26,6 +26,7 @@ import ( "github.com/thanos-io/thanos/pkg/promclient" "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" + thanostestutil "github.com/thanos-io/thanos/pkg/testutil" "github.com/thanos-io/thanos/pkg/testutil/e2eutil" ) @@ -70,7 +71,7 @@ func testPrometheusStoreSeriesE2e(t *testing.T, prefix string) { limitMinT := int64(0) proxy, err := NewPrometheusStore(nil, nil, promclient.NewDefaultClient(), u, component.Sidecar, - func() labels.Labels { return labels.FromStrings("region", "eu-west") }, + func() labelpb.Labels { return labelpb.FromStrings("region", "eu-west") }, func() (int64, int64) { return limitMinT, -1 }, nil, ) // MaxTime does not matter. @@ -83,17 +84,14 @@ func testPrometheusStoreSeriesE2e(t *testing.T, prefix string) { testutil.Ok(t, proxy.Series(&storepb.SeriesRequest{ MinTime: baseT + 101, MaxTime: baseT + 300, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "b"}, }, }, srv)) testutil.Equals(t, 1, len(srv.SeriesSet)) - testutil.Equals(t, []labelpb.ZLabel{ - {Name: "a", Value: "b"}, - {Name: "region", Value: "eu-west"}, - }, srv.SeriesSet[0].Labels) + thanostestutil.ProtoEquals(t, labelpb.FromStrings("a", "b", "region", "eu-west"), labelpb.Labels(srv.SeriesSet[0].Labels)) testutil.Equals(t, []string(nil), srv.Warnings) testutil.Equals(t, 1, len(srv.SeriesSet[0].Chunks)) @@ -114,7 +112,7 @@ func testPrometheusStoreSeriesE2e(t *testing.T, prefix string) { testutil.Ok(t, proxy.Series(&storepb.SeriesRequest{ MinTime: 0, MaxTime: baseT + 300, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "b"}, }, }, srv)) @@ -123,10 +121,7 @@ func testPrometheusStoreSeriesE2e(t *testing.T, prefix string) { testutil.Equals(t, 1, len(srv.SeriesSet)) - testutil.Equals(t, []labelpb.ZLabel{ - {Name: "a", Value: "b"}, - {Name: "region", Value: "eu-west"}, - }, srv.SeriesSet[0].Labels) + thanostestutil.ProtoEquals(t, labelpb.FromStrings("a", "b", "region", "eu-west"), labelpb.Labels(srv.SeriesSet[0].Labels)) testutil.Equals(t, 1, len(srv.SeriesSet[0].Chunks)) @@ -147,7 +142,7 @@ func testPrometheusStoreSeriesE2e(t *testing.T, prefix string) { err = proxy.Series(&storepb.SeriesRequest{ MinTime: baseT + 101, MaxTime: baseT + 300, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "region", Value: "eu-west"}, }, }, srv) @@ -199,7 +194,7 @@ func TestPrometheusStore_SeriesLabels_e2e(t *testing.T) { testutil.Ok(t, err) promStore, err := NewPrometheusStore(nil, nil, promclient.NewDefaultClient(), u, component.Sidecar, - func() labels.Labels { return labels.FromStrings("region", "eu-west") }, + func() labelpb.Labels { return labelpb.FromStrings("region", "eu-west") }, func() (int64, int64) { return math.MinInt64/1000 + 62135596801, math.MaxInt64/1000 - 62135596801 }, nil, ) @@ -207,13 +202,13 @@ func TestPrometheusStore_SeriesLabels_e2e(t *testing.T) { for _, tcase := range []struct { req *storepb.SeriesRequest - expected []storepb.Series + expected []*storepb.Series expectedErr error }{ { req: &storepb.SeriesRequest{ SkipChunks: true, - Matchers: []storepb.LabelMatcher{}, + Matchers: []*storepb.LabelMatcher{}, MinTime: baseT - 10000000000, MaxTime: baseT + 10000000000, }, @@ -222,7 +217,7 @@ func TestPrometheusStore_SeriesLabels_e2e(t *testing.T) { { req: &storepb.SeriesRequest{ SkipChunks: true, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "non_existing", Value: "something"}, }, MinTime: baseT - 10000000000, @@ -232,22 +227,20 @@ func TestPrometheusStore_SeriesLabels_e2e(t *testing.T) { { req: &storepb.SeriesRequest{ SkipChunks: true, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "b"}, }, MinTime: baseT, MaxTime: baseT + 300, }, - expected: []storepb.Series{ - { - Labels: []labelpb.ZLabel{{Name: "a", Value: "b"}, {Name: "b", Value: "d"}, {Name: "region", Value: "eu-west"}}, - }, + expected: []*storepb.Series{ + {Labels: labelpb.FromStrings("a", "b", "b", "d", "region", "eu-west")}, }, }, { req: &storepb.SeriesRequest{ SkipChunks: true, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "job", Value: "foo"}, }, MinTime: baseT, @@ -257,74 +250,58 @@ func TestPrometheusStore_SeriesLabels_e2e(t *testing.T) { { req: &storepb.SeriesRequest{ SkipChunks: true, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_NEQ, Name: "a", Value: "b"}, {Type: storepb.LabelMatcher_EQ, Name: "job", Value: "test"}, }, MinTime: baseT, MaxTime: baseT + 300, }, - expected: []storepb.Series{ - { - Labels: []labelpb.ZLabel{{Name: "a", Value: "c"}, {Name: "b", Value: "d"}, {Name: "job", Value: "test"}, {Name: "region", Value: "eu-west"}}, - }, - { - Labels: []labelpb.ZLabel{{Name: "a", Value: "d"}, {Name: "b", Value: "d"}, {Name: "job", Value: "test"}, {Name: "region", Value: "eu-west"}}, - }, + expected: []*storepb.Series{ + {Labels: labelpb.FromStrings("a", "c", "b", "d", "job", "test", "region", "eu-west")}, + {Labels: labelpb.FromStrings("a", "d", "b", "d", "job", "test", "region", "eu-west")}, }, }, { req: &storepb.SeriesRequest{ SkipChunks: true, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "job", Value: "test"}, }, MinTime: baseT, MaxTime: baseT + 300, }, - expected: []storepb.Series{ - { - Labels: []labelpb.ZLabel{{Name: "a", Value: "c"}, {Name: "b", Value: "d"}, {Name: "job", Value: "test"}, {Name: "region", Value: "eu-west"}}, - }, - { - Labels: []labelpb.ZLabel{{Name: "a", Value: "d"}, {Name: "b", Value: "d"}, {Name: "job", Value: "test"}, {Name: "region", Value: "eu-west"}}, - }, + expected: []*storepb.Series{ + {Labels: labelpb.FromStrings("a", "c", "b", "d", "job", "test", "region", "eu-west")}, + {Labels: labelpb.FromStrings("a", "d", "b", "d", "job", "test", "region", "eu-west")}, }, }, { req: &storepb.SeriesRequest{ SkipChunks: true, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "job", Value: "test"}, }, MinTime: baseT + 400, MaxTime: baseT + 400, }, - expected: []storepb.Series{ - { - Labels: []labelpb.ZLabel{{Name: "b", Value: "d"}, {Name: "job", Value: "test"}, {Name: "region", Value: "eu-west"}}, - }, + expected: []*storepb.Series{ + {Labels: labelpb.FromStrings("b", "d", "job", "test", "region", "eu-west")}, }, }, { req: &storepb.SeriesRequest{ SkipChunks: true, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "job", Value: "test"}, }, MinTime: func() int64 { minTime, _ := promStore.timestamps(); return minTime }(), MaxTime: func() int64 { _, maxTime := promStore.timestamps(); return maxTime }(), }, - expected: []storepb.Series{ - { - Labels: []labelpb.ZLabel{{Name: "a", Value: "c"}, {Name: "b", Value: "d"}, {Name: "job", Value: "test"}, {Name: "region", Value: "eu-west"}}, - }, - { - Labels: []labelpb.ZLabel{{Name: "a", Value: "d"}, {Name: "b", Value: "d"}, {Name: "job", Value: "test"}, {Name: "region", Value: "eu-west"}}, - }, - { - Labels: []labelpb.ZLabel{{Name: "b", Value: "d"}, {Name: "job", Value: "test"}, {Name: "region", Value: "eu-west"}}, - }, + expected: []*storepb.Series{ + {Labels: labelpb.FromStrings("a", "c", "b", "d", "job", "test", "region", "eu-west")}, + {Labels: labelpb.FromStrings("a", "d", "b", "d", "job", "test", "region", "eu-west")}, + {Labels: labelpb.FromStrings("b", "d", "job", "test", "region", "eu-west")}, }, }, } { @@ -370,7 +347,7 @@ func TestPrometheusStore_Series_MatchExternalLabel(t *testing.T) { testutil.Ok(t, err) proxy, err := NewPrometheusStore(nil, nil, promclient.NewDefaultClient(), u, component.Sidecar, - func() labels.Labels { return labels.FromStrings("region", "eu-west") }, + func() labelpb.Labels { return labelpb.FromStrings("region", "eu-west") }, func() (int64, int64) { return 0, math.MaxInt64 }, nil) testutil.Ok(t, err) @@ -379,24 +356,21 @@ func TestPrometheusStore_Series_MatchExternalLabel(t *testing.T) { testutil.Ok(t, proxy.Series(&storepb.SeriesRequest{ MinTime: baseT + 101, MaxTime: baseT + 300, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "b"}, {Type: storepb.LabelMatcher_EQ, Name: "region", Value: "eu-west"}, }, }, srv)) testutil.Equals(t, 1, len(srv.SeriesSet)) - testutil.Equals(t, []labelpb.ZLabel{ - {Name: "a", Value: "b"}, - {Name: "region", Value: "eu-west"}, - }, srv.SeriesSet[0].Labels) + thanostestutil.ProtoEquals(t, labelpb.FromStrings("a", "b", "region", "eu-west"), labelpb.Labels(srv.SeriesSet[0].Labels)) srv = newStoreSeriesServer(ctx) // However, it should not match wrong external label. testutil.Ok(t, proxy.Series(&storepb.SeriesRequest{ MinTime: baseT + 101, MaxTime: baseT + 300, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "b"}, {Type: storepb.LabelMatcher_EQ, Name: "region", Value: "eu-west2"}, // Non existing label value. }, @@ -433,7 +407,7 @@ func TestPrometheusStore_Series_ChunkHashCalculation_Integration(t *testing.T) { testutil.Ok(t, err) proxy, err := NewPrometheusStore(nil, nil, promclient.NewDefaultClient(), u, component.Sidecar, - func() labels.Labels { return labels.FromStrings("region", "eu-west") }, + func() labelpb.Labels { return labelpb.FromStrings("region", "eu-west") }, func() (int64, int64) { return 0, math.MaxInt64 }, nil) testutil.Ok(t, err) @@ -442,8 +416,8 @@ func TestPrometheusStore_Series_ChunkHashCalculation_Integration(t *testing.T) { testutil.Ok(t, proxy.Series(&storepb.SeriesRequest{ MinTime: baseT + 101, MaxTime: baseT + 300, - Matchers: []storepb.LabelMatcher{ - {Name: "a", Value: "b"}, + Matchers: []*storepb.LabelMatcher{ + {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "b"}, {Type: storepb.LabelMatcher_EQ, Name: "region", Value: "eu-west"}, }, }, srv)) diff --git a/pkg/store/proxy.go b/pkg/store/proxy.go index 434cb220e9b..394d8ab46df 100644 --- a/pkg/store/proxy.go +++ b/pkg/store/proxy.go @@ -55,13 +55,13 @@ type Client interface { storepb.StoreClient // LabelSets that each apply to some data exposed by the backing store. - LabelSets() []labels.Labels + LabelSets() []labelpb.Labels // TimeRange returns minimum and maximum time range of data in the store. TimeRange() (mint int64, maxt int64) // TSDBInfos returns metadata about each TSDB backed by the client. - TSDBInfos() []infopb.TSDBInfo + TSDBInfos() []*infopb.TSDBInfo // SupportsSharding returns true if sharding is supported by the underlying store. SupportsSharding() bool @@ -92,10 +92,12 @@ type Client interface { // ProxyStore implements the store API that proxies request to all given underlying stores. type ProxyStore struct { + storepb.UnimplementedStoreServer + logger log.Logger stores func() []Client component component.StoreAPI - selectorLabels labels.Labels + selectorLabels labelpb.Labels buffers sync.Pool responseTimeout time.Duration @@ -272,7 +274,7 @@ func NewProxyStore( reg prometheus.Registerer, stores func() []Client, component component.StoreAPI, - selectorLabels labels.Labels, + selectorLabels labelpb.Labels, responseTimeout time.Duration, retrievalStrategy RetrievalStrategy, options ...ProxyStoreOption, @@ -306,21 +308,21 @@ func NewProxyStore( return s } -func (s *ProxyStore) LabelSet() []labelpb.ZLabelSet { +func (s *ProxyStore) LabelSet() []*labelpb.LabelSet { stores := s.stores() if len(stores) == 0 { - return []labelpb.ZLabelSet{} + return []*labelpb.LabelSet{} } - mergedLabelSets := make(map[uint64]labelpb.ZLabelSet, len(stores)) + mergedLabelSets := make(map[uint64]*labelpb.LabelSet, len(stores)) for _, st := range stores { for _, lset := range st.LabelSets() { mergedLabelSet := labelpb.ExtendSortedLabels(lset, s.selectorLabels) - mergedLabelSets[mergedLabelSet.Hash()] = labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(mergedLabelSet)} + mergedLabelSets[mergedLabelSet.Hash()] = &labelpb.LabelSet{Labels: mergedLabelSet} } } - labelSets := make([]labelpb.ZLabelSet, 0, len(mergedLabelSets)) + labelSets := make([]*labelpb.LabelSet, 0, len(mergedLabelSets)) for _, v := range mergedLabelSets { labelSets = append(labelSets, v) } @@ -329,9 +331,8 @@ func (s *ProxyStore) LabelSet() []labelpb.ZLabelSet { // selector-labels represents. If no label-sets are announced by the // store-proxy's discovered stores, then we still want to enforce // announcing this subset by announcing the selector as the label-set. - selectorLabels := labelpb.ZLabelsFromPromLabels(s.selectorLabels) - if len(labelSets) == 0 && len(selectorLabels) > 0 { - labelSets = append(labelSets, labelpb.ZLabelSet{Labels: selectorLabels}) + if len(labelSets) == 0 && len(s.selectorLabels) > 0 { + labelSets = append(labelSets, &labelpb.LabelSet{Labels: s.selectorLabels}) } return labelSets @@ -357,8 +358,8 @@ func (s *ProxyStore) TimeRange() (int64, int64) { return minTime, maxTime } -func (s *ProxyStore) TSDBInfos() []infopb.TSDBInfo { - infos := make([]infopb.TSDBInfo, 0) +func (s *ProxyStore) TSDBInfos() []*infopb.TSDBInfo { + infos := make([]*infopb.TSDBInfo, 0) for _, st := range s.stores() { matches, _ := s.tsdbSelector.MatchLabelSets(st.LabelSets()...) if !matches { @@ -459,7 +460,7 @@ func (s *ProxyStore) Series(originalRequest *storepb.SeriesRequest, srv storepb. var ( stores []Client - storeLabelSets []labels.Labels + storeLabelSets []labelpb.Labels ) // groupReplicaStores[groupKey][replicaKey] = number of stores with the groupKey and replicaKey groupReplicaStores := make(map[string]map[string]int) @@ -906,7 +907,7 @@ func (s *ProxyStore) LabelValues(ctx context.Context, originalRequest *storepb.L func storeInfo(st Client) (storeID string, storeAddr string, isLocalStore bool) { storeAddr, isLocalStore = st.Addr() - storeID = labelpb.PromLabelSetsToString(st.LabelSets()) + storeID = labelpb.LabelSetsToString(st.LabelSets()) if storeID == "" { storeID = "Store Gateway" } @@ -916,7 +917,7 @@ func storeInfo(st Client) (storeID string, storeAddr string, isLocalStore bool) // TODO: consider moving the following functions into something like "pkg/pruneutils" since it is also used for exemplars. func fullExternalLabelsString(st Client) string { - return labelpb.PromLabelSetsToStringN(st.LabelSets(), 100000) + return labelpb.LabelSetsToStringN(st.LabelSets(), 100000) } func (s *ProxyStore) filterByExclusiveExternalLabels(stores []Client, matchers []*labels.Matcher) ([]Client, []string) { @@ -965,10 +966,10 @@ func (s *ProxyStore) filterByExclusiveExternalLabels(stores []Client, matchers [ return matchedStores, storeDebugMsgs } -func (s *ProxyStore) matchingStores(ctx context.Context, minTime, maxTime int64, matchers []*labels.Matcher) ([]Client, []labels.Labels, []string) { +func (s *ProxyStore) matchingStores(ctx context.Context, minTime, maxTime int64, matchers []*labels.Matcher) ([]Client, []labelpb.Labels, []string) { var ( stores []Client - storeLabelSets []labels.Labels + storeLabelSets []labelpb.Labels storeDebugMsgs []string ) totalStores := 0 @@ -1052,7 +1053,7 @@ func storeMatchDebugMetadata(s Client, debugLogging bool, storeDebugMatchers [][ match := false for _, sm := range storeDebugMatchers { - match = match || LabelSetsMatch(sm, labels.FromStrings("__address__", addr)) + match = match || LabelSetsMatch(sm, labelpb.FromStrings("__address__", addr)) } if !match { const s string = "__address__ does not match debug store metadata matchers" @@ -1065,7 +1066,7 @@ func storeMatchDebugMetadata(s Client, debugLogging bool, storeDebugMatchers [][ } // LabelSetsMatch returns false if all label-set do not match the matchers (aka: OR is between all label-sets). -func LabelSetsMatch(matchers []*labels.Matcher, lset ...labels.Labels) bool { +func LabelSetsMatch(matchers []*labels.Matcher, lset ...labelpb.Labels) bool { if len(lset) == 0 { return true } diff --git a/pkg/store/proxy_merge.go b/pkg/store/proxy_merge.go index 54a46692c21..87871e0d83e 100644 --- a/pkg/store/proxy_merge.go +++ b/pkg/store/proxy_merge.go @@ -18,7 +18,6 @@ import ( "github.com/opentracing/opentracing-go" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/prometheus/model/labels" grpc_opentracing "github.com/thanos-io/thanos/pkg/tracing/tracing_middleware" @@ -114,7 +113,7 @@ func (d *responseDeduplicator) Next() bool { lbls := d.bufferedSameSeries[0].GetSeries().Labels atLbls := s.GetSeries().Labels - if labels.Compare(labelpb.ZLabelsToPromLabels(lbls), labelpb.ZLabelsToPromLabels(atLbls)) == 0 { + if labelpb.Compare(labelpb.Labels(lbls), labelpb.Labels(atLbls)) == 0 { d.bufferedSameSeries = append(d.bufferedSameSeries, s) continue } @@ -144,8 +143,7 @@ func (d *responseDeduplicator) chainSeriesAndRemIdenticalChunks(series []*storep } if _, ok := d.chunkDedupMap[hash]; !ok { - chk := chk - d.chunkDedupMap[hash] = &chk + d.chunkDedupMap[hash] = chk d.chunkCountMap[hash] = 1 break } else { @@ -160,7 +158,7 @@ func (d *responseDeduplicator) chainSeriesAndRemIdenticalChunks(series []*storep return series[0] } - finalChunks := make([]storepb.AggrChunk, 0, len(d.chunkDedupMap)) + finalChunks := make([]*storepb.AggrChunk, 0, len(d.chunkDedupMap)) for hash, chk := range d.chunkDedupMap { if d.quorumChunkDedup { // NB: this is specific to Databricks' setup where each time series is written to at least 2 out of 3 replicas. @@ -170,14 +168,14 @@ func (d *responseDeduplicator) chainSeriesAndRemIdenticalChunks(series []*storep // We want to send those two identical replicas to the later quorum-based deduplication process to dominate any corrupt third replica. if d.chunkCountMap[hash] >= 3 { // Most of cases should hit this branch. - finalChunks = append(finalChunks, *chk) + finalChunks = append(finalChunks, chk) } else { for i := 0; i < d.chunkCountMap[hash]; i++ { - finalChunks = append(finalChunks, *chk) + finalChunks = append(finalChunks, chk) } } } else { - finalChunks = append(finalChunks, *chk) + finalChunks = append(finalChunks, chk) } } @@ -211,10 +209,7 @@ func NewProxyResponseLoserTree(seriesSets ...respSet) *losertree.Tree[*storepb.S return true } if a.GetSeries() != nil && b.GetSeries() != nil { - iLbls := labelpb.ZLabelsToPromLabels(a.GetSeries().Labels) - jLbls := labelpb.ZLabelsToPromLabels(b.GetSeries().Labels) - - return labels.Compare(iLbls, jLbls) < 0 + return labelpb.Compare(a.GetSeries().Labels, b.GetSeries().Labels) < 0 } else if a.GetSeries() == nil && b.GetSeries() != nil { return true } else if a.GetSeries() != nil && b.GetSeries() == nil { @@ -235,7 +230,7 @@ func (l *lazyRespSet) StoreID() string { } func (l *lazyRespSet) Labelset() string { - return labelpb.PromLabelSetsToString(l.storeLabelSets) + return labelpb.LabelSetsToString(l.storeLabelSets) } func (l *lazyRespSet) StoreLabels() map[string]struct{} { @@ -252,7 +247,7 @@ type lazyRespSet struct { cl storepb.Store_SeriesClient closeSeries context.CancelFunc storeName string - storeLabelSets []labels.Labels + storeLabelSets []labelpb.Labels storeLabels map[string]struct{} frameTimeout time.Duration @@ -357,7 +352,7 @@ func newLazyRespSet( span opentracing.Span, frameTimeout time.Duration, storeName string, - storeLabelSets []labels.Labels, + storeLabelSets []labelpb.Labels, closeSeries context.CancelFunc, cl storepb.Store_SeriesClient, shardMatcher *storepb.ShardMatcher, @@ -392,9 +387,9 @@ func newLazyRespSet( } respSet.storeLabels = make(map[string]struct{}) for _, ls := range storeLabelSets { - ls.Range(func(l labels.Label) { + for _, l := range ls { respSet.storeLabels[l.Name] = struct{}{} - }) + } } go func(st string, l *lazyRespSet) { @@ -465,9 +460,9 @@ func newLazyRespSet( } numResponses++ - bytesProcessed += resp.Size() + bytesProcessed += resp.SizeVT() - if resp.GetSeries() != nil && applySharding && !shardMatcher.MatchesZLabels(resp.GetSeries().Labels) { + if resp.GetSeries() != nil && applySharding && !shardMatcher.MatchesLabels(resp.GetSeries().Labels) { return true } @@ -646,7 +641,7 @@ type eagerRespSet struct { storeName string storeLabels map[string]struct{} - storeLabelSets []labels.Labels + storeLabelSets []labelpb.Labels // Internal bookkeeping. bufferedResponses []*storepb.SeriesResponse @@ -658,7 +653,7 @@ func newEagerRespSet( span opentracing.Span, frameTimeout time.Duration, storeName string, - storeLabelSets []labels.Labels, + storeLabelSets []labelpb.Labels, closeSeries context.CancelFunc, cl storepb.Store_SeriesClient, shardMatcher *storepb.ShardMatcher, @@ -680,9 +675,9 @@ func newEagerRespSet( } ret.storeLabels = make(map[string]struct{}) for _, ls := range storeLabelSets { - ls.Range(func(l labels.Label) { + for _, l := range ls { ret.storeLabels[l.Name] = struct{}{} - }) + } } ret.wg.Add(1) @@ -738,9 +733,9 @@ func newEagerRespSet( } numResponses++ - bytesProcessed += resp.Size() + bytesProcessed += resp.SizeVT() - if resp.GetSeries() != nil && applySharding && !shardMatcher.MatchesZLabels(resp.GetSeries().Labels) { + if resp.GetSeries() != nil && applySharding && !shardMatcher.MatchesLabels(resp.GetSeries().Labels) { return true } @@ -775,14 +770,6 @@ func newEagerRespSet( return ret } -func rmLabels(l labels.Labels, labelsToRemove map[string]struct{}) labels.Labels { - b := labels.NewBuilder(l) - for k := range labelsToRemove { - b.Del(k) - } - return b.Labels() -} - // sortWithoutLabels removes given labels from series and re-sorts the series responses that the same // series with different labels are coming right after each other. Other types of responses are moved to front. func sortWithoutLabels(set []*storepb.SeriesResponse, labelsToRemove map[string]struct{}) { @@ -793,7 +780,7 @@ func sortWithoutLabels(set []*storepb.SeriesResponse, labelsToRemove map[string] } if len(labelsToRemove) > 0 { - ser.Labels = labelpb.ZLabelsFromPromLabels(rmLabels(labelpb.ZLabelsToPromLabels(ser.Labels), labelsToRemove)) + ser.Labels = labelpb.RmLabelsInPlace(labelpb.Labels(ser.Labels), labelsToRemove) } } @@ -808,7 +795,7 @@ func sortWithoutLabels(set []*storepb.SeriesResponse, labelsToRemove map[string] if sj == nil { return false } - return labels.Compare(labelpb.ZLabelsToPromLabels(si.Labels), labelpb.ZLabelsToPromLabels(sj.Labels)) < 0 + return labelpb.Compare(si.Labels, sj.Labels) < 0 }) } @@ -851,7 +838,7 @@ func (l *eagerRespSet) StoreID() string { } func (l *eagerRespSet) Labelset() string { - return labelpb.PromLabelSetsToString(l.storeLabelSets) + return labelpb.LabelSetsToString(l.storeLabelSets) } func (l *eagerRespSet) StoreLabels() map[string]struct{} { diff --git a/pkg/store/proxy_merge_test.go b/pkg/store/proxy_merge_test.go index 387d5ff6a87..7193ed2c286 100644 --- a/pkg/store/proxy_merge_test.go +++ b/pkg/store/proxy_merge_test.go @@ -8,22 +8,21 @@ import ( "sync" "testing" - "github.com/efficientgo/core/testutil" - "github.com/prometheus/prometheus/model/labels" - "github.com/thanos-io/thanos/pkg/errors" + labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" + thanostestutil "github.com/thanos-io/thanos/pkg/testutil" ) func TestRmLabelsCornerCases(t *testing.T) { t.Parallel() - testutil.Equals(t, rmLabels(labelsFromStrings("aa", "bb"), map[string]struct{}{ + thanostestutil.ProtoEquals(t, labelpb.RmLabels(labelpb.FromStrings("aa", "bb"), map[string]struct{}{ "aa": {}, - }), labels.Labels{}) - testutil.Equals(t, rmLabels(labelsFromStrings(), map[string]struct{}{ + }), labelpb.EmptyLabels()) + thanostestutil.ProtoEquals(t, labelpb.RmLabels(labelpb.EmptyLabels(), map[string]struct{}{ "aa": {}, - }), labels.Labels{}) + }), labelpb.EmptyLabels()) } func TestProxyResponseTreeSort(t *testing.T) { @@ -230,7 +229,7 @@ func TestProxyResponseTreeSort(t *testing.T) { r := h.At() got = append(got, r) } - testutil.Equals(t, tcase.exp, got) + thanostestutil.ProtoEquals(t, tcase.exp, got) }) } } @@ -304,15 +303,14 @@ func TestSortWithoutLabels(t *testing.T) { // Longer series. { input: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings( + storeSeriesResponse(t, labelpb.FromStrings( "__name__", "gitlab_transaction_cache_read_hit_count_total", "action", "widget.json", "controller", "Projects::MergeRequests::ContentController", "env", "gprd", "environment", "gprd", "fqdn", "web-08-sv-gprd.c.gitlab-production.internal", "instance", "web-08-sv-gprd.c.gitlab-production.internal:8083", "job", "gitlab-rails", "monitor", "app", "provider", "gcp", "region", "us-east", "replica", "01", "shard", "default", "stage", "main", "tier", "sv", "type", "web", )), }, exp: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings( - // No replica label anymore. + storeSeriesResponse(t, labelpb.FromStrings( "__name__", "gitlab_transaction_cache_read_hit_count_total", "action", "widget.json", "controller", "Projects::MergeRequests::ContentController", "env", "gprd", "environment", "gprd", "fqdn", "web-08-sv-gprd.c.gitlab-production.internal", "instance", "web-08-sv-gprd.c.gitlab-production.internal:8083", "job", "gitlab-rails", "monitor", "app", "provider", "gcp", "region", "us-east", "shard", "default", "stage", "main", "tier", "sv", "type", "web", @@ -323,22 +321,21 @@ func TestSortWithoutLabels(t *testing.T) { } { t.Run("", func(t *testing.T) { sortWithoutLabels(tcase.input, tcase.dedupLabels) - testutil.Equals(t, tcase.exp, tcase.input) + thanostestutil.ProtoEquals(t, tcase.exp, tcase.input) }) } } -// labelsFromStrings is like labels.FromString, but it does not sort the input. -func labelsFromStrings(ss ...string) labels.Labels { +// labelsFromStrings is like labelpb.FromStrings, but does not sort the input. +func labelsFromStrings(ss ...string) labelpb.Labels { if len(ss)%2 != 0 { panic("invalid number of strings") } - - b := labels.NewScratchBuilder(len(ss) / 2) + result := make(labelpb.Labels, 0, len(ss)/2) for i := 0; i < len(ss); i += 2 { - b.Add(ss[i], ss[i+1]) + result = append(result, &labelpb.Label{Name: ss[i], Value: ss[i+1]}) } - return b.Labels() + return result } func BenchmarkSortWithoutLabels(b *testing.B) { @@ -352,7 +349,7 @@ func BenchmarkSortWithoutLabels(b *testing.B) { for i := 0; i < b.N; i++ { b.StopTimer() for i := 0; i < 1e4; i++ { - resps[i] = storeSeriesResponse(b, labels.FromStrings("a", "1", "b", "replica-1", "c", "replica-1", "d", "1")) + resps[i] = storeSeriesResponse(b, labelpb.FromStrings("a", "1", "b", "replica-1", "c", "replica-1", "d", "1")) } b.StartTimer() sortWithoutLabels(resps, labelsToRemove) diff --git a/pkg/store/proxy_test.go b/pkg/store/proxy_test.go index 5c30008e219..f08b21f41dd 100644 --- a/pkg/store/proxy_test.go +++ b/pkg/store/proxy_test.go @@ -18,8 +18,7 @@ import ( "github.com/cespare/xxhash/v2" "github.com/efficientgo/core/testutil" "github.com/go-kit/log" - "github.com/gogo/protobuf/proto" - "github.com/gogo/protobuf/types" + "github.com/google/go-cmp/cmp" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/prometheus/model/labels" @@ -27,6 +26,7 @@ import ( "github.com/prometheus/prometheus/tsdb" "github.com/prometheus/prometheus/tsdb/chunkenc" "google.golang.org/grpc" + "google.golang.org/protobuf/types/known/anypb" "github.com/thanos-io/thanos/pkg/block" "github.com/thanos-io/thanos/pkg/component" @@ -35,6 +35,7 @@ import ( "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" storetestutil "github.com/thanos-io/thanos/pkg/store/storepb/testutil" + thanostestutil "github.com/thanos-io/thanos/pkg/testutil" ) type mockedSeriesServer struct { @@ -64,26 +65,26 @@ func TestProxyStore_TSDBInfos(t *testing.T) { StoreTSDBInfos: nil, }, &storetestutil.TestClient{ - StoreTSDBInfos: []infopb.TSDBInfo{ - infopb.NewTSDBInfo(0, 10, []labelpb.ZLabel{{Name: "lbl", Value: "val1"}}), + StoreTSDBInfos: []*infopb.TSDBInfo{ + infopb.NewTSDBInfo(0, 10, labelpb.FromStrings("lbl", "val1")), }, }, &storetestutil.TestClient{ - StoreTSDBInfos: []infopb.TSDBInfo{ - infopb.NewTSDBInfo(0, 20, []labelpb.ZLabel{{Name: "lbl", Value: "val2"}}), + StoreTSDBInfos: []*infopb.TSDBInfo{ + infopb.NewTSDBInfo(0, 20, labelpb.Labels{{Name: "lbl", Value: "val2"}}), }, }, } q := NewProxyStore(nil, nil, func() []Client { return stores }, - component.Query, labels.EmptyLabels(), 0*time.Second, EagerRetrieval, + component.Query, labelpb.EmptyLabels(), 0*time.Second, EagerRetrieval, ) - expected := []infopb.TSDBInfo{ - infopb.NewTSDBInfo(0, 10, []labelpb.ZLabel{{Name: "lbl", Value: "val1"}}), - infopb.NewTSDBInfo(0, 20, []labelpb.ZLabel{{Name: "lbl", Value: "val2"}}), + expected := []*infopb.TSDBInfo{ + infopb.NewTSDBInfo(0, 10, labelpb.Labels{{Name: "lbl", Value: "val1"}}), + infopb.NewTSDBInfo(0, 20, labelpb.Labels{{Name: "lbl", Value: "val2"}}), } - testutil.Equals(t, expected, q.TSDBInfos()) + thanostestutil.ProtoEquals(t, expected, q.TSDBInfos()) } func TestProxyStore_Series(t *testing.T) { @@ -108,7 +109,7 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "a", Value: "a", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "a", Value: "a", Type: storepb.LabelMatcher_EQ}}, }, expectedWarningsLen: 0, // No store matched for this query. }, @@ -118,7 +119,7 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), }, }, MinTime: 1, @@ -128,7 +129,7 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 301, MaxTime: 400, - Matchers: []storepb.LabelMatcher{{Name: "a", Value: "a", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "a", Value: "a", Type: storepb.LabelMatcher_EQ}}, }, expectedWarningsLen: 0, // No store matched for this query. }, @@ -138,18 +139,18 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), }, }, MinTime: 1, MaxTime: 300, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, }, }, req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "2", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "2", Type: storepb.LabelMatcher_EQ}}, }, expectedWarningsLen: 0, // No store matched for this query. }, @@ -159,22 +160,22 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), }, }, MinTime: 1, MaxTime: 300, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, }, }, req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "a"), + lset: labelpb.FromStrings("a", "a"), chunks: [][]sample{{{0, 0}, {2, 1}, {3, 2}}}, }, }, @@ -185,7 +186,7 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "a"), []sample{{4, 3}}, []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "a"), []sample{{4, 3}}, []sample{{0, 0}, {2, 1}, {3, 2}}), }, }, MinTime: 1, @@ -195,11 +196,11 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "a"), + lset: labelpb.FromStrings("a", "a"), chunks: [][]sample{{{0, 0}, {2, 1}, {3, 2}}, {{4, 3}}}, }, }, @@ -210,7 +211,7 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), }, }, MinTime: 1, @@ -221,7 +222,7 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, }, }, { @@ -230,7 +231,7 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), }, }, MinTime: 1, @@ -240,12 +241,12 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "a", Value: "b", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "a", Value: "b", Type: storepb.LabelMatcher_EQ}}, }, expectedSeries: []rawSeries{ { // We did not ask for a=a, but we trust StoreAPI will match correctly, so proxy does check any of this. - lset: labels.FromStrings("a", "a"), + lset: labelpb.FromStrings("a", "a"), chunks: [][]sample{{{0, 0}, {2, 1}, {3, 2}}}, }, }, @@ -256,10 +257,10 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}, []sample{{4, 3}}), - storeSeriesResponse(t, labels.FromStrings("a", "a"), []sample{{5, 4}}), // Continuations of the same series. + storeSeriesResponse(t, labelpb.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}, []sample{{4, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "a"), []sample{{5, 4}}), // Continuations of the same series. storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{2, 2}, {3, 3}, {4, 4}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{2, 2}, {3, 3}, {4, 4}}), }, }, MinTime: 1, @@ -268,7 +269,7 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, MinTime: 1, @@ -286,7 +287,7 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "c"), []sample{{100, 1}, {300, 3}, {400, 4}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "c"), []sample{{100, 1}, {300, 3}, {400, 4}}), }, }, MinTime: 1, @@ -295,7 +296,7 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "outside"), []sample{{1, 1}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "outside"), []sample{{1, 1}}), }, }, // Outside range for store itself. @@ -306,19 +307,19 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "a"), + lset: labelpb.FromStrings("a", "a"), chunks: [][]sample{{{0, 0}, {2, 1}, {3, 2}}, {{4, 3}}, {{5, 4}}}, }, { - lset: labels.FromStrings("a", "b"), + lset: labelpb.FromStrings("a", "b"), chunks: [][]sample{{{1, 1}, {2, 2}, {3, 3}}, {{2, 2}, {3, 3}, {4, 4}}}, }, { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{{{100, 1}, {300, 3}, {400, 4}}}, }, }, @@ -330,32 +331,32 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), }, }, MinTime: 1, MaxTime: 300, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, }, &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "a"), []sample{{1, 4}, {2, 5}, {3, 6}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "a"), []sample{{1, 4}, {2, 5}, {3, 6}}), }, }, MinTime: 1, MaxTime: 300, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, }, }, req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "a"), + lset: labelpb.FromStrings("a", "a"), chunks: [][]sample{{{0, 0}, {2, 1}, {3, 2}}, {{1, 4}, {2, 5}, {3, 6}}}, }, }, @@ -366,46 +367,46 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "1", "w", "1"), []sample{{5, 5}, {7, 7}}), - storeSeriesResponse(t, labels.FromStrings("a", "1", "w", "1"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("a", "1", "w", "1"), []sample{{5, 5}, {6, 6}, {7, 7}}), - storeSeriesResponse(t, labels.FromStrings("a", "1", "x", "1"), []sample{{2, 2}, {3, 3}, {4, 4}}, []sample{{1, 1}, {2, 2}, {3, 3}}), - storeSeriesResponse(t, labels.FromStrings("a", "1", "x", "1"), []sample{{100, 1}, {300, 3}, {400, 4}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "1", "w", "1"), []sample{{5, 5}, {7, 7}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "1", "w", "1"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "1", "w", "1"), []sample{{5, 5}, {6, 6}, {7, 7}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "1", "x", "1"), []sample{{2, 2}, {3, 3}, {4, 4}}, []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "1", "x", "1"), []sample{{100, 1}, {300, 3}, {400, 4}}), }, }, MinTime: 1, MaxTime: 300, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, }, &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "1", "w", "1"), []sample{{2, 1}}), - storeSeriesResponse(t, labels.FromStrings("a", "1", "w", "1"), []sample{{5, 5}, {6, 6}, {7, 7}}), - storeSeriesResponse(t, labels.FromStrings("a", "1", "x", "2"), []sample{{10, 10}, {30, 30}, {40, 40}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "1", "w", "1"), []sample{{2, 1}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "1", "w", "1"), []sample{{5, 5}, {6, 6}, {7, 7}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "1", "x", "2"), []sample{{10, 10}, {30, 30}, {40, 40}}), }, }, MinTime: 1, MaxTime: 300, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, }, }, req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "1", "w", "1"), + lset: labelpb.FromStrings("a", "1", "w", "1"), chunks: [][]sample{{{0, 0}, {2, 1}, {3, 2}}, {{2, 1}}, {{5, 5}, {6, 6}, {7, 7}}, {{5, 5}, {7, 7}}}, }, { - lset: labels.FromStrings("a", "1", "x", "1"), + lset: labelpb.FromStrings("a", "1", "x", "1"), chunks: [][]sample{{{1, 1}, {2, 2}, {3, 3}}, {{2, 2}, {3, 3}, {4, 4}}, {{100, 1}, {300, 3}, {400, 4}}}, }, { - lset: labels.FromStrings("a", "1", "x", "2"), + lset: labelpb.FromStrings("a", "1", "x", "2"), chunks: [][]sample{{{10, 10}, {30, 30}, {40, 40}}}, }, }, @@ -416,20 +417,20 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 11}, {2, 22}, {3, 33}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 11}, {2, 22}, {3, 33}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -437,11 +438,11 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "b"), + lset: labelpb.FromStrings("a", "b"), chunks: [][]sample{{{1, 11}, {2, 22}, {3, 33}}, {{1, 1}, {2, 2}, {3, 3}}}, }, }, @@ -453,10 +454,10 @@ func TestProxyStore_Series(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -464,7 +465,7 @@ func TestProxyStore_Series(t *testing.T) { StoreClient: &mockedStoreAPI{ RespError: errors.New("error!"), }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -472,11 +473,11 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "b"), + lset: labelpb.FromStrings("a", "b"), chunks: [][]sample{{{1, 1}, {2, 2}, {3, 3}}}, }, }, @@ -489,10 +490,10 @@ func TestProxyStore_Series(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -500,7 +501,7 @@ func TestProxyStore_Series(t *testing.T) { StoreClient: &mockedStoreAPI{ RespError: errors.New("error!"), }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -508,7 +509,7 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, PartialResponseDisabled: true, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT, }, @@ -521,10 +522,10 @@ func TestProxyStore_Series(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -532,10 +533,10 @@ func TestProxyStore_Series(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -543,7 +544,7 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, PartialResponseDisabled: true, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT, }, @@ -555,10 +556,10 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, GroupKeyStr: "group1", @@ -568,7 +569,7 @@ func TestProxyStore_Series(t *testing.T) { StoreClient: &mockedStoreAPI{ RespError: errors.New("error!"), }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, GroupKeyStr: "group1", @@ -577,10 +578,10 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, GroupKeyStr: "group2", @@ -590,7 +591,7 @@ func TestProxyStore_Series(t *testing.T) { StoreClient: &mockedStoreAPI{ RespError: errors.New("error!"), }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, GroupKeyStr: "group2", @@ -600,12 +601,12 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, PartialResponseStrategy: storepb.PartialResponseStrategy_GROUP_REPLICA, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "b"), + lset: labelpb.FromStrings("a", "b"), chunks: [][]sample{{{1, 1}, {2, 2}, {3, 3}}}, }, }, @@ -618,7 +619,7 @@ func TestProxyStore_Series(t *testing.T) { StoreClient: &mockedStoreAPI{ RespError: errors.New("error!"), }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, GroupKeyStr: "group1", @@ -628,7 +629,7 @@ func TestProxyStore_Series(t *testing.T) { StoreClient: &mockedStoreAPI{ RespError: errors.New("error!"), }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, GroupKeyStr: "group1", @@ -638,7 +639,7 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, PartialResponseStrategy: storepb.PartialResponseStrategy_GROUP_REPLICA, }, expectedErr: errors.New("fetch series for {ext=\"1\"} : error!"), @@ -650,7 +651,7 @@ func TestProxyStore_Series(t *testing.T) { StoreClient: &mockedStoreAPI{ RespError: errors.New("error!"), }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, GroupKeyStr: "group1", @@ -659,10 +660,10 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, GroupKeyStr: "group1", @@ -672,12 +673,12 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, PartialResponseStrategy: storepb.PartialResponseStrategy_GROUP_REPLICA, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "b"), + lset: labelpb.FromStrings("a", "b"), chunks: [][]sample{{{1, 1}, {2, 2}, {3, 3}}}, }, }, @@ -690,7 +691,7 @@ func TestProxyStore_Series(t *testing.T) { StoreClient: &mockedStoreAPI{ RespError: errors.New("error!"), }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, GroupKeyStr: "group1", @@ -700,7 +701,7 @@ func TestProxyStore_Series(t *testing.T) { StoreClient: &mockedStoreAPI{ RespError: errors.New("error!"), }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, GroupKeyStr: "group1", @@ -710,7 +711,7 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, PartialResponseStrategy: storepb.PartialResponseStrategy_GROUP_REPLICA, }, expectedErr: errors.New("fetch series for {ext=\"1\"} : error!"), @@ -723,10 +724,10 @@ func TestProxyStore_Series(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, GroupKeyStr: "group1", @@ -735,10 +736,10 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, GroupKeyStr: "group1", @@ -748,12 +749,12 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, PartialResponseStrategy: storepb.PartialResponseStrategy_GROUP_REPLICA, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "b"), + lset: labelpb.FromStrings("a", "b"), chunks: [][]sample{{{1, 1}, {2, 2}, {3, 3}}}, }, }, @@ -767,10 +768,10 @@ func TestProxyStore_Series(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, GroupKeyStr: "group1", @@ -780,10 +781,10 @@ func TestProxyStore_Series(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, GroupKeyStr: "group1", @@ -793,7 +794,7 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, PartialResponseStrategy: storepb.PartialResponseStrategy_GROUP_REPLICA, }, expectedErr: errors.New("rpc error: code = Aborted desc = warning; warning"), @@ -804,25 +805,25 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), }, }, MinTime: 1, MaxTime: 300, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, Name: "testaddr", }, }, req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, }, storeDebugMatchers: [][]*labels.Matcher{{labels.MustNewMatcher(labels.MatchEqual, "__address__", "testaddr")}}, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "a"), + lset: labelpb.FromStrings("a", "a"), chunks: [][]sample{{{0, 0}, {2, 1}, {3, 2}}}, }, }, @@ -833,19 +834,19 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), }, }, MinTime: 1, MaxTime: 300, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, Name: "testaddr", }, }, req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, }, storeDebugMatchers: [][]*labels.Matcher{{labels.MustNewMatcher(labels.MatchEqual, "__address__", "foo")}}, expectedWarningsLen: 0, // No stores match. @@ -856,20 +857,20 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("a", "c"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "c"), []sample{{0, 0}, {2, 1}, {3, 2}}), }, }, MinTime: 1, MaxTime: 300, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, }, }, req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, ShardInfo: &storepb.ShardInfo{ ShardIndex: 0, TotalShards: 2, @@ -879,11 +880,11 @@ func TestProxyStore_Series(t *testing.T) { }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "a"), + lset: labelpb.FromStrings("a", "a"), chunks: [][]sample{{{0, 0}, {2, 1}, {3, 2}}}, }, { - lset: labels.FromStrings("a", "b"), + lset: labelpb.FromStrings("a", "b"), chunks: [][]sample{{{0, 0}, {2, 1}, {3, 2}}}, }, }, @@ -894,20 +895,20 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ MinTime: 1, MaxTime: 300, - ExtLset: []labels.Labels{labels.FromStrings("ext", "2")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "2")}, StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("zone", "2"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("zone", "2"), []sample{{0, 0}, {2, 1}, {3, 2}}), }, }, }, &storetestutil.TestClient{ MinTime: 1, MaxTime: 300, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("zone", "1"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("zone", "1"), []sample{{0, 0}, {2, 1}, {3, 2}}), }, }, }, @@ -915,7 +916,7 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Name: "zone", Value: ".+", Type: storepb.LabelMatcher_RE}, }, }, @@ -930,7 +931,7 @@ func TestProxyStore_Series(t *testing.T) { `, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("zone", "1"), + lset: labelpb.FromStrings("zone", "1"), chunks: [][]sample{{{0, 0}, {2, 1}, {3, 2}}}, }, }, @@ -941,39 +942,39 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ MinTime: 1, MaxTime: 300, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1", "ext2", "2"), labels.FromStrings("ext", "2")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1", "ext2", "2"), labelpb.FromStrings("ext", "2")}, StoreClient: storepb.ServerAsClient(NewProxyStore(log.NewNopLogger(), prometheus.NewRegistry(), func() []Client { return []Client{ &storetestutil.TestClient{ MinTime: 1, MaxTime: 300, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1", "ext2", "2")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1", "ext2", "2")}, StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("zone", "1"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("zone", "1"), []sample{{0, 0}, {2, 1}, {3, 2}}), }, }, }, &storetestutil.TestClient{ MinTime: 1, MaxTime: 300, - ExtLset: []labels.Labels{labels.FromStrings("ext", "2")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "2")}, StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("zone", "2"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("zone", "2"), []sample{{0, 0}, {2, 1}, {3, 2}}), }, }, }, } - }, component.Store, labels.FromStrings("role", "proxy"), 1*time.Minute, EagerRetrieval)), + }, component.Store, labelpb.FromStrings("role", "proxy"), 1*time.Minute, EagerRetrieval)), }, &storetestutil.TestClient{ MinTime: 1, MaxTime: 300, - ExtLset: []labels.Labels{labels.FromStrings("ext", "3")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "3")}, StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("zone", "3"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("zone", "3"), []sample{{0, 0}, {2, 1}, {3, 2}}), }, }, }, @@ -981,7 +982,7 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Name: "zone", Value: ".+", Type: storepb.LabelMatcher_RE}, }, }, @@ -996,11 +997,11 @@ func TestProxyStore_Series(t *testing.T) { `, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("zone", "1"), + lset: labelpb.FromStrings("zone", "1"), chunks: [][]sample{{{0, 0}, {2, 1}, {3, 2}}}, }, { - lset: labels.FromStrings("zone", "3"), + lset: labelpb.FromStrings("zone", "3"), chunks: [][]sample{{{0, 0}, {2, 1}, {3, 2}}}, }, }, @@ -1011,8 +1012,8 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "1")), - storeSeriesResponse(t, labels.FromStrings("a", "2")), + storeSeriesResponse(t, labelpb.FromStrings("a", "1")), + storeSeriesResponse(t, labelpb.FromStrings("a", "2")), }, }, MinTime: 1, @@ -1021,8 +1022,8 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "3")), - storeSeriesResponse(t, labels.FromStrings("a", "4")), + storeSeriesResponse(t, labelpb.FromStrings("a", "3")), + storeSeriesResponse(t, labelpb.FromStrings("a", "4")), }, }, MinTime: 1, @@ -1032,16 +1033,16 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "a", Value: "[1-4]", Type: storepb.LabelMatcher_RE}}, + Matchers: []*storepb.LabelMatcher{{Name: "a", Value: "[1-4]", Type: storepb.LabelMatcher_RE}}, SkipChunks: true, Limit: 2, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "1"), + lset: labelpb.FromStrings("a", "1"), }, { - lset: labels.FromStrings("a", "2"), + lset: labelpb.FromStrings("a", "2"), }, }, }, @@ -1051,7 +1052,7 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("__name__", "high_cardinality_metric"), []sample{{0, 0}, {2, 1}}), + storeSeriesResponse(t, labelpb.FromStrings("__name__", "high_cardinality_metric"), []sample{{0, 0}, {2, 1}}), }, }, MinTime: 1, @@ -1061,7 +1062,7 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Name: "__name__", Value: "high_cardinality_metric", Type: storepb.LabelMatcher_EQ}, }, }, @@ -1073,7 +1074,7 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("__name__", "high_cardinality_metric", "job", "my_job"), []sample{{0, 0}, {2, 1}}), + storeSeriesResponse(t, labelpb.FromStrings("__name__", "high_cardinality_metric", "job", "my_job"), []sample{{0, 0}, {2, 1}}), }, }, MinTime: 1, @@ -1083,7 +1084,7 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Name: "__name__", Value: "high_cardinality_metric", Type: storepb.LabelMatcher_EQ}, {Name: "job", Value: "my_job", Type: storepb.LabelMatcher_EQ}, }, @@ -1091,7 +1092,7 @@ func TestProxyStore_Series(t *testing.T) { blockedPatterns: []string{"phigh_cardinality_"}, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("__name__", "high_cardinality_metric", "job", "my_job"), + lset: labelpb.FromStrings("__name__", "high_cardinality_metric", "job", "my_job"), chunks: [][]sample{{{0, 0}, {2, 1}}}, }, }, @@ -1102,7 +1103,7 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("__name__", "low_cardinality_metric"), []sample{{0, 0}, {2, 1}}), + storeSeriesResponse(t, labelpb.FromStrings("__name__", "low_cardinality_metric"), []sample{{0, 0}, {2, 1}}), }, }, MinTime: 1, @@ -1112,14 +1113,14 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Name: "__name__", Value: "low_cardinality_metric", Type: storepb.LabelMatcher_EQ}, }, }, blockedPatterns: []string{"phigh_cardinality_"}, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("__name__", "low_cardinality_metric"), + lset: labelpb.FromStrings("__name__", "low_cardinality_metric"), chunks: [][]sample{{{0, 0}, {2, 1}}}, }, }, @@ -1130,7 +1131,7 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("job", "my_job"), []sample{{0, 0}, {2, 1}}), + storeSeriesResponse(t, labelpb.FromStrings("job", "my_job"), []sample{{0, 0}, {2, 1}}), }, }, MinTime: 1, @@ -1140,14 +1141,14 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Name: "job", Value: "my_job", Type: storepb.LabelMatcher_EQ}, }, }, blockedPatterns: []string{"phigh_cardinality_"}, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("job", "my_job"), + lset: labelpb.FromStrings("job", "my_job"), chunks: [][]sample{{{0, 0}, {2, 1}}}, }, }, @@ -1158,7 +1159,7 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("__name__", "high_cardinality_metric"), []sample{{0, 0}, {2, 1}}), + storeSeriesResponse(t, labelpb.FromStrings("__name__", "high_cardinality_metric"), []sample{{0, 0}, {2, 1}}), }, }, MinTime: 1, @@ -1168,14 +1169,14 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Name: "__name__", Value: "high_cardinality_metric", Type: storepb.LabelMatcher_EQ}, }, }, blockedPatterns: []string{}, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("__name__", "high_cardinality_metric"), + lset: labelpb.FromStrings("__name__", "high_cardinality_metric"), chunks: [][]sample{{{0, 0}, {2, 1}}}, }, }, @@ -1186,7 +1187,7 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("__name__", "uptime_seconds"), []sample{{0, 0}, {2, 1}}), + storeSeriesResponse(t, labelpb.FromStrings("__name__", "uptime_seconds"), []sample{{0, 0}, {2, 1}}), }, }, MinTime: 1, @@ -1196,14 +1197,14 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Name: "__name__", Value: "uptime_seconds", Type: storepb.LabelMatcher_EQ}, }, }, blockedPatterns: []string{"eup"}, // exact match pattern expectedSeries: []rawSeries{ { - lset: labels.FromStrings("__name__", "uptime_seconds"), + lset: labelpb.FromStrings("__name__", "uptime_seconds"), chunks: [][]sample{{{0, 0}, {2, 1}}}, }, }, @@ -1214,7 +1215,7 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("__name__", "up"), []sample{{0, 0}, {2, 1}}), + storeSeriesResponse(t, labelpb.FromStrings("__name__", "up"), []sample{{0, 0}, {2, 1}}), }, }, MinTime: 1, @@ -1224,7 +1225,7 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Name: "__name__", Value: "up", Type: storepb.LabelMatcher_EQ}, }, }, @@ -1237,7 +1238,7 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("__name__", "up", "job", "my_job"), []sample{{0, 0}, {2, 1}}), + storeSeriesResponse(t, labelpb.FromStrings("__name__", "up", "job", "my_job"), []sample{{0, 0}, {2, 1}}), }, }, MinTime: 1, @@ -1247,7 +1248,7 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Name: "__name__", Value: "up", Type: storepb.LabelMatcher_EQ}, {Name: "job", Value: "my_job", Type: storepb.LabelMatcher_EQ}, }, @@ -1261,7 +1262,7 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("__name__", "up"), []sample{{0, 0}, {2, 1}}), + storeSeriesResponse(t, labelpb.FromStrings("__name__", "up"), []sample{{0, 0}, {2, 1}}), }, }, MinTime: 1, @@ -1271,7 +1272,7 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Name: "__name__", Value: "up", Type: storepb.LabelMatcher_EQ}, }, }, @@ -1285,7 +1286,7 @@ func TestProxyStore_Series(t *testing.T) { // &storetestutil.TestClient{ // StoreClient: &mockedStoreAPI{ // RespSeries: []*storepb.SeriesResponse{ - // storeSeriesResponse(t, labels.FromStrings("__name__", "some_metric"), []sample{{0, 0}, {2, 1}}), + // storeSeriesResponse(t, labelpb.FromStrings("__name__", "some_metric"), []sample{{0, 0}, {2, 1}}), // }, // }, // MinTime: 1, @@ -1295,7 +1296,7 @@ func TestProxyStore_Series(t *testing.T) { // req: &storepb.SeriesRequest{ // MinTime: 1, // MaxTime: 300, - // Matchers: []storepb.LabelMatcher{ + // Matchers: []*storepb.LabelMatcher{ // {Name: "__name__", Value: ".+", Type: storepb.LabelMatcher_RE}, // }, // }, @@ -1308,7 +1309,7 @@ func TestProxyStore_Series(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("__name__", "some_metric"), []sample{{0, 0}, {2, 1}}), + storeSeriesResponse(t, labelpb.FromStrings("__name__", "some_metric"), []sample{{0, 0}, {2, 1}}), }, }, MinTime: 1, @@ -1318,13 +1319,13 @@ func TestProxyStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Name: "__name__", Value: "some_metric", Type: storepb.LabelMatcher_EQ}, }, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("__name__", "some_metric"), + lset: labelpb.FromStrings("__name__", "some_metric"), chunks: [][]sample{{{0, 0}, {2, 1}}}, }, }, @@ -1353,7 +1354,7 @@ func TestProxyStore_Series(t *testing.T) { nil, func() []Client { return tc.storeAPIs }, component.Query, - tc.selectorLabels, + labelpb.FromPromLabels(tc.selectorLabels), 5*time.Second, strategy, options..., ) @@ -1408,14 +1409,14 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, RespDuration: 2 * time.Second, SlowSeriesIndex: 1, injectedError: errors.New("test"), injectedErrorIndex: 1, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1423,26 +1424,26 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), - storeSeriesResponse(t, labels.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), - storeSeriesResponse(t, labels.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), - storeSeriesResponse(t, labels.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), - storeSeriesResponse(t, labels.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), - storeSeriesResponse(t, labels.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), - storeSeriesResponse(t, labels.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), - storeSeriesResponse(t, labels.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), - storeSeriesResponse(t, labels.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), - storeSeriesResponse(t, labels.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), - storeSeriesResponse(t, labels.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), - storeSeriesResponse(t, labels.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), - storeSeriesResponse(t, labels.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), - storeSeriesResponse(t, labels.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), - storeSeriesResponse(t, labels.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "a"), []sample{{4, 1}, {5, 2}, {6, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1450,7 +1451,7 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, PartialResponseDisabled: true, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT, }, @@ -1463,11 +1464,11 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { Name: "test", StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, RespDuration: 10 * time.Second, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1475,10 +1476,10 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { Name: "test", StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1486,7 +1487,7 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, PartialResponseDisabled: true, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT, }, @@ -1498,21 +1499,21 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, RespDuration: 10 * time.Second, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1520,7 +1521,7 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, PartialResponseDisabled: true, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT, }, @@ -1533,14 +1534,14 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{3, 1}, {4, 2}, {5, 3}}), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{6, 1}, {7, 2}, {8, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{3, 1}, {4, 2}, {5, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{6, 1}, {7, 2}, {8, 3}}), }, RespDuration: 10 * time.Second, SlowSeriesIndex: 2, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1548,10 +1549,10 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1559,7 +1560,7 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, PartialResponseDisabled: true, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT, }, @@ -1571,25 +1572,25 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{3, 1}, {4, 2}, {5, 3}}), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{6, 1}, {7, 2}, {8, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{3, 1}, {4, 2}, {5, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{6, 1}, {7, 2}, {8, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{3, 1}, {4, 2}, {5, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{3, 1}, {4, 2}, {5, 3}}), }, RespDuration: 10 * time.Second, SlowSeriesIndex: 2, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1597,7 +1598,7 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, PartialResponseDisabled: true, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT, }, @@ -1610,11 +1611,11 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, RespDuration: 10 * time.Second, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1622,10 +1623,10 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("b", "c"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "c"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1633,11 +1634,11 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("b", "c"), + lset: labelpb.FromStrings("b", "c"), chunks: [][]sample{{{1, 1}, {2, 2}, {3, 3}}}, }, }, @@ -1650,10 +1651,10 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1661,11 +1662,11 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("b", "c"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "c"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, RespDuration: 10 * time.Second, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1673,11 +1674,11 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "b"), + lset: labelpb.FromStrings("a", "b"), chunks: [][]sample{{{1, 1}, {2, 2}, {3, 3}}}, }, }, @@ -1690,10 +1691,10 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1701,11 +1702,11 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("b", "c"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "c"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, RespDuration: 10 * time.Second, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1713,11 +1714,11 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("c", "d"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("c", "d"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, RespDuration: 10 * time.Second, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1725,10 +1726,10 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("d", "f"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("d", "f"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1736,15 +1737,15 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "b"), + lset: labelpb.FromStrings("a", "b"), chunks: [][]sample{{{1, 1}, {2, 2}, {3, 3}}}, }, { - lset: labels.FromStrings("d", "f"), + lset: labelpb.FromStrings("d", "f"), chunks: [][]sample{{{1, 1}, {2, 2}, {3, 3}}}, }, }, @@ -1757,14 +1758,14 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{4, 1}, {5, 2}, {6, 3}}), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{7, 1}, {8, 2}, {9, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{7, 1}, {8, 2}, {9, 3}}), }, RespDuration: 10 * time.Second, SlowSeriesIndex: 2, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1772,10 +1773,10 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ storepb.NewWarnSeriesResponse(errors.New("warning")), - storeSeriesResponse(t, labels.FromStrings("b", "c"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "c"), []sample{{1, 1}, {2, 2}, {3, 3}}), }, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1783,15 +1784,15 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "b"), + lset: labelpb.FromStrings("a", "b"), chunks: [][]sample{{{1, 1}, {2, 2}, {3, 3}}}, }, { - lset: labels.FromStrings("b", "c"), + lset: labelpb.FromStrings("b", "c"), chunks: [][]sample{{{1, 1}, {2, 2}, {3, 3}}}, }, }, @@ -1804,13 +1805,13 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { Name: "test", StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{4, 1}, {5, 2}, {6, 3}}), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{7, 1}, {8, 2}, {9, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{7, 1}, {8, 2}, {9, 3}}), }, RespDuration: 3 * time.Second, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1818,13 +1819,13 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, PartialResponseDisabled: true, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "b"), + lset: labelpb.FromStrings("a", "b"), chunks: [][]sample{{{1, 1}, {2, 2}, {3, 3}}}, }, }, @@ -1836,26 +1837,26 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{4, 1}, {5, 2}, {6, 3}}), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{7, 1}, {8, 2}, {9, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{7, 1}, {8, 2}, {9, 3}}), }, RespDuration: 3 * time.Second, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("b", "c"), []sample{{1, 1}, {2, 2}, {3, 3}}), - storeSeriesResponse(t, labels.FromStrings("b", "c"), []sample{{4, 1}, {5, 2}, {6, 3}}), - storeSeriesResponse(t, labels.FromStrings("b", "c"), []sample{{7, 1}, {8, 2}, {9, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "c"), []sample{{1, 1}, {2, 2}, {3, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "c"), []sample{{4, 1}, {5, 2}, {6, 3}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "c"), []sample{{7, 1}, {8, 2}, {9, 3}}), }, RespDuration: 3 * time.Second, }, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1863,15 +1864,15 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "b"), + lset: labelpb.FromStrings("a", "b"), chunks: [][]sample{{{1, 1}, {2, 2}, {3, 3}}}, }, { - lset: labels.FromStrings("b", "c"), + lset: labelpb.FromStrings("b", "c"), chunks: [][]sample{{{1, 1}, {2, 2}, {3, 3}}}, }, }, @@ -1889,7 +1890,7 @@ func TestProxyStore_SeriesSlowStores(t *testing.T) { nil, func() []Client { return tc.storeAPIs }, component.Query, - tc.selectorLabels, + labelpb.FromPromLabels(tc.selectorLabels), 4*time.Second, strategy, options..., ) @@ -1935,7 +1936,7 @@ func TestProxyStore_Series_RequestParamsProxied(t *testing.T) { cls := []Client{ &storetestutil.TestClient{ StoreClient: m, - ExtLset: []labels.Labels{labels.FromStrings("ext", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext", "1")}, MinTime: 1, MaxTime: 300, }, @@ -1944,7 +1945,7 @@ func TestProxyStore_Series_RequestParamsProxied(t *testing.T) { nil, func() []Client { return cls }, component.Query, - labels.EmptyLabels(), + labelpb.EmptyLabels(), 1*time.Second, EagerRetrieval, ) @@ -1954,7 +1955,7 @@ func TestProxyStore_Series_RequestParamsProxied(t *testing.T) { req := &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, + Matchers: []*storepb.LabelMatcher{{Name: "ext", Value: "1", Type: storepb.LabelMatcher_EQ}}, PartialResponseDisabled: false, Aggregates: []storepb.Aggr{ storepb.Aggr_COUNTER, @@ -1965,7 +1966,7 @@ func TestProxyStore_Series_RequestParamsProxied(t *testing.T) { } testutil.Ok(t, q.Series(req, s)) - testutil.Assert(t, proto.Equal(req, m.LastSeriesReq), "request was not proxied properly to underlying storeAPI: %s vs %s", req, m.LastSeriesReq) + testutil.Assert(t, req.EqualVT(m.LastSeriesReq), "request was not proxied properly to underlying storeAPI: %s vs %s", req, m.LastSeriesReq) } func TestProxyStore_Series_RegressionFillResponseChannel(t *testing.T) { @@ -2005,7 +2006,7 @@ func TestProxyStore_Series_RegressionFillResponseChannel(t *testing.T) { nil, func() []Client { return cls }, component.Query, - labels.FromStrings("fed", "a"), + labelpb.FromStrings("fed", "a"), 5*time.Second, EagerRetrieval, ) @@ -2016,7 +2017,7 @@ func TestProxyStore_Series_RegressionFillResponseChannel(t *testing.T) { &storepb.SeriesRequest{ MinTime: 1, MaxTime: 300, - Matchers: []storepb.LabelMatcher{{Name: "any", Value: ".*", Type: storepb.LabelMatcher_RE}}, + Matchers: []*storepb.LabelMatcher{{Name: "any", Value: ".*", Type: storepb.LabelMatcher_RE}}, PartialResponseStrategy: storepb.PartialResponseStrategy_WARN, }, s, )) @@ -2103,7 +2104,7 @@ func TestProxyStore_LabelValues(t *testing.T) { nil, func() []Client { return tc.storeAPIs }, component.Query, - labels.EmptyLabels(), + labelpb.EmptyLabels(), 0*time.Second, EagerRetrieval, ) @@ -2116,7 +2117,7 @@ func TestProxyStore_LabelValues(t *testing.T) { return } testutil.Ok(t, err) - testutil.Assert(t, proto.Equal(tc.req, m1.LastLabelValuesReq), "request was not proxied properly to underlying storeAPI: %s vs %s", tc.req, m1.LastLabelValuesReq) + testutil.Assert(t, tc.req.EqualVT(m1.LastLabelValuesReq), "request was not proxied properly to underlying storeAPI: %s vs %s", tc.req, m1.LastLabelValuesReq) testutil.Equals(t, tc.expectedValues, resp.Values) testutil.Equals(t, tc.expectedWarningsLen, len(resp.Warnings), "got %v", resp.Warnings) @@ -2320,7 +2321,7 @@ func TestProxyStore_LabelNames(t *testing.T) { nil, func() []Client { return tc.storeAPIs }, component.Query, - labels.EmptyLabels(), + labelpb.EmptyLabels(), 5*time.Second, EagerRetrieval, ) @@ -2345,17 +2346,17 @@ func TestProxyStore_LabelNames(t *testing.T) { } type rawSeries struct { - lset labels.Labels + lset labelpb.Labels chunks [][]sample } -func seriesEquals(t *testing.T, expected []rawSeries, got []storepb.Series) { +func seriesEquals(t *testing.T, expected []rawSeries, got []*storepb.Series) { testutil.Equals(t, len(expected), len(got), "got unexpected number of series: \n want: %v \n got: %v", expected, got) ret := make([]rawSeries, len(got)) for i, s := range got { r := rawSeries{ - lset: labelpb.ZLabelsToPromLabels(s.Labels), + lset: labelpb.Labels(s.Labels), } for _, chk := range s.Chunks { var samples []sample @@ -2376,7 +2377,7 @@ func seriesEquals(t *testing.T, expected []rawSeries, got []storepb.Series) { } for i := range ret { - testutil.Equals(t, expected[i], ret[i]) + thanostestutil.ProtoEqualsWithOptions(t, expected[i], ret[i], cmp.Options{cmp.AllowUnexported(rawSeries{}, sample{})}) } } @@ -2392,7 +2393,7 @@ func TestStoreMatches(t *testing.T) { expectedReason string }{ { - s: &storetestutil.TestClient{ExtLset: []labels.Labels{labels.FromStrings("a", "b")}}, + s: &storetestutil.TestClient{ExtLset: []labelpb.Labels{labelpb.FromStrings("a", "b")}}, ms: []*labels.Matcher{ labels.MustNewMatcher(labels.MatchEqual, "b", "1"), }, @@ -2401,7 +2402,7 @@ func TestStoreMatches(t *testing.T) { expectedReason: "does not have data within this time period: [0,-1]. Store time ranges: [0,0]", }, { - s: &storetestutil.TestClient{ExtLset: []labels.Labels{labels.FromStrings("a", "b")}}, + s: &storetestutil.TestClient{ExtLset: []labelpb.Labels{labelpb.FromStrings("a", "b")}}, ms: []*labels.Matcher{ labels.MustNewMatcher(labels.MatchEqual, "b", "1"), }, @@ -2435,7 +2436,7 @@ func TestStoreMatches(t *testing.T) { expectedMatch: true, }, { - s: &storetestutil.TestClient{ExtLset: []labels.Labels{labels.FromStrings("a", "b")}}, + s: &storetestutil.TestClient{ExtLset: []labelpb.Labels{labelpb.FromStrings("a", "b")}}, ms: []*labels.Matcher{ labels.MustNewMatcher(labels.MatchEqual, "a", "b"), }, @@ -2443,7 +2444,7 @@ func TestStoreMatches(t *testing.T) { expectedMatch: true, }, { - s: &storetestutil.TestClient{ExtLset: []labels.Labels{labels.FromStrings("a", "b")}}, + s: &storetestutil.TestClient{ExtLset: []labelpb.Labels{labelpb.FromStrings("a", "b")}}, ms: []*labels.Matcher{ labels.MustNewMatcher(labels.MatchEqual, "a", "c"), }, @@ -2452,7 +2453,7 @@ func TestStoreMatches(t *testing.T) { expectedReason: "external labels [{a=\"b\"}] does not match request label matchers: [a=\"c\"]", }, { - s: &storetestutil.TestClient{ExtLset: []labels.Labels{labels.FromStrings("a", "b")}}, + s: &storetestutil.TestClient{ExtLset: []labelpb.Labels{labelpb.FromStrings("a", "b")}}, ms: []*labels.Matcher{ labels.MustNewMatcher(labels.MatchRegexp, "a", "b|c"), }, @@ -2460,7 +2461,7 @@ func TestStoreMatches(t *testing.T) { expectedMatch: true, }, { - s: &storetestutil.TestClient{ExtLset: []labels.Labels{labels.FromStrings("a", "b")}}, + s: &storetestutil.TestClient{ExtLset: []labelpb.Labels{labelpb.FromStrings("a", "b")}}, ms: []*labels.Matcher{ labels.MustNewMatcher(labels.MatchNotRegexp, "a", ""), }, @@ -2468,10 +2469,10 @@ func TestStoreMatches(t *testing.T) { expectedMatch: true, }, { - s: &storetestutil.TestClient{ExtLset: []labels.Labels{ - labels.FromStrings("a", "b"), - labels.FromStrings("a", "c"), - labels.FromStrings("a", "d"), + s: &storetestutil.TestClient{ExtLset: []labelpb.Labels{ + labelpb.FromStrings("a", "b"), + labelpb.FromStrings("a", "c"), + labelpb.FromStrings("a", "d"), }}, ms: []*labels.Matcher{ labels.MustNewMatcher(labels.MatchEqual, "a", "e"), @@ -2481,10 +2482,10 @@ func TestStoreMatches(t *testing.T) { expectedReason: "external labels [{a=\"b\"} {a=\"c\"} {a=\"d\"}] does not match request label matchers: [a=\"e\"]", }, { - s: &storetestutil.TestClient{ExtLset: []labels.Labels{ - labels.FromStrings("a", "b"), - labels.FromStrings("a", "c"), - labels.FromStrings("a", "d"), + s: &storetestutil.TestClient{ExtLset: []labelpb.Labels{ + labelpb.FromStrings("a", "b"), + labelpb.FromStrings("a", "c"), + labelpb.FromStrings("a", "d"), }}, ms: []*labels.Matcher{ labels.MustNewMatcher(labels.MatchEqual, "a", "c"), @@ -2493,10 +2494,10 @@ func TestStoreMatches(t *testing.T) { expectedMatch: true, }, { - s: &storetestutil.TestClient{ExtLset: []labels.Labels{ - labels.FromStrings("a", "b"), - labels.FromStrings("a", "c"), - labels.FromStrings("a", "d"), + s: &storetestutil.TestClient{ExtLset: []labelpb.Labels{ + labelpb.FromStrings("a", "b"), + labelpb.FromStrings("a", "c"), + labelpb.FromStrings("a", "d"), }}, ms: []*labels.Matcher{ labels.MustNewMatcher(labels.MatchNotRegexp, "a", ""), @@ -2505,7 +2506,7 @@ func TestStoreMatches(t *testing.T) { expectedMatch: true, }, { - s: &storetestutil.TestClient{ExtLset: []labels.Labels{labels.FromStrings("a", "b")}}, + s: &storetestutil.TestClient{ExtLset: []labelpb.Labels{labelpb.FromStrings("a", "b")}}, ms: []*labels.Matcher{ labels.MustNewMatcher(labels.MatchEqual, "a", "b"), labels.MustNewMatcher(labels.MatchEqual, labels.MetricName, "test_metric_name"), @@ -2515,8 +2516,8 @@ func TestStoreMatches(t *testing.T) { }, { s: &storetestutil.TestClient{ - ExtLset: []labels.Labels{ - labels.FromStrings("a", "b"), + ExtLset: []labelpb.Labels{ + labelpb.FromStrings("a", "b"), }, StoreFilterNotMatches: true, }, @@ -2545,9 +2546,9 @@ type storeSeriesServer struct { ctx context.Context - SeriesSet []storepb.Series + SeriesSet []*storepb.Series Warnings []string - HintsSet []*types.Any + HintsSet []*anypb.Any Size int64 } @@ -2557,7 +2558,7 @@ func newStoreSeriesServer(ctx context.Context) *storeSeriesServer { } func (s *storeSeriesServer) Send(r *storepb.SeriesResponse) error { - s.Size += int64(r.Size()) + s.Size += int64(r.SizeVT()) if r.GetWarning() != "" { s.Warnings = append(s.Warnings, r.GetWarning()) @@ -2565,7 +2566,7 @@ func (s *storeSeriesServer) Send(r *storepb.SeriesResponse) error { } if r.GetSeries() != nil { - s.SeriesSet = append(s.SeriesSet, *r.GetSeries()) + s.SeriesSet = append(s.SeriesSet, r.GetSeries()) return nil } @@ -2619,10 +2620,10 @@ func (s *mockedStoreAPI) LabelValues(_ context.Context, req *storepb.LabelValues } // storeSeriesResponse creates test storepb.SeriesResponse that includes series with single chunk that stores all the given samples. -func storeSeriesResponse(t testing.TB, lset labels.Labels, smplChunks ...[]sample) *storepb.SeriesResponse { - var s storepb.Series - - s.Labels = append(s.Labels, labelpb.ZLabelsFromPromLabels(lset)...) +func storeSeriesResponse(t testing.TB, lset labelpb.Labels, smplChunks ...[]sample) *storepb.SeriesResponse { + s := &storepb.Series{ + Labels: lset, + } for _, smpls := range smplChunks { c := chunkenc.NewXORChunk() @@ -2633,15 +2634,13 @@ func storeSeriesResponse(t testing.TB, lset labels.Labels, smplChunks ...[]sampl a.Append(smpl.t, smpl.v) } - ch := storepb.AggrChunk{ + s.Chunks = append(s.Chunks, &storepb.AggrChunk{ MinTime: smpls[0].t, MaxTime: smpls[len(smpls)-1].t, Raw: &storepb.Chunk{Type: storepb.Chunk_XOR, Data: c.Bytes()}, - } - - s.Chunks = append(s.Chunks, ch) + }) } - return storepb.NewSeriesResponse(&s) + return storepb.NewSeriesResponse(s) } func TestProxySeries(t *testing.T) { @@ -2670,7 +2669,7 @@ func BenchmarkProxySeriesRegex(b *testing.B) { nil, func() []Client { return nil }, component.Query, - labels.EmptyLabels(), 0*time.Second, EagerRetrieval, + labelpb.EmptyLabels(), 0*time.Second, EagerRetrieval, WithMatcherCache(cache), ) @@ -2681,7 +2680,7 @@ func BenchmarkProxySeriesRegex(b *testing.B) { bigRegex.WriteString("|") } - matchers := []storepb.LabelMatcher{ + matchers := []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "foo", Value: ".*"}, {Type: storepb.LabelMatcher_RE, Name: "bar", Value: bigRegex.String()}, } @@ -2756,7 +2755,7 @@ func benchProxySeries(t testutil.TB, totalSamples, totalSeries int) { var allResps []*storepb.SeriesResponse var expected []*storepb.Series - lastLabels := storepb.Series{} + var lastLabels string for _, c := range clients { m := c.(*storetestutil.TestClient).StoreClient.(*mockedStoreAPI) @@ -2765,10 +2764,10 @@ func benchProxySeries(t testutil.TB, totalSamples, totalSeries int) { allResps = append(allResps, r) sr := r.GetSeries() - sr = proto.Clone(sr).(*storepb.Series) + sr = sr.CloneVT() - x := storepb.Series{Labels: sr.Labels} - if x.String() == lastLabels.String() { + x := (&storepb.Series{Labels: sr.Labels}).String() + if x == lastLabels { expected[len(expected)-1].Chunks = append(expected[len(expected)-1].Chunks, sr.Chunks...) continue } @@ -2791,7 +2790,7 @@ func benchProxySeries(t testutil.TB, totalSamples, totalSeries int) { Req: &storepb.SeriesRequest{ MinTime: 0, MaxTime: maxTime, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "foo", Value: "bar"}, }, }, @@ -2806,7 +2805,7 @@ func benchProxySeries(t testutil.TB, totalSamples, totalSeries int) { // All responses. RespSeries: allResps, }, - ExtLset: []labels.Labels{labels.FromStrings("ext1", "1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("ext1", "1")}, MinTime: math.MinInt64, MaxTime: math.MaxInt64, WithoutReplicaLabelsEnabled: true, @@ -2824,7 +2823,7 @@ func benchProxySeries(t testutil.TB, totalSamples, totalSeries int) { Req: &storepb.SeriesRequest{ MinTime: 0, MaxTime: maxTime, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "foo", Value: "bar"}, }, }, @@ -2846,16 +2845,16 @@ func TestProxyStore_NotLeakingOnPrematureFinish(t *testing.T) { StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ // Ensure more than 10 (internal respCh channel). - storeSeriesResponse(t, labels.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("a", "b"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("a", "c"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("a", "d"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("a", "e"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("a", "f"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("a", "g"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("a", "h"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("a", "i"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("a", "j"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "b"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "c"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "d"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "e"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "f"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "g"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "h"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "i"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("a", "j"), []sample{{0, 0}, {2, 1}, {3, 2}}), }, }, MinTime: math.MinInt64, @@ -2864,16 +2863,16 @@ func TestProxyStore_NotLeakingOnPrematureFinish(t *testing.T) { &storetestutil.TestClient{ StoreClient: &mockedStoreAPI{ RespSeries: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("b", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("b", "b"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("b", "c"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("b", "d"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("b", "e"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("b", "f"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("b", "g"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("b", "h"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("b", "i"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("b", "j"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "b"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "c"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "d"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "e"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "f"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "g"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "h"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "i"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "j"), []sample{{0, 0}, {2, 1}, {3, 2}}), }, }, MinTime: math.MinInt64, @@ -2893,7 +2892,7 @@ func TestProxyStore_NotLeakingOnPrematureFinish(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) // We mimic failing series server, but practically context cancel will do the same. - testutil.NotOk(t, p.Series(&storepb.SeriesRequest{Matchers: []storepb.LabelMatcher{{}}, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT}, &mockedSeriesServer{ + testutil.NotOk(t, p.Series(&storepb.SeriesRequest{Matchers: []*storepb.LabelMatcher{{}}, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT}, &mockedSeriesServer{ ctx: ctx, send: func(*storepb.SeriesResponse) error { cancel() @@ -2909,9 +2908,9 @@ func TestProxyStore_NotLeakingOnPrematureFinish(t *testing.T) { StoreClient: storepb.ServerAsClient(&storeServerStub{ delay: 50 * time.Millisecond, responses: []*storepb.SeriesResponse{ - storeSeriesResponse(t, labels.FromStrings("b", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("b", "b"), []sample{{0, 0}, {2, 1}, {3, 2}}), - storeSeriesResponse(t, labels.FromStrings("b", "c"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "a"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "b"), []sample{{0, 0}, {2, 1}, {3, 2}}), + storeSeriesResponse(t, labelpb.FromStrings("b", "c"), []sample{{0, 0}, {2, 1}, {3, 2}}), }, }), MinTime: math.MinInt64, @@ -2930,7 +2929,7 @@ func TestProxyStore_NotLeakingOnPrematureFinish(t *testing.T) { } ctx := context.Background() - err := p.Series(&storepb.SeriesRequest{Matchers: []storepb.LabelMatcher{{}}, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT}, &mockedSeriesServer{ + err := p.Series(&storepb.SeriesRequest{Matchers: []*storepb.LabelMatcher{{}}, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT}, &mockedSeriesServer{ ctx: ctx, send: func(*storepb.SeriesResponse) error { return nil @@ -2944,7 +2943,7 @@ func TestProxyStore_NotLeakingOnPrematureFinish(t *testing.T) { } type storeServerStub struct { - storepb.StoreServer + storepb.UnimplementedStoreServer delay time.Duration responses []*storepb.SeriesResponse @@ -2963,7 +2962,7 @@ func (m *storeServerStub) Series(_ *storepb.SeriesRequest, server storepb.Store_ func TestProxyStore_storeMatchMetadata(t *testing.T) { t.Parallel() - c := storetestutil.TestClient{Name: "testaddr"} + c := &storetestutil.TestClient{Name: "testaddr"} c.IsLocalStore = true ok, reason := storeMatchDebugMetadata(c, true, [][]*labels.Matcher{{}}) @@ -3012,8 +3011,8 @@ func TestDedupRespHeap_Deduplication(t *testing.T) { { Result: &storepb.SeriesResponse_Series{ Series: &storepb.Series{ - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings("foo", "bar")), - Chunks: []storepb.AggrChunk{ + Labels: labelpb.FromStrings("foo", "bar"), + Chunks: []*storepb.AggrChunk{ { Raw: &storepb.Chunk{ Type: storepb.Chunk_XOR, @@ -3028,7 +3027,7 @@ func TestDedupRespHeap_Deduplication(t *testing.T) { testFn: func(responses []*storepb.SeriesResponse, h *responseDeduplicator) { testutil.Equals(t, true, h.Next()) resp := h.At() - testutil.Equals(t, responses[0], resp) + thanostestutil.ProtoEquals(t, responses[0], resp) testutil.Equals(t, false, h.Next()) }, }, @@ -3038,8 +3037,8 @@ func TestDedupRespHeap_Deduplication(t *testing.T) { { Result: &storepb.SeriesResponse_Series{ Series: &storepb.Series{ - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings("foo", "bar")), - Chunks: []storepb.AggrChunk{ + Labels: labelpb.FromStrings("foo", "bar"), + Chunks: []*storepb.AggrChunk{ { Raw: &storepb.Chunk{ Type: storepb.Chunk_XOR, @@ -3053,8 +3052,8 @@ func TestDedupRespHeap_Deduplication(t *testing.T) { { Result: &storepb.SeriesResponse_Series{ Series: &storepb.Series{ - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings("foo", "bar")), - Chunks: []storepb.AggrChunk{ + Labels: labelpb.FromStrings("foo", "bar"), + Chunks: []*storepb.AggrChunk{ { Raw: &storepb.Chunk{ Type: storepb.Chunk_XOR, @@ -3070,7 +3069,7 @@ func TestDedupRespHeap_Deduplication(t *testing.T) { testFn: func(responses []*storepb.SeriesResponse, h *responseDeduplicator) { testutil.Equals(t, true, h.Next()) resp := h.At() - testutil.Equals(t, responses[0], resp) + thanostestutil.ProtoEquals(t, responses[0], resp) testutil.Equals(t, false, h.Next()) }, }, @@ -3107,11 +3106,11 @@ func TestProxyStore_FilterByExclusiveExternalLabels(t *testing.T) { exclusiveExternalLabels: []string{}, stores: []Client{ &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "us-east-1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "us-east-1")}, Name: "store1", }, &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "us-west-1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "us-west-1")}, Name: "store2", }, }, @@ -3125,11 +3124,11 @@ func TestProxyStore_FilterByExclusiveExternalLabels(t *testing.T) { exclusiveExternalLabels: []string{"datacenter"}, stores: []Client{ &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "us-east-1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "us-east-1")}, Name: "store1", }, &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "us-west-1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "us-west-1")}, Name: "store2", }, }, @@ -3143,15 +3142,15 @@ func TestProxyStore_FilterByExclusiveExternalLabels(t *testing.T) { exclusiveExternalLabels: []string{"region"}, stores: []Client{ &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "us-east-1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "us-east-1")}, Name: "store1", }, &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "us-west-1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "us-west-1")}, Name: "store2", }, &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "eu-west-1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "eu-west-1")}, Name: "store3", }, }, @@ -3165,15 +3164,15 @@ func TestProxyStore_FilterByExclusiveExternalLabels(t *testing.T) { exclusiveExternalLabels: []string{"region"}, stores: []Client{ &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "us-east-1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "us-east-1")}, Name: "store1", }, &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "us-west-1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "us-west-1")}, Name: "store2", }, &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "eu-west-1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "eu-west-1")}, Name: "store3", }, }, @@ -3187,15 +3186,15 @@ func TestProxyStore_FilterByExclusiveExternalLabels(t *testing.T) { exclusiveExternalLabels: []string{"region", "datacenter"}, stores: []Client{ &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "us-east-1", "datacenter", "dc1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "us-east-1", "datacenter", "dc1")}, Name: "store1", }, &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "us-west-1", "datacenter", "dc2")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "us-west-1", "datacenter", "dc2")}, Name: "store2", }, &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "eu-west-1", "datacenter", "dc3")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "eu-west-1", "datacenter", "dc3")}, Name: "store3", }, }, @@ -3210,11 +3209,11 @@ func TestProxyStore_FilterByExclusiveExternalLabels(t *testing.T) { exclusiveExternalLabels: []string{"region"}, stores: []Client{ &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "us-east-1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "us-east-1")}, Name: "store1", }, &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "us-west-1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "us-west-1")}, Name: "store2", }, }, @@ -3228,11 +3227,11 @@ func TestProxyStore_FilterByExclusiveExternalLabels(t *testing.T) { exclusiveExternalLabels: []string{"region"}, stores: []Client{ &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "us-east-1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "us-east-1")}, Name: "store1", }, &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "us-west-1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "us-west-1")}, Name: "store2", }, }, @@ -3246,14 +3245,14 @@ func TestProxyStore_FilterByExclusiveExternalLabels(t *testing.T) { exclusiveExternalLabels: []string{"region"}, stores: []Client{ &storetestutil.TestClient{ - ExtLset: []labels.Labels{ - labels.FromStrings("region", "us-east-1", "env", "prod"), - labels.FromStrings("region", "us-west-1", "env", "dev"), + ExtLset: []labelpb.Labels{ + labelpb.FromStrings("region", "us-east-1", "env", "prod"), + labelpb.FromStrings("region", "us-west-1", "env", "dev"), }, Name: "store1", }, &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "eu-west-1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "eu-west-1")}, Name: "store2", }, }, @@ -3268,11 +3267,11 @@ func TestProxyStore_FilterByExclusiveExternalLabels(t *testing.T) { debugLogging: true, stores: []Client{ &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "us-east-1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "us-east-1")}, Name: "store1", }, &storetestutil.TestClient{ - ExtLset: []labels.Labels{labels.FromStrings("region", "us-west-1")}, + ExtLset: []labelpb.Labels{labelpb.FromStrings("region", "us-west-1")}, Name: "store2", }, }, @@ -3310,7 +3309,7 @@ func TestProxyStore_FilterByExclusiveExternalLabels(t *testing.T) { nil, // registry func() []Client { return tc.stores }, component.Query, - labels.EmptyLabels(), + labelpb.EmptyLabels(), 0*time.Second, EagerRetrieval, options..., @@ -3362,8 +3361,8 @@ func TestDedupRespHeap_QuorumChunkDedup(t *testing.T) { { Result: &storepb.SeriesResponse_Series{ Series: &storepb.Series{ - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings("foo", "bar")), - Chunks: []storepb.AggrChunk{ + Labels: labelpb.FromStrings("foo", "bar"), + Chunks: []*storepb.AggrChunk{ { Raw: &storepb.Chunk{ Type: storepb.Chunk_XOR, @@ -3378,7 +3377,7 @@ func TestDedupRespHeap_QuorumChunkDedup(t *testing.T) { testFn: func(responses []*storepb.SeriesResponse, h *responseDeduplicator) { testutil.Equals(t, true, h.Next()) resp := h.At() - testutil.Equals(t, responses[0], resp) + thanostestutil.ProtoEquals(t, responses[0], resp) testutil.Equals(t, false, h.Next()) }, }, @@ -3388,8 +3387,8 @@ func TestDedupRespHeap_QuorumChunkDedup(t *testing.T) { { Result: &storepb.SeriesResponse_Series{ Series: &storepb.Series{ - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings("foo", "bar")), - Chunks: []storepb.AggrChunk{ + Labels: labelpb.FromStrings("foo", "bar"), + Chunks: []*storepb.AggrChunk{ { Raw: &storepb.Chunk{ Type: storepb.Chunk_XOR, @@ -3403,8 +3402,8 @@ func TestDedupRespHeap_QuorumChunkDedup(t *testing.T) { { Result: &storepb.SeriesResponse_Series{ Series: &storepb.Series{ - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings("foo", "bar")), - Chunks: []storepb.AggrChunk{ + Labels: labelpb.FromStrings("foo", "bar"), + Chunks: []*storepb.AggrChunk{ { Raw: &storepb.Chunk{ Type: storepb.Chunk_XOR, @@ -3430,8 +3429,8 @@ func TestDedupRespHeap_QuorumChunkDedup(t *testing.T) { { Result: &storepb.SeriesResponse_Series{ Series: &storepb.Series{ - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings("foo", "bar")), - Chunks: []storepb.AggrChunk{ + Labels: labelpb.FromStrings("foo", "bar"), + Chunks: []*storepb.AggrChunk{ { Raw: &storepb.Chunk{ Type: storepb.Chunk_XOR, @@ -3445,8 +3444,8 @@ func TestDedupRespHeap_QuorumChunkDedup(t *testing.T) { { Result: &storepb.SeriesResponse_Series{ Series: &storepb.Series{ - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings("foo", "bar")), - Chunks: []storepb.AggrChunk{ + Labels: labelpb.FromStrings("foo", "bar"), + Chunks: []*storepb.AggrChunk{ { Raw: &storepb.Chunk{ Type: storepb.Chunk_XOR, @@ -3461,8 +3460,8 @@ func TestDedupRespHeap_QuorumChunkDedup(t *testing.T) { { Result: &storepb.SeriesResponse_Series{ Series: &storepb.Series{ - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings("foo", "bar")), - Chunks: []storepb.AggrChunk{ + Labels: labelpb.FromStrings("foo", "bar"), + Chunks: []*storepb.AggrChunk{ { Raw: &storepb.Chunk{ Type: storepb.Chunk_XOR, @@ -3488,8 +3487,8 @@ func TestDedupRespHeap_QuorumChunkDedup(t *testing.T) { { Result: &storepb.SeriesResponse_Series{ Series: &storepb.Series{ - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings("foo", "bar")), - Chunks: []storepb.AggrChunk{ + Labels: labelpb.FromStrings("foo", "bar"), + Chunks: []*storepb.AggrChunk{ { Raw: &storepb.Chunk{ Type: storepb.Chunk_XOR, @@ -3503,8 +3502,8 @@ func TestDedupRespHeap_QuorumChunkDedup(t *testing.T) { { Result: &storepb.SeriesResponse_Series{ Series: &storepb.Series{ - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings("foo", "bar")), - Chunks: []storepb.AggrChunk{ + Labels: labelpb.FromStrings("foo", "bar"), + Chunks: []*storepb.AggrChunk{ { Raw: &storepb.Chunk{ Type: storepb.Chunk_XOR, @@ -3519,8 +3518,8 @@ func TestDedupRespHeap_QuorumChunkDedup(t *testing.T) { { Result: &storepb.SeriesResponse_Series{ Series: &storepb.Series{ - Labels: labelpb.ZLabelsFromPromLabels(labels.FromStrings("foo", "bar")), - Chunks: []storepb.AggrChunk{ + Labels: labelpb.FromStrings("foo", "bar"), + Chunks: []*storepb.AggrChunk{ { Raw: &storepb.Chunk{ Type: storepb.Chunk_XOR, @@ -3536,7 +3535,7 @@ func TestDedupRespHeap_QuorumChunkDedup(t *testing.T) { testFn: func(responses []*storepb.SeriesResponse, h *responseDeduplicator) { testutil.Equals(t, true, h.Next()) resp := h.At() - testutil.Equals(t, responses[0], resp) + thanostestutil.ProtoEquals(t, responses[0], resp) testutil.Equals(t, 1, len(resp.GetSeries().Chunks)) testutil.Equals(t, false, h.Next()) }, diff --git a/pkg/store/storepb/custom.go b/pkg/store/storepb/custom.go index de3b5e7ac71..fe3c24ade75 100644 --- a/pkg/store/storepb/custom.go +++ b/pkg/store/storepb/custom.go @@ -11,10 +11,10 @@ import ( "strconv" "strings" - "github.com/gogo/protobuf/types" "github.com/pkg/errors" "github.com/prometheus/prometheus/model/labels" "google.golang.org/grpc/codes" + anypb "google.golang.org/protobuf/types/known/anypb" "github.com/thanos-io/thanos/pkg/store/labelpb" ) @@ -44,7 +44,7 @@ func NewSeriesResponse(series *Series) *SeriesResponse { } } -func NewHintsSeriesResponse(hints *types.Any) *SeriesResponse { +func NewHintsSeriesResponse(hints *anypb.Any) *SeriesResponse { return &SeriesResponse{ Result: &SeriesResponse_Hints{ Hints: hints, @@ -64,9 +64,9 @@ func GRPCCodeFromWarn(warn string) codes.Code { type emptySeriesSet struct{} -func (emptySeriesSet) Next() bool { return false } -func (emptySeriesSet) At() (labels.Labels, []AggrChunk) { return labels.EmptyLabels(), nil } -func (emptySeriesSet) Err() error { return nil } +func (emptySeriesSet) Next() bool { return false } +func (emptySeriesSet) At() (labelpb.Labels, []*AggrChunk) { return labelpb.EmptyLabels(), nil } +func (emptySeriesSet) Err() error { return nil } // EmptySeriesSet returns a new series set that contains no series. func EmptySeriesSet() SeriesSet { @@ -105,7 +105,7 @@ func MergeSeriesSets(all ...SeriesSet) SeriesSet { // The set is sorted by the label sets. Chunks may be overlapping or expected of order. type SeriesSet interface { Next() bool - At() (labels.Labels, []AggrChunk) + At() (labelpb.Labels, []*AggrChunk) Err() error } @@ -113,8 +113,8 @@ type SeriesSet interface { type mergedSeriesSet struct { a, b SeriesSet - lset labels.Labels - chunks []AggrChunk + lset labelpb.Labels + chunks []*AggrChunk adone, bdone bool } @@ -128,7 +128,7 @@ func newMergedSeriesSet(a, b SeriesSet) *mergedSeriesSet { return s } -func (s *mergedSeriesSet) At() (labels.Labels, []AggrChunk) { +func (s *mergedSeriesSet) At() (labelpb.Labels, []*AggrChunk) { return s.lset, s.chunks } @@ -148,7 +148,7 @@ func (s *mergedSeriesSet) compare() int { } lsetA, _ := s.a.At() lsetB, _ := s.b.At() - return labels.Compare(lsetA, lsetB) + return labelpb.Compare(lsetA, lsetB) } func (s *mergedSeriesSet) Next() bool { @@ -177,7 +177,7 @@ func (s *mergedSeriesSet) Next() bool { // Slice reuse is not generally safe with nested merge iterators. // We err on the safe side an create a new slice. - s.chunks = make([]AggrChunk, 0, len(chksA)+len(chksB)) + s.chunks = make([]*AggrChunk, 0, len(chksA)+len(chksB)) b := 0 Outer: @@ -221,15 +221,15 @@ type uniqueSeriesSet struct { peek *Series - lset labels.Labels - chunks []AggrChunk + lset labelpb.Labels + chunks []*AggrChunk } func newUniqueSeriesSet(wrapped SeriesSet) *uniqueSeriesSet { return &uniqueSeriesSet{SeriesSet: wrapped} } -func (s *uniqueSeriesSet) At() (labels.Labels, []AggrChunk) { +func (s *uniqueSeriesSet) At() (labelpb.Labels, []*AggrChunk) { return s.lset, s.chunks } @@ -244,13 +244,14 @@ func (s *uniqueSeriesSet) Next() bool { } lset, chks := s.SeriesSet.At() if s.peek == nil { - s.peek = &Series{Labels: labelpb.ZLabelsFromPromLabels(lset), Chunks: chks} + s.peek = &Series{Labels: lset, Chunks: chks} continue } - if labels.Compare(lset, s.peek.PromLabels()) != 0 { - s.lset, s.chunks = s.peek.PromLabels(), s.peek.Chunks - s.peek = &Series{Labels: labelpb.ZLabelsFromPromLabels(lset), Chunks: chks} + peekLabels := labelpb.Labels(s.peek.Labels) + if labelpb.Compare(lset, peekLabels) != 0 { + s.lset, s.chunks = peekLabels, s.peek.Chunks + s.peek = &Series{Labels: lset, Chunks: chks} return true } @@ -263,14 +264,14 @@ func (s *uniqueSeriesSet) Next() bool { return false } - s.lset, s.chunks = s.peek.PromLabels(), s.peek.Chunks + s.lset, s.chunks = labelpb.Labels(s.peek.Labels), s.peek.Chunks s.peek = nil return true } // Compare returns positive 1 if chunk is smaller -1 if larger than b by min time, then max time. // It returns 0 if chunks are exactly the same. -func (m AggrChunk) Compare(b AggrChunk) int { +func (m *AggrChunk) Compare(b *AggrChunk) int { if m.MinTime < b.MinTime { return 1 } @@ -373,8 +374,8 @@ func isRedundantMatcher(m *labels.Matcher) bool { // PromMatchersToMatchers returns proto matchers from Prometheus matchers. // NOTE: It allocates memory. -func PromMatchersToMatchers(ms ...*labels.Matcher) ([]LabelMatcher, error) { - res := make([]LabelMatcher, 0, len(ms)) +func PromMatchersToMatchers(ms ...*labels.Matcher) ([]*LabelMatcher, error) { + res := make([]*LabelMatcher, 0, len(ms)) for _, m := range ms { // Only skip redundant matchers if we have more than 1 matcher // Otherwise, keep at least 1 matcher to avoid empty matcher set @@ -396,17 +397,17 @@ func PromMatchersToMatchers(ms ...*labels.Matcher) ([]LabelMatcher, error) { default: return nil, errors.Errorf("unrecognized matcher type %d", m.Type) } - res = append(res, LabelMatcher{Type: t, Name: m.Name, Value: m.Value}) + res = append(res, &LabelMatcher{Type: t, Name: m.Name, Value: m.Value}) } return res, nil } // MatchersToPromMatchers returns Prometheus matchers from proto matchers. // NOTE: It allocates memory. -func MatchersToPromMatchers(ms ...LabelMatcher) ([]*labels.Matcher, error) { +func MatchersToPromMatchers(ms ...*LabelMatcher) ([]*labels.Matcher, error) { res := make([]*labels.Matcher, 0, len(ms)) - for i := range ms { - pm, err := MatcherToPromMatcher(ms[i]) + for _, m := range ms { + pm, err := MatcherToPromMatcher(m) if err != nil { return nil, err } @@ -416,7 +417,7 @@ func MatchersToPromMatchers(ms ...LabelMatcher) ([]*labels.Matcher, error) { } // MatcherToPromMatcher converts a Thanos label matcher to Prometheus label matcher. -func MatcherToPromMatcher(m LabelMatcher) (*labels.Matcher, error) { +func MatcherToPromMatcher(m *LabelMatcher) (*labels.Matcher, error) { var t labels.MatchType switch m.Type { @@ -436,7 +437,7 @@ func MatcherToPromMatcher(m LabelMatcher) (*labels.Matcher, error) { // MatchersToString converts label matchers to string format. // String should be parsable as a valid PromQL query metric selector. -func MatchersToString(ms ...LabelMatcher) string { +func MatchersToString(ms ...*LabelMatcher) string { var res string for i, m := range ms { res += m.PromString() @@ -464,50 +465,25 @@ func (m *LabelMatcher) PromString() string { return fmt.Sprintf("%s%s%q", m.Name, m.Type.PromString(), m.Value) } -func (m *LabelMatcher) GetName() string { - return m.Name -} - -func (m *LabelMatcher) GetValue() string { - return m.Value -} - func (x LabelMatcher_Type) PromString() string { - typeToStr := map[LabelMatcher_Type]string{ - LabelMatcher_EQ: "=", - LabelMatcher_NEQ: "!=", - LabelMatcher_RE: "=~", - LabelMatcher_NRE: "!~", - } - if str, ok := typeToStr[x]; ok { - return str + switch x { + case LabelMatcher_EQ: + return "=" + case LabelMatcher_NEQ: + return "!=" + case LabelMatcher_RE: + return "=~" + case LabelMatcher_NRE: + return "!~" + default: + panic("unknown match type") } - panic("unknown match type") } -// PromLabels return Prometheus labels.Labels without extra allocation. -func (m *Series) PromLabels() labels.Labels { - return labelpb.ZLabelsToPromLabels(m.Labels) -} - -// Deprecated. -// TODO(bwplotka): Remove this once Cortex dep will stop using it. -type Label = labelpb.ZLabel - -// Deprecated. -// TODO(bwplotka): Remove this in next PR. Done to reduce diff only. -type LabelSet = labelpb.ZLabelSet - -// Deprecated. -// TODO(bwplotka): Remove this once Cortex dep will stop using it. -func CompareLabels(a, b []Label) int { - return labels.Compare(labelpb.ZLabelsToPromLabels(a), labelpb.ZLabelsToPromLabels(b)) -} - -// Deprecated. -// TODO(bwplotka): Remove this once Cortex dep will stop using it. -func LabelsToPromLabelsUnsafe(lset []Label) labels.Labels { - return labelpb.ZLabelsToPromLabels(lset) +// PromLabels returns the series labels as labelpb.Labels. +// This is a zero-allocation type cast. +func (m *Series) PromLabels() labelpb.Labels { + return labelpb.Labels(m.Labels) } // XORNumSamples return number of samples. Returns 0 if it's not XOR chunk. @@ -527,7 +503,7 @@ type SeriesStatsCounter struct { Bytes uint64 } -func (c *SeriesStatsCounter) CountSeries(seriesLabels []labelpb.ZLabel) { +func (c *SeriesStatsCounter) CountSeries(seriesLabels labelpb.Labels) { seriesHash := labelpb.HashWithPrefix("", seriesLabels) if c.lastSeriesHash != 0 || seriesHash != c.lastSeriesHash { c.lastSeriesHash = seriesHash @@ -536,14 +512,14 @@ func (c *SeriesStatsCounter) CountSeries(seriesLabels []labelpb.ZLabel) { } func (c *SeriesStatsCounter) Count(r *SeriesResponse) { - //aggregate # of bytes fetched - c.Bytes += uint64(r.Size()) + c.Bytes += uint64(r.SizeVT()) if r.GetSeries() == nil { return } series := r.GetSeries() - c.CountSeries(series.Labels) + c.CountSeries(labelpb.Labels(series.Labels)) for _, chk := range series.Chunks { + if chk.Raw != nil { c.Chunks++ c.Samples += chk.Raw.XORNumSamples() diff --git a/pkg/store/storepb/custom_test.go b/pkg/store/storepb/custom_test.go index 7e9aaa0c3ce..73b79e97892 100644 --- a/pkg/store/storepb/custom_test.go +++ b/pkg/store/storepb/custom_test.go @@ -10,6 +10,7 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" "github.com/pkg/errors" "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb/chunkenc" @@ -19,6 +20,7 @@ import ( "github.com/thanos-io/thanos/pkg/extpromql" "github.com/thanos-io/thanos/pkg/store/labelpb" + thanostestutil "github.com/thanos-io/thanos/pkg/testutil" ) type sample struct { @@ -27,13 +29,13 @@ type sample struct { } type listSeriesSet struct { - series []Series + series []*Series idx int } -func newSeries(tb testing.TB, lset labels.Labels, smplChunks [][]sample) Series { - s := Series{ - Labels: labelpb.ZLabelsFromPromLabels(lset), +func newSeries(tb testing.TB, lset labelpb.Labels, smplChunks [][]sample) *Series { + s := &Series{ + Labels: lset, } for _, smpls := range smplChunks { @@ -45,7 +47,7 @@ func newSeries(tb testing.TB, lset labels.Labels, smplChunks [][]sample) Series a.Append(smpl.t, smpl.v) } - ch := AggrChunk{ + ch := &AggrChunk{ MinTime: smpls[0].t, MaxTime: smpls[len(smpls)-1].t, Raw: &Chunk{Type: Chunk_XOR, Data: c.Bytes()}, @@ -57,7 +59,7 @@ func newSeries(tb testing.TB, lset labels.Labels, smplChunks [][]sample) Series } func newListSeriesSet(tb testing.TB, raw []rawSeries) *listSeriesSet { - var series []Series + var series []*Series for _, s := range raw { series = append(series, newSeries(tb, s.lset, s.chunks)) } @@ -72,9 +74,9 @@ func (s *listSeriesSet) Next() bool { return s.idx < len(s.series) } -func (s *listSeriesSet) At() (labels.Labels, []AggrChunk) { +func (s *listSeriesSet) At() (labelpb.Labels, []*AggrChunk) { if s.idx < 0 || s.idx >= len(s.series) { - return labels.EmptyLabels(), nil + return labelpb.EmptyLabels(), nil } return s.series[s.idx].PromLabels(), s.series[s.idx].Chunks @@ -86,7 +88,7 @@ type errSeriesSet struct{ err error } func (errSeriesSet) Next() bool { return false } -func (errSeriesSet) At() (labels.Labels, []AggrChunk) { return labels.EmptyLabels(), nil } +func (errSeriesSet) At() (labelpb.Labels, []*AggrChunk) { return labelpb.EmptyLabels(), nil } func (e errSeriesSet) Err() error { return e.err } @@ -104,19 +106,19 @@ func TestMergeSeriesSets(t *testing.T) { { desc: "single seriesSet, distinct series", in: [][]rawSeries{{{ - lset: labels.FromStrings("a", "a"), + lset: labelpb.FromStrings("a", "a"), chunks: [][]sample{{{1, 1}, {2, 2}}, {{3, 3}, {4, 4}}}, }, { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{{{11, 1}, {12, 2}}, {{13, 3}, {14, 4}}}, }}}, expected: []rawSeries{ { - lset: labels.FromStrings("a", "a"), + lset: labelpb.FromStrings("a", "a"), chunks: [][]sample{{{1, 1}, {2, 2}}, {{3, 3}, {4, 4}}}, }, { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{{{11, 1}, {12, 2}}, {{13, 3}, {14, 4}}}, }, }, @@ -124,19 +126,19 @@ func TestMergeSeriesSets(t *testing.T) { { desc: "two seriesSets, distinct series", in: [][]rawSeries{{{ - lset: labels.FromStrings("a", "a"), + lset: labelpb.FromStrings("a", "a"), chunks: [][]sample{{{1, 1}, {2, 2}}, {{3, 3}, {4, 4}}}, }}, {{ - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{{{11, 1}, {12, 2}}, {{13, 3}, {14, 4}}}, }}}, expected: []rawSeries{ { - lset: labels.FromStrings("a", "a"), + lset: labelpb.FromStrings("a", "a"), chunks: [][]sample{{{1, 1}, {2, 2}}, {{3, 3}, {4, 4}}}, }, { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{{{11, 1}, {12, 2}}, {{13, 3}, {14, 4}}}, }, }, @@ -146,17 +148,17 @@ func TestMergeSeriesSets(t *testing.T) { in: [][]rawSeries{ { { - lset: labels.FromStrings("a", "a"), + lset: labelpb.FromStrings("a", "a"), chunks: [][]sample{{{1, 1}, {2, 2}}, {{3, 3}, {4, 4}}}, }, { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{{{11, 1}, {12, 2}}, {{13, 3}, {14, 4}}}, }, }, { { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{{{7, 1}, {8, 2}}, {{9, 3}, {10, 4}, {11, 4444}}}, // Last sample overlaps, merge ignores that. }, }, @@ -164,10 +166,10 @@ func TestMergeSeriesSets(t *testing.T) { expected: []rawSeries{ { - lset: labels.FromStrings("a", "a"), + lset: labelpb.FromStrings("a", "a"), chunks: [][]sample{{{1, 1}, {2, 2}}, {{3, 3}, {4, 4}}}, }, { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{{{7, 1}, {8, 2}}, {{9, 3}, {10, 4}, {11, 4444}}, {{11, 1}, {12, 2}}, {{13, 3}, {14, 4}}}, }, }, @@ -177,15 +179,15 @@ func TestMergeSeriesSets(t *testing.T) { in: [][]rawSeries{ { { - lset: labels.FromStrings("a", "a"), + lset: labelpb.FromStrings("a", "a"), chunks: [][]sample{{{1, 1}, {2, 2}}, {{3, 3}, {4, 4}}}, }, { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{{{7, 1}, {8, 2}}, {{9, 3}, {10, 4}, {11, 4444}}}, }, { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{{{11, 1}, {12, 2}}, {{13, 3}, {14, 4}}}, }, }, @@ -193,10 +195,10 @@ func TestMergeSeriesSets(t *testing.T) { expected: []rawSeries{ { - lset: labels.FromStrings("a", "a"), + lset: labelpb.FromStrings("a", "a"), chunks: [][]sample{{{1, 1}, {2, 2}}, {{3, 3}, {4, 4}}}, }, { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{{{7, 1}, {8, 2}}, {{9, 3}, {10, 4}, {11, 4444}}, {{11, 1}, {12, 2}}, {{13, 3}, {14, 4}}}, }, }, @@ -206,18 +208,18 @@ func TestMergeSeriesSets(t *testing.T) { in: [][]rawSeries{ { { - lset: labels.FromStrings("a", "a"), + lset: labelpb.FromStrings("a", "a"), chunks: [][]sample{{{1, 1}, {2, 2}}, {{3, 3}, {4, 4}}}, }, { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{ {{11, 11}, {12, 12}, {13, 13}, {14, 14}}, {{15, 15}, {16, 16}, {17, 17}, {18, 18}}, }, }, { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{ {{20, 20}, {21, 21}, {22, 22}, {24, 24}}, }, @@ -225,20 +227,20 @@ func TestMergeSeriesSets(t *testing.T) { }, { { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{ {{1, 1}, {2, 2}, {3, 3}, {4, 4}}, {{11, 11}, {12, 12}, {13, 13}, {14, 14}}, // Same chunk as in set 1. }, }, { - lset: labels.FromStrings("a", "d"), + lset: labelpb.FromStrings("a", "d"), chunks: [][]sample{{{11, 1}, {12, 2}}, {{13, 3}, {14, 4}}}, }, }, { { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{ {{11, 11}, {12, 12}, {13, 13}, {14, 14}}, // Same chunk as in set 1. {{20, 20}, {21, 21}, {22, 23}, {24, 24}}, // Almost same chunk as in set 1 (one value is different). @@ -247,7 +249,7 @@ func TestMergeSeriesSets(t *testing.T) { }, { { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{ {{11, 11}, {12, 12}, {14, 14}}, // Almost same chunk as in set 1 (one sample is missing). {{20, 20}, {21, 21}, {22, 22}, {24, 24}}, // Same chunk as in set 1. @@ -258,10 +260,10 @@ func TestMergeSeriesSets(t *testing.T) { expected: []rawSeries{ { - lset: labels.FromStrings("a", "a"), + lset: labelpb.FromStrings("a", "a"), chunks: [][]sample{{{t: 1, v: 1}, {t: 2, v: 2}}, {{t: 3, v: 3}, {t: 4, v: 4}}}, }, { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{ {{t: 1, v: 1}, {t: 2, v: 2}, {t: 3, v: 3}, {t: 4, v: 4}}, {{t: 11, v: 11}, {t: 12, v: 12}, {t: 13, v: 13}, {t: 14, v: 14}}, @@ -271,7 +273,7 @@ func TestMergeSeriesSets(t *testing.T) { {{t: 20, v: 20}, {t: 21, v: 21}, {t: 22, v: 23}, {t: 24, v: 24}}, }, }, { - lset: labels.FromStrings("a", "d"), + lset: labelpb.FromStrings("a", "d"), chunks: [][]sample{{{t: 11, v: 1}, {t: 12, v: 2}}, {{t: 13, v: 3}, {t: 14, v: 4}}}, }, }, @@ -281,13 +283,13 @@ func TestMergeSeriesSets(t *testing.T) { in: [][]rawSeries{ { { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{ {{20, 20}, {21, 21}, {22, 22}, {24, 24}}, }, }, { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{ {{11, 11}, {12, 12}, {13, 13}, {14, 14}}, {{15, 15}, {16, 16}, {17, 17}, {18, 18}}, @@ -296,7 +298,7 @@ func TestMergeSeriesSets(t *testing.T) { }, { { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{ {{11, 11}, {12, 12}, {13, 13}, {14, 14}}, // Same chunk as in set 1. {{1, 1}, {2, 2}, {3, 3}, {4, 4}}, @@ -305,7 +307,7 @@ func TestMergeSeriesSets(t *testing.T) { }, { { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{ {{20, 20}, {21, 21}, {22, 23}, {24, 24}}, // Almost same chunk as in set 1 (one value is different). {{11, 11}, {12, 12}, {13, 13}, {14, 14}}, // Same chunk as in set 1. @@ -316,7 +318,7 @@ func TestMergeSeriesSets(t *testing.T) { expected: []rawSeries{ { - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{ {{t: 11, v: 11}, {t: 12, v: 12}, {t: 13, v: 13}, {t: 14, v: 14}}, {{t: 1, v: 1}, {t: 2, v: 2}, {t: 3, v: 3}, {t: 4, v: 4}}, @@ -335,7 +337,10 @@ func TestMergeSeriesSets(t *testing.T) { for _, iss := range tcase.in { input = append(input, newListSeriesSet(t, iss)) } - testutil.Equals(t, tcase.expected, expandSeriesSet(t, MergeSeriesSets(input...))) + // AllowUnexported is needed because rawSeries and sample are test-local + // structs with unexported fields (lset, chunks, t, v) that cmp.Diff + // cannot access by default but must compare to verify correctness. + thanostestutil.ProtoEqualsWithOptions(t, tcase.expected, expandSeriesSet(t, MergeSeriesSets(input...)), cmp.Options{cmp.AllowUnexported(rawSeries{}, sample{})}) }) } } @@ -343,10 +348,10 @@ func TestMergeSeriesSets(t *testing.T) { func TestMergeSeriesSetError(t *testing.T) { var input []SeriesSet for _, iss := range [][]rawSeries{{{ - lset: labels.FromStrings("a", "a"), + lset: labelpb.FromStrings("a", "a"), chunks: [][]sample{{{1, 1}, {2, 2}}, {{3, 3}, {4, 4}}}, }}, {{ - lset: labels.FromStrings("a", "c"), + lset: labelpb.FromStrings("a", "c"), chunks: [][]sample{{{11, 1}, {12, 2}}, {{13, 3}, {14, 4}}}, }}} { input = append(input, newListSeriesSet(t, iss)) @@ -357,7 +362,7 @@ func TestMergeSeriesSetError(t *testing.T) { } type rawSeries struct { - lset labels.Labels + lset labelpb.Labels chunks [][]sample } @@ -424,10 +429,20 @@ func benchmarkMergedSeriesSet(b testutil.TB, overlappingChunks bool) { } { for _, j := range []int{1, 2, 4, 8, 16, 32} { b.Run(fmt.Sprintf("series=%d,blocks=%d", k, j), func(b testutil.TB) { - lbls, err := labels.ReadLabels(filepath.Join("../../testutil/testdata", "20kseries.json"), k) + promLbls, err := labels.ReadLabels(filepath.Join("../../testutil/testdata", "20kseries.json"), k) testutil.Ok(b, err) - sort.Sort(labels.Slice(lbls)) + sort.Sort(labels.Slice(promLbls)) + + // Convert prometheus labels to our Labels type. + lbls := make([]labelpb.Labels, len(promLbls)) + for i, pl := range promLbls { + ls := make(labelpb.Labels, 0, pl.Len()) + pl.Range(func(l labels.Label) { + ls = append(ls, &labelpb.Label{Name: l.Name, Value: l.Value}) + }) + lbls[i] = ls + } blocks := make([][]rawSeries, j) for _, l := range lbls { @@ -469,37 +484,37 @@ func benchmarkMergedSeriesSet(b testutil.TB, overlappingChunks bool) { func TestMatchersToString_Translate(t *testing.T) { for _, c := range []struct { - ms []LabelMatcher + ms []*LabelMatcher expected string }{ { - ms: []LabelMatcher{ + ms: []*LabelMatcher{ {Name: "__name__", Type: LabelMatcher_EQ, Value: "up"}, }, expected: `{__name__="up"}`, }, { - ms: []LabelMatcher{ + ms: []*LabelMatcher{ {Name: "__name__", Type: LabelMatcher_NEQ, Value: "up"}, {Name: "job", Type: LabelMatcher_EQ, Value: "test"}, }, expected: `{__name__!="up", job="test"}`, }, { - ms: []LabelMatcher{ + ms: []*LabelMatcher{ {Name: "__name__", Type: LabelMatcher_EQ, Value: "up"}, {Name: "job", Type: LabelMatcher_RE, Value: "test"}, }, expected: `{__name__="up", job=~"test"}`, }, { - ms: []LabelMatcher{ + ms: []*LabelMatcher{ {Name: "job", Type: LabelMatcher_NRE, Value: "test"}, }, expected: `{job!~"test"}`, }, { - ms: []LabelMatcher{ + ms: []*LabelMatcher{ {Name: "__name__", Type: LabelMatcher_EQ, Value: "up"}, {Name: "__name__", Type: LabelMatcher_NEQ, Value: "up"}, }, @@ -542,7 +557,7 @@ func TestSeriesRequestToPromQL(t *testing.T) { { name: "Single matcher regular expression", r: &SeriesRequest{ - Matchers: []LabelMatcher{ + Matchers: []*LabelMatcher{ { Type: LabelMatcher_RE, Name: "namespace", @@ -560,7 +575,7 @@ func TestSeriesRequestToPromQL(t *testing.T) { { name: "Single matcher regular expression with grouping", r: &SeriesRequest{ - Matchers: []LabelMatcher{ + Matchers: []*LabelMatcher{ { Type: LabelMatcher_RE, Name: "namespace", @@ -582,7 +597,7 @@ func TestSeriesRequestToPromQL(t *testing.T) { { name: "Multiple matchers with grouping", r: &SeriesRequest{ - Matchers: []LabelMatcher{ + Matchers: []*LabelMatcher{ { Type: LabelMatcher_EQ, Name: "__name__", @@ -609,7 +624,7 @@ func TestSeriesRequestToPromQL(t *testing.T) { { name: "Query with vector range selector", r: &SeriesRequest{ - Matchers: []LabelMatcher{ + Matchers: []*LabelMatcher{ { Type: LabelMatcher_EQ, Name: "__name__", @@ -635,7 +650,7 @@ func TestSeriesRequestToPromQL(t *testing.T) { { name: "Query with grouping and vector range selector", r: &SeriesRequest{ - Matchers: []LabelMatcher{ + Matchers: []*LabelMatcher{ { Type: LabelMatcher_EQ, Name: "__name__", @@ -678,7 +693,7 @@ func TestPromMatchersToMatchers_RedundantMatcherFiltering(t *testing.T) { cases := []struct { name string inputMatchers []*labels.Matcher - expectedMatchers []LabelMatcher + expectedMatchers []*LabelMatcher description string }{ { @@ -686,7 +701,7 @@ func TestPromMatchersToMatchers_RedundantMatcherFiltering(t *testing.T) { inputMatchers: []*labels.Matcher{ labels.MustNewMatcher(labels.MatchRegexp, "label1", ".*"), }, - expectedMatchers: []LabelMatcher{ + expectedMatchers: []*LabelMatcher{ {Name: "label1", Type: LabelMatcher_RE, Value: ".*"}, }, description: "When there's only one matcher, even if redundant, it should be kept to avoid empty matcher set", @@ -697,7 +712,7 @@ func TestPromMatchersToMatchers_RedundantMatcherFiltering(t *testing.T) { labels.MustNewMatcher(labels.MatchEqual, "__name__", "up"), labels.MustNewMatcher(labels.MatchRegexp, "label1", ".*"), }, - expectedMatchers: []LabelMatcher{ + expectedMatchers: []*LabelMatcher{ {Name: "__name__", Type: LabelMatcher_EQ, Value: "up"}, }, description: "When there are multiple matchers, redundant ones should be filtered out", @@ -710,7 +725,7 @@ func TestPromMatchersToMatchers_RedundantMatcherFiltering(t *testing.T) { labels.MustNewMatcher(labels.MatchRegexp, "label2", ".*"), labels.MustNewMatcher(labels.MatchEqual, "job", "test"), }, - expectedMatchers: []LabelMatcher{ + expectedMatchers: []*LabelMatcher{ {Name: "__name__", Type: LabelMatcher_EQ, Value: "up"}, {Name: "job", Type: LabelMatcher_EQ, Value: "test"}, }, @@ -722,7 +737,7 @@ func TestPromMatchersToMatchers_RedundantMatcherFiltering(t *testing.T) { labels.MustNewMatcher(labels.MatchEqual, "__name__", "up"), labels.MustNewMatcher(labels.MatchRegexp, "label1", ".+"), }, - expectedMatchers: []LabelMatcher{ + expectedMatchers: []*LabelMatcher{ {Name: "__name__", Type: LabelMatcher_EQ, Value: "up"}, {Name: "label1", Type: LabelMatcher_RE, Value: ".+"}, }, @@ -734,7 +749,7 @@ func TestPromMatchersToMatchers_RedundantMatcherFiltering(t *testing.T) { labels.MustNewMatcher(labels.MatchRegexp, "label1", ".*"), labels.MustNewMatcher(labels.MatchRegexp, "label2", ".*"), }, - expectedMatchers: []LabelMatcher{}, + expectedMatchers: []*LabelMatcher{}, description: "Current implementation: when ALL matchers are redundant (len > 1), they all get filtered, resulting in empty set. This is a known edge case.", }, } diff --git a/pkg/store/storepb/inprocess_test.go b/pkg/store/storepb/inprocess_test.go index f033b579b02..fe80f49e54c 100644 --- a/pkg/store/storepb/inprocess_test.go +++ b/pkg/store/storepb/inprocess_test.go @@ -13,9 +13,12 @@ import ( "github.com/efficientgo/core/testutil" "github.com/pkg/errors" "github.com/thanos-io/thanos/pkg/store/labelpb" + thanostestutil "github.com/thanos-io/thanos/pkg/testutil" ) type testStoreServer struct { + UnimplementedStoreServer + series []*SeriesResponse seriesLastReq *SeriesRequest @@ -59,17 +62,17 @@ func TestServerAsClient(t *testing.T) { s := &testStoreServer{ series: []*SeriesResponse{ NewSeriesResponse(&Series{ - Labels: []labelpb.ZLabel{{Name: "a", Value: "b"}}, - Chunks: []AggrChunk{{MinTime: 123, MaxTime: 124}, {MinTime: 12455, MaxTime: 14124}}, + Labels: labelpb.FromStrings("a", "b"), + Chunks: []*AggrChunk{{MinTime: 123, MaxTime: 124}, {MinTime: 12455, MaxTime: 14124}}, }), NewSeriesResponse(&Series{ - Labels: []labelpb.ZLabel{{Name: "a", Value: "b1"}}, - Chunks: []AggrChunk{{MinTime: 1231, MaxTime: 124}, {MinTime: 12455, MaxTime: 14124}}, + Labels: labelpb.FromStrings("a", "b1"), + Chunks: []*AggrChunk{{MinTime: 1231, MaxTime: 124}, {MinTime: 12455, MaxTime: 14124}}, }), NewWarnSeriesResponse(errors.New("yolo")), NewSeriesResponse(&Series{ - Labels: []labelpb.ZLabel{{Name: "a", Value: "b3"}}, - Chunks: []AggrChunk{{MinTime: 123, MaxTime: 124}, {MinTime: 124554, MaxTime: 14124}}, + Labels: labelpb.FromStrings("a", "b3"), + Chunks: []*AggrChunk{{MinTime: 123, MaxTime: 124}, {MinTime: 124554, MaxTime: 14124}}, }), }} t.Run("ok", func(t *testing.T) { @@ -77,7 +80,7 @@ func TestServerAsClient(t *testing.T) { r := &SeriesRequest{ MinTime: -214, MaxTime: 213, - Matchers: []LabelMatcher{{Value: "wfsdfs", Name: "__name__", Type: LabelMatcher_EQ}}, + Matchers: []*LabelMatcher{{Value: "wfsdfs", Name: "__name__", Type: LabelMatcher_EQ}}, PartialResponseStrategy: PartialResponseStrategy_ABORT, } client, err := ServerAsClient(s).Series(ctx, r) @@ -91,8 +94,8 @@ func TestServerAsClient(t *testing.T) { testutil.Ok(t, err) resps = append(resps, resp) } - testutil.Equals(t, s.series, resps) - testutil.Equals(t, r, s.seriesLastReq) + thanostestutil.ProtoEquals(t, s.series, resps) + thanostestutil.ProtoEquals(t, r, s.seriesLastReq) s.seriesLastReq = nil } }) @@ -102,7 +105,7 @@ func TestServerAsClient(t *testing.T) { r := &SeriesRequest{ MinTime: -214, MaxTime: 213, - Matchers: []LabelMatcher{{Value: "wfsdfs", Name: "__name__", Type: LabelMatcher_EQ}}, + Matchers: []*LabelMatcher{{Value: "wfsdfs", Name: "__name__", Type: LabelMatcher_EQ}}, PartialResponseStrategy: PartialResponseStrategy_ABORT, } client, err := ServerAsClient(s).Series(ctx, r) @@ -120,8 +123,8 @@ func TestServerAsClient(t *testing.T) { testutil.Ok(t, err) resps = append(resps, resp) } - testutil.Equals(t, s.series[:len(s.series)/2], resps) - testutil.Equals(t, r, s.seriesLastReq) + thanostestutil.ProtoEquals(t, s.series[:len(s.series)/2], resps) + thanostestutil.ProtoEquals(t, r, s.seriesLastReq) s.seriesLastReq = nil } }) @@ -130,7 +133,7 @@ func TestServerAsClient(t *testing.T) { r := &SeriesRequest{ MinTime: -214, MaxTime: 213, - Matchers: []LabelMatcher{{Value: "wfsdfs", Name: "__name__", Type: LabelMatcher_EQ}}, + Matchers: []*LabelMatcher{{Value: "wfsdfs", Name: "__name__", Type: LabelMatcher_EQ}}, PartialResponseStrategy: PartialResponseStrategy_ABORT, } client, err := ServerAsClient(s).Series(ctx, r) @@ -147,8 +150,8 @@ func TestServerAsClient(t *testing.T) { testutil.Ok(t, err) resps = append(resps, resp) } - testutil.Equals(t, s.series[:len(s.series)/2], resps) - testutil.Equals(t, r, s.seriesLastReq) + thanostestutil.ProtoEquals(t, s.series[:len(s.series)/2], resps) + thanostestutil.ProtoEquals(t, r, s.seriesLastReq) s.seriesLastReq = nil } }) @@ -164,8 +167,8 @@ func TestServerAsClient(t *testing.T) { } resp, err := ServerAsClient(s).LabelNames(ctx, r) testutil.Ok(t, err) - testutil.Equals(t, s.labelNames, resp) - testutil.Equals(t, r, s.labelNamesLastReq) + thanostestutil.ProtoEquals(t, s.labelNames, resp) + thanostestutil.ProtoEquals(t, r, s.labelNamesLastReq) s.labelNamesLastReq = nil } }) @@ -200,8 +203,8 @@ func TestServerAsClient(t *testing.T) { } resp, err := ServerAsClient(s).LabelValues(ctx, r) testutil.Ok(t, err) - testutil.Equals(t, s.labelValues, resp) - testutil.Equals(t, r, s.labelValuesLastReq) + thanostestutil.ProtoEquals(t, s.labelValues, resp) + thanostestutil.ProtoEquals(t, r, s.labelValuesLastReq) s.labelValuesLastReq = nil } }) diff --git a/pkg/store/storepb/prompb/custom.go b/pkg/store/storepb/prompb/custom.go index 5619977da94..df6db56182c 100644 --- a/pkg/store/storepb/prompb/custom.go +++ b/pkg/store/storepb/prompb/custom.go @@ -4,15 +4,26 @@ package prompb import ( + gogoproto "github.com/gogo/protobuf/proto" "github.com/prometheus/prometheus/model/histogram" ) -func (h Histogram) IsFloatHistogram() bool { +func init() { + gogoproto.RegisterType((*ChunkedReadResponse)(nil), "prometheus_copy.ChunkedReadResponse") +} + +// Marshal/Unmarshal bridge methods allow gogo protobuf's proto.Unmarshal +// (used by Prometheus's ChunkedReader.NextProto) to decode protoc-gen-go +// messages without falling back to gogo's reflection-based codec. +func (m *ChunkedReadResponse) Marshal() ([]byte, error) { return m.MarshalVT() } +func (m *ChunkedReadResponse) Unmarshal(b []byte) error { return m.UnmarshalVT(b) } + +func (h *Histogram) IsFloatHistogram() bool { _, ok := h.GetCount().(*Histogram_CountFloat) return ok } -func FromProtoHistogram(h Histogram) *histogram.FloatHistogram { +func FromProtoHistogram(h *Histogram) *histogram.FloatHistogram { if h.IsFloatHistogram() { return FloatHistogramProtoToFloatHistogram(h) } else { diff --git a/pkg/store/storepb/prompb/remote.pb.go b/pkg/store/storepb/prompb/remote.pb.go index 6d7538d1bc6..0b9b0e0caa1 100644 --- a/pkg/store/storepb/prompb/remote.pb.go +++ b/pkg/store/storepb/prompb/remote.pb.go @@ -1,28 +1,43 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Copyright 2016 Prometheus Team +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.20.1 // source: store/storepb/prompb/remote.proto package prompb import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" + reflect "reflect" + sync "sync" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/planetscale/vtprotobuf/vtproto" + _ "github.com/srikrsna/protoc-gen-gotag/tagger" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type ReadRequest_ResponseType int32 @@ -43,78 +58,104 @@ const ( ReadRequest_STREAMED_XOR_CHUNKS ReadRequest_ResponseType = 1 ) -var ReadRequest_ResponseType_name = map[int32]string{ - 0: "SAMPLES", - 1: "STREAMED_XOR_CHUNKS", -} +// Enum value maps for ReadRequest_ResponseType. +var ( + ReadRequest_ResponseType_name = map[int32]string{ + 0: "SAMPLES", + 1: "STREAMED_XOR_CHUNKS", + } + ReadRequest_ResponseType_value = map[string]int32{ + "SAMPLES": 0, + "STREAMED_XOR_CHUNKS": 1, + } +) -var ReadRequest_ResponseType_value = map[string]int32{ - "SAMPLES": 0, - "STREAMED_XOR_CHUNKS": 1, +func (x ReadRequest_ResponseType) Enum() *ReadRequest_ResponseType { + p := new(ReadRequest_ResponseType) + *p = x + return p } func (x ReadRequest_ResponseType) String() string { - return proto.EnumName(ReadRequest_ResponseType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } +func (ReadRequest_ResponseType) Descriptor() protoreflect.EnumDescriptor { + return file_store_storepb_prompb_remote_proto_enumTypes[0].Descriptor() +} + +func (ReadRequest_ResponseType) Type() protoreflect.EnumType { + return &file_store_storepb_prompb_remote_proto_enumTypes[0] +} + +func (x ReadRequest_ResponseType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ReadRequest_ResponseType.Descriptor instead. func (ReadRequest_ResponseType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b3df75c58e6767bb, []int{1, 0} + return file_store_storepb_prompb_remote_proto_rawDescGZIP(), []int{1, 0} } type WriteRequest struct { - Timeseries []TimeSeries `protobuf:"bytes,1,rep,name=timeseries,proto3" json:"timeseries"` - Metadata []MetricMetadata `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timeseries []*TimeSeries `protobuf:"bytes,1,rep,name=timeseries,proto3" json:"timeseries"` + Metadata []*MetricMetadata `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata"` } -func (m *WriteRequest) Reset() { *m = WriteRequest{} } -func (m *WriteRequest) String() string { return proto.CompactTextString(m) } -func (*WriteRequest) ProtoMessage() {} -func (*WriteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b3df75c58e6767bb, []int{0} +func (x *WriteRequest) Reset() { + *x = WriteRequest{} + mi := &file_store_storepb_prompb_remote_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *WriteRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *WriteRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *WriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WriteRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*WriteRequest) ProtoMessage() {} + +func (x *WriteRequest) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_prompb_remote_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *WriteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteRequest.Merge(m, src) -} -func (m *WriteRequest) XXX_Size() int { - return m.Size() -} -func (m *WriteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WriteRequest.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_WriteRequest proto.InternalMessageInfo +// Deprecated: Use WriteRequest.ProtoReflect.Descriptor instead. +func (*WriteRequest) Descriptor() ([]byte, []int) { + return file_store_storepb_prompb_remote_proto_rawDescGZIP(), []int{0} +} -func (m *WriteRequest) GetTimeseries() []TimeSeries { - if m != nil { - return m.Timeseries +func (x *WriteRequest) GetTimeseries() []*TimeSeries { + if x != nil { + return x.Timeseries } return nil } -func (m *WriteRequest) GetMetadata() []MetricMetadata { - if m != nil { - return m.Metadata +func (x *WriteRequest) GetMetadata() []*MetricMetadata { + if x != nil { + return x.Metadata } return nil } // ReadRequest represents a remote read request. type ReadRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Queries []*Query `protobuf:"bytes,1,rep,name=queries,proto3" json:"queries,omitempty"` // accepted_response_types allows negotiating the content type of the response. // @@ -124,208 +165,208 @@ type ReadRequest struct { AcceptedResponseTypes []ReadRequest_ResponseType `protobuf:"varint,2,rep,packed,name=accepted_response_types,json=acceptedResponseTypes,proto3,enum=prometheus_copy.ReadRequest_ResponseType" json:"accepted_response_types,omitempty"` } -func (m *ReadRequest) Reset() { *m = ReadRequest{} } -func (m *ReadRequest) String() string { return proto.CompactTextString(m) } -func (*ReadRequest) ProtoMessage() {} -func (*ReadRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b3df75c58e6767bb, []int{1} +func (x *ReadRequest) Reset() { + *x = ReadRequest{} + mi := &file_store_storepb_prompb_remote_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ReadRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ReadRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ReadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ReadRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ReadRequest) ProtoMessage() {} + +func (x *ReadRequest) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_prompb_remote_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *ReadRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadRequest.Merge(m, src) -} -func (m *ReadRequest) XXX_Size() int { - return m.Size() -} -func (m *ReadRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ReadRequest.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_ReadRequest proto.InternalMessageInfo +// Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead. +func (*ReadRequest) Descriptor() ([]byte, []int) { + return file_store_storepb_prompb_remote_proto_rawDescGZIP(), []int{1} +} -func (m *ReadRequest) GetQueries() []*Query { - if m != nil { - return m.Queries +func (x *ReadRequest) GetQueries() []*Query { + if x != nil { + return x.Queries } return nil } -func (m *ReadRequest) GetAcceptedResponseTypes() []ReadRequest_ResponseType { - if m != nil { - return m.AcceptedResponseTypes +func (x *ReadRequest) GetAcceptedResponseTypes() []ReadRequest_ResponseType { + if x != nil { + return x.AcceptedResponseTypes } return nil } // ReadResponse is a response when response_type equals SAMPLES. type ReadResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // In same order as the request's queries. Results []*QueryResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` } -func (m *ReadResponse) Reset() { *m = ReadResponse{} } -func (m *ReadResponse) String() string { return proto.CompactTextString(m) } -func (*ReadResponse) ProtoMessage() {} -func (*ReadResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b3df75c58e6767bb, []int{2} +func (x *ReadResponse) Reset() { + *x = ReadResponse{} + mi := &file_store_storepb_prompb_remote_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ReadResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ReadResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ReadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ReadResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ReadResponse) ProtoMessage() {} + +func (x *ReadResponse) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_prompb_remote_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *ReadResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadResponse.Merge(m, src) -} -func (m *ReadResponse) XXX_Size() int { - return m.Size() -} -func (m *ReadResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ReadResponse.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_ReadResponse proto.InternalMessageInfo +// Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead. +func (*ReadResponse) Descriptor() ([]byte, []int) { + return file_store_storepb_prompb_remote_proto_rawDescGZIP(), []int{2} +} -func (m *ReadResponse) GetResults() []*QueryResult { - if m != nil { - return m.Results +func (x *ReadResponse) GetResults() []*QueryResult { + if x != nil { + return x.Results } return nil } type Query struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + StartTimestampMs int64 `protobuf:"varint,1,opt,name=start_timestamp_ms,json=startTimestampMs,proto3" json:"start_timestamp_ms,omitempty"` EndTimestampMs int64 `protobuf:"varint,2,opt,name=end_timestamp_ms,json=endTimestampMs,proto3" json:"end_timestamp_ms,omitempty"` Matchers []*LabelMatcher `protobuf:"bytes,3,rep,name=matchers,proto3" json:"matchers,omitempty"` Hints *ReadHints `protobuf:"bytes,4,opt,name=hints,proto3" json:"hints,omitempty"` } -func (m *Query) Reset() { *m = Query{} } -func (m *Query) String() string { return proto.CompactTextString(m) } -func (*Query) ProtoMessage() {} -func (*Query) Descriptor() ([]byte, []int) { - return fileDescriptor_b3df75c58e6767bb, []int{3} +func (x *Query) Reset() { + *x = Query{} + mi := &file_store_storepb_prompb_remote_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Query) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *Query) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Query) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Query.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*Query) ProtoMessage() {} + +func (x *Query) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_prompb_remote_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *Query) XXX_Merge(src proto.Message) { - xxx_messageInfo_Query.Merge(m, src) -} -func (m *Query) XXX_Size() int { - return m.Size() -} -func (m *Query) XXX_DiscardUnknown() { - xxx_messageInfo_Query.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_Query proto.InternalMessageInfo +// Deprecated: Use Query.ProtoReflect.Descriptor instead. +func (*Query) Descriptor() ([]byte, []int) { + return file_store_storepb_prompb_remote_proto_rawDescGZIP(), []int{3} +} -func (m *Query) GetStartTimestampMs() int64 { - if m != nil { - return m.StartTimestampMs +func (x *Query) GetStartTimestampMs() int64 { + if x != nil { + return x.StartTimestampMs } return 0 } -func (m *Query) GetEndTimestampMs() int64 { - if m != nil { - return m.EndTimestampMs +func (x *Query) GetEndTimestampMs() int64 { + if x != nil { + return x.EndTimestampMs } return 0 } -func (m *Query) GetMatchers() []*LabelMatcher { - if m != nil { - return m.Matchers +func (x *Query) GetMatchers() []*LabelMatcher { + if x != nil { + return x.Matchers } return nil } -func (m *Query) GetHints() *ReadHints { - if m != nil { - return m.Hints +func (x *Query) GetHints() *ReadHints { + if x != nil { + return x.Hints } return nil } type QueryResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Samples within a time series must be ordered by time. Timeseries []*TimeSeries `protobuf:"bytes,1,rep,name=timeseries,proto3" json:"timeseries,omitempty"` } -func (m *QueryResult) Reset() { *m = QueryResult{} } -func (m *QueryResult) String() string { return proto.CompactTextString(m) } -func (*QueryResult) ProtoMessage() {} -func (*QueryResult) Descriptor() ([]byte, []int) { - return fileDescriptor_b3df75c58e6767bb, []int{4} +func (x *QueryResult) Reset() { + *x = QueryResult{} + mi := &file_store_storepb_prompb_remote_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *QueryResult) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *QueryResult) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *QueryResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryResult.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*QueryResult) ProtoMessage() {} + +func (x *QueryResult) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_prompb_remote_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *QueryResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryResult.Merge(m, src) -} -func (m *QueryResult) XXX_Size() int { - return m.Size() -} -func (m *QueryResult) XXX_DiscardUnknown() { - xxx_messageInfo_QueryResult.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_QueryResult proto.InternalMessageInfo +// Deprecated: Use QueryResult.ProtoReflect.Descriptor instead. +func (*QueryResult) Descriptor() ([]byte, []int) { + return file_store_storepb_prompb_remote_proto_rawDescGZIP(), []int{4} +} -func (m *QueryResult) GetTimeseries() []*TimeSeries { - if m != nil { - return m.Timeseries +func (x *QueryResult) GetTimeseries() []*TimeSeries { + if x != nil { + return x.Timeseries } return nil } @@ -335,1303 +376,203 @@ func (m *QueryResult) GetTimeseries() []*TimeSeries { // partition of the single series, but once a new series is started to be streamed it means that no more chunks will // be sent for previous one. type ChunkedReadResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + ChunkedSeries []*ChunkedSeries `protobuf:"bytes,1,rep,name=chunked_series,json=chunkedSeries,proto3" json:"chunked_series,omitempty"` // query_index represents an index of the query from ReadRequest.queries these chunks relates to. QueryIndex int64 `protobuf:"varint,2,opt,name=query_index,json=queryIndex,proto3" json:"query_index,omitempty"` } -func (m *ChunkedReadResponse) Reset() { *m = ChunkedReadResponse{} } -func (m *ChunkedReadResponse) String() string { return proto.CompactTextString(m) } -func (*ChunkedReadResponse) ProtoMessage() {} -func (*ChunkedReadResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b3df75c58e6767bb, []int{5} -} -func (m *ChunkedReadResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChunkedReadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChunkedReadResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ChunkedReadResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChunkedReadResponse.Merge(m, src) -} -func (m *ChunkedReadResponse) XXX_Size() int { - return m.Size() -} -func (m *ChunkedReadResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ChunkedReadResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ChunkedReadResponse proto.InternalMessageInfo - -func (m *ChunkedReadResponse) GetChunkedSeries() []*ChunkedSeries { - if m != nil { - return m.ChunkedSeries - } - return nil -} - -func (m *ChunkedReadResponse) GetQueryIndex() int64 { - if m != nil { - return m.QueryIndex - } - return 0 -} - -func init() { - proto.RegisterEnum("prometheus_copy.ReadRequest_ResponseType", ReadRequest_ResponseType_name, ReadRequest_ResponseType_value) - proto.RegisterType((*WriteRequest)(nil), "prometheus_copy.WriteRequest") - proto.RegisterType((*ReadRequest)(nil), "prometheus_copy.ReadRequest") - proto.RegisterType((*ReadResponse)(nil), "prometheus_copy.ReadResponse") - proto.RegisterType((*Query)(nil), "prometheus_copy.Query") - proto.RegisterType((*QueryResult)(nil), "prometheus_copy.QueryResult") - proto.RegisterType((*ChunkedReadResponse)(nil), "prometheus_copy.ChunkedReadResponse") -} - -func init() { proto.RegisterFile("store/storepb/prompb/remote.proto", fileDescriptor_b3df75c58e6767bb) } - -var fileDescriptor_b3df75c58e6767bb = []byte{ - // 535 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x4f, 0x6f, 0xd3, 0x30, - 0x18, 0xc6, 0x9b, 0xb5, 0x5b, 0xab, 0x37, 0xa3, 0x54, 0x1e, 0xb0, 0xaa, 0x40, 0x5a, 0x72, 0x2a, - 0x12, 0x6a, 0xa7, 0x82, 0x90, 0x10, 0xa7, 0x6e, 0x14, 0x8d, 0xb1, 0xf0, 0xc7, 0x2d, 0x02, 0x71, - 0x89, 0xdc, 0xe4, 0xd5, 0x1a, 0xb1, 0xfc, 0x99, 0xed, 0x48, 0xf4, 0xc0, 0x77, 0xe0, 0xcc, 0x27, - 0xda, 0x81, 0xc3, 0x8e, 0x3b, 0x21, 0xd4, 0x7e, 0x11, 0x14, 0x27, 0xa9, 0x32, 0x3a, 0x0e, 0x5c, - 0x22, 0xe7, 0xf1, 0xef, 0x79, 0x6c, 0xbf, 0x7e, 0x0d, 0x0f, 0x84, 0x0c, 0x39, 0xf6, 0xd5, 0x37, - 0x9a, 0xf6, 0x23, 0x1e, 0xfa, 0xd1, 0xb4, 0xcf, 0xd1, 0x0f, 0x25, 0xf6, 0x22, 0x1e, 0xca, 0x90, - 0xdc, 0x4c, 0x44, 0x94, 0x33, 0x8c, 0x85, 0xed, 0x84, 0xd1, 0xbc, 0xd5, 0xb9, 0xd6, 0x23, 0xe7, - 0x11, 0x8a, 0xd4, 0xd2, 0xba, 0x75, 0x12, 0x9e, 0x84, 0x6a, 0xd8, 0x4f, 0x46, 0xa9, 0x6a, 0xfe, - 0xd0, 0x60, 0xfb, 0x23, 0xf7, 0x24, 0x52, 0x3c, 0x8b, 0x51, 0x48, 0x32, 0x04, 0x90, 0x9e, 0x8f, - 0x02, 0xb9, 0x87, 0xa2, 0xa9, 0x75, 0xca, 0x5d, 0x7d, 0x70, 0xb7, 0xf7, 0xd7, 0x72, 0xbd, 0x89, - 0xe7, 0xe3, 0x58, 0x21, 0xfb, 0x95, 0xf3, 0x5f, 0xed, 0x12, 0x2d, 0x98, 0xc8, 0x10, 0x6a, 0x3e, - 0x4a, 0xe6, 0x32, 0xc9, 0x9a, 0x65, 0x15, 0xd0, 0x5e, 0x0b, 0xb0, 0x50, 0x72, 0xcf, 0xb1, 0x32, - 0x2c, 0x0b, 0x59, 0xd9, 0x8e, 0x2a, 0xb5, 0x8d, 0x46, 0xd9, 0xbc, 0xd4, 0x40, 0xa7, 0xc8, 0xdc, - 0x7c, 0x6f, 0x7b, 0x50, 0x3d, 0x8b, 0x8b, 0x1b, 0xbb, 0xb3, 0x96, 0xfb, 0x3e, 0x46, 0x3e, 0xa7, - 0x39, 0x46, 0x18, 0xec, 0x32, 0xc7, 0xc1, 0x48, 0xa2, 0x6b, 0x73, 0x14, 0x51, 0x18, 0x08, 0xb4, - 0x55, 0x55, 0x9a, 0x1b, 0x9d, 0x72, 0xb7, 0x3e, 0x78, 0xb8, 0x96, 0x50, 0x58, 0xb0, 0x47, 0x33, - 0xcb, 0x64, 0x1e, 0x21, 0xbd, 0x9d, 0x27, 0x15, 0x55, 0x61, 0x3e, 0x81, 0xed, 0xa2, 0x40, 0x74, - 0xa8, 0x8e, 0x87, 0xd6, 0xbb, 0xe3, 0xd1, 0xb8, 0x51, 0x22, 0xbb, 0xb0, 0x33, 0x9e, 0xd0, 0xd1, - 0xd0, 0x1a, 0xbd, 0xb0, 0x3f, 0xbd, 0xa5, 0xf6, 0xc1, 0xe1, 0x87, 0x37, 0xaf, 0xc7, 0x0d, 0xcd, - 0x7c, 0x99, 0xb8, 0xd8, 0x2a, 0x8a, 0x3c, 0x85, 0x2a, 0x47, 0x11, 0x9f, 0xca, 0xfc, 0x68, 0xf7, - 0xfe, 0x71, 0x34, 0x05, 0xd1, 0x1c, 0x36, 0x7f, 0x6a, 0xb0, 0xa9, 0x26, 0xc8, 0x23, 0x20, 0x42, - 0x32, 0x2e, 0x6d, 0x75, 0x13, 0x92, 0xf9, 0x91, 0xed, 0x27, 0x61, 0x5a, 0xb7, 0x4c, 0x1b, 0x6a, - 0x66, 0x92, 0x4f, 0x58, 0x82, 0x74, 0xa1, 0x81, 0x81, 0x7b, 0x95, 0xdd, 0x50, 0x6c, 0x1d, 0x03, - 0xb7, 0x48, 0x3e, 0x83, 0x9a, 0xcf, 0xa4, 0x33, 0x43, 0x2e, 0xb2, 0xdb, 0xbc, 0xbf, 0xb6, 0xb5, - 0x63, 0x36, 0xc5, 0x53, 0x2b, 0xa5, 0xe8, 0x0a, 0x27, 0x7b, 0xb0, 0x39, 0xf3, 0x02, 0x29, 0x9a, - 0x95, 0x8e, 0xd6, 0xd5, 0x07, 0xad, 0x6b, 0x6b, 0x7d, 0x98, 0x10, 0x34, 0x05, 0xcd, 0x23, 0xd0, - 0x0b, 0xc7, 0x24, 0xcf, 0xff, 0xb3, 0x19, 0x8b, 0x6d, 0x68, 0x7e, 0x83, 0x9d, 0x83, 0x59, 0x1c, - 0x7c, 0x49, 0x2e, 0xac, 0x50, 0xe9, 0x11, 0xd4, 0x9d, 0x54, 0xb6, 0xaf, 0xe4, 0x1a, 0x6b, 0xb9, - 0x99, 0x3b, 0x8b, 0xbe, 0xe1, 0x14, 0x7f, 0x49, 0x1b, 0xf4, 0xa4, 0xc9, 0xe6, 0xb6, 0x17, 0xb8, - 0xf8, 0x35, 0xab, 0x1d, 0x28, 0xe9, 0x55, 0xa2, 0xec, 0x77, 0xce, 0x17, 0x86, 0x76, 0xb1, 0x30, - 0xb4, 0xdf, 0x0b, 0x43, 0xfb, 0xbe, 0x34, 0x4a, 0x17, 0x4b, 0xa3, 0x74, 0xb9, 0x34, 0x4a, 0x9f, - 0xb7, 0xd2, 0xd7, 0x39, 0xdd, 0x52, 0x4f, 0xf0, 0xf1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x32, - 0xa1, 0xf6, 0xc4, 0xf0, 0x03, 0x00, 0x00, -} - -func (m *WriteRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WriteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Metadata) > 0 { - for iNdEx := len(m.Metadata) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Metadata[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Timeseries) > 0 { - for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Timeseries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ReadRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ReadRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ReadRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AcceptedResponseTypes) > 0 { - dAtA2 := make([]byte, len(m.AcceptedResponseTypes)*10) - var j1 int - for _, num := range m.AcceptedResponseTypes { - for num >= 1<<7 { - dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j1++ - } - dAtA2[j1] = uint8(num) - j1++ - } - i -= j1 - copy(dAtA[i:], dAtA2[:j1]) - i = encodeVarintRemote(dAtA, i, uint64(j1)) - i-- - dAtA[i] = 0x12 - } - if len(m.Queries) > 0 { - for iNdEx := len(m.Queries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Queries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ReadResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ReadResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ReadResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Results) > 0 { - for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Results[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Query) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Query) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Query) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Hints != nil { - { - size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.Matchers) > 0 { - for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Matchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.EndTimestampMs != 0 { - i = encodeVarintRemote(dAtA, i, uint64(m.EndTimestampMs)) - i-- - dAtA[i] = 0x10 - } - if m.StartTimestampMs != 0 { - i = encodeVarintRemote(dAtA, i, uint64(m.StartTimestampMs)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryResult) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryResult) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Timeseries) > 0 { - for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Timeseries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ChunkedReadResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ChunkedReadResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChunkedReadResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.QueryIndex != 0 { - i = encodeVarintRemote(dAtA, i, uint64(m.QueryIndex)) - i-- - dAtA[i] = 0x10 - } - if len(m.ChunkedSeries) > 0 { - for iNdEx := len(m.ChunkedSeries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ChunkedSeries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil +func (x *ChunkedReadResponse) Reset() { + *x = ChunkedReadResponse{} + mi := &file_store_storepb_prompb_remote_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func encodeVarintRemote(dAtA []byte, offset int, v uint64) int { - offset -= sovRemote(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *WriteRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Timeseries) > 0 { - for _, e := range m.Timeseries { - l = e.Size() - n += 1 + l + sovRemote(uint64(l)) - } - } - if len(m.Metadata) > 0 { - for _, e := range m.Metadata { - l = e.Size() - n += 1 + l + sovRemote(uint64(l)) - } - } - return n -} - -func (m *ReadRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Queries) > 0 { - for _, e := range m.Queries { - l = e.Size() - n += 1 + l + sovRemote(uint64(l)) - } - } - if len(m.AcceptedResponseTypes) > 0 { - l = 0 - for _, e := range m.AcceptedResponseTypes { - l += sovRemote(uint64(e)) - } - n += 1 + sovRemote(uint64(l)) + l - } - return n -} - -func (m *ReadResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Results) > 0 { - for _, e := range m.Results { - l = e.Size() - n += 1 + l + sovRemote(uint64(l)) - } - } - return n +func (x *ChunkedReadResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Query) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StartTimestampMs != 0 { - n += 1 + sovRemote(uint64(m.StartTimestampMs)) - } - if m.EndTimestampMs != 0 { - n += 1 + sovRemote(uint64(m.EndTimestampMs)) - } - if len(m.Matchers) > 0 { - for _, e := range m.Matchers { - l = e.Size() - n += 1 + l + sovRemote(uint64(l)) - } - } - if m.Hints != nil { - l = m.Hints.Size() - n += 1 + l + sovRemote(uint64(l)) - } - return n -} +func (*ChunkedReadResponse) ProtoMessage() {} -func (m *QueryResult) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Timeseries) > 0 { - for _, e := range m.Timeseries { - l = e.Size() - n += 1 + l + sovRemote(uint64(l)) +func (x *ChunkedReadResponse) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_prompb_remote_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - return n + return mi.MessageOf(x) } -func (m *ChunkedReadResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ChunkedSeries) > 0 { - for _, e := range m.ChunkedSeries { - l = e.Size() - n += 1 + l + sovRemote(uint64(l)) - } - } - if m.QueryIndex != 0 { - n += 1 + sovRemote(uint64(m.QueryIndex)) - } - return n -} - -func sovRemote(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRemote(x uint64) (n int) { - return sovRemote(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *WriteRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WriteRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WriteRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Timeseries = append(m.Timeseries, TimeSeries{}) - if err := m.Timeseries[len(m.Timeseries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Metadata = append(m.Metadata, MetricMetadata{}) - if err := m.Metadata[len(m.Metadata)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRemote(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRemote - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ReadRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ReadRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ReadRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Queries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Queries = append(m.Queries, &Query{}) - if err := m.Queries[len(m.Queries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType == 0 { - var v ReadRequest_ResponseType - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= ReadRequest_ResponseType(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AcceptedResponseTypes = append(m.AcceptedResponseTypes, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - if elementCount != 0 && len(m.AcceptedResponseTypes) == 0 { - m.AcceptedResponseTypes = make([]ReadRequest_ResponseType, 0, elementCount) - } - for iNdEx < postIndex { - var v ReadRequest_ResponseType - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= ReadRequest_ResponseType(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AcceptedResponseTypes = append(m.AcceptedResponseTypes, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field AcceptedResponseTypes", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipRemote(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRemote - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ReadResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ReadResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ReadResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Results = append(m.Results, &QueryResult{}) - if err := m.Results[len(m.Results)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRemote(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRemote - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +// Deprecated: Use ChunkedReadResponse.ProtoReflect.Descriptor instead. +func (*ChunkedReadResponse) Descriptor() ([]byte, []int) { + return file_store_storepb_prompb_remote_proto_rawDescGZIP(), []int{5} } -func (m *Query) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Query: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Query: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTimestampMs", wireType) - } - m.StartTimestampMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartTimestampMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTimestampMs", wireType) - } - m.EndTimestampMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EndTimestampMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Matchers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Matchers = append(m.Matchers, &LabelMatcher{}) - if err := m.Matchers[len(m.Matchers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Hints == nil { - m.Hints = &ReadHints{} - } - if err := m.Hints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRemote(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRemote - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ChunkedReadResponse) GetChunkedSeries() []*ChunkedSeries { + if x != nil { + return x.ChunkedSeries } return nil } -func (m *QueryResult) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryResult: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryResult: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Timeseries = append(m.Timeseries, &TimeSeries{}) - if err := m.Timeseries[len(m.Timeseries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRemote(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRemote - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ChunkedReadResponse) GetQueryIndex() int64 { + if x != nil { + return x.QueryIndex } - return nil + return 0 } -func (m *ChunkedReadResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ChunkedReadResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChunkedReadResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChunkedSeries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChunkedSeries = append(m.ChunkedSeries, &ChunkedSeries{}) - if err := m.ChunkedSeries[len(m.ChunkedSeries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field QueryIndex", wireType) - } - m.QueryIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.QueryIndex |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRemote(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRemote - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRemote(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRemote - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRemote - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRemote - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthRemote - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRemote - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRemote - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF +var File_store_storepb_prompb_remote_proto protoreflect.FileDescriptor + +var file_store_storepb_prompb_remote_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2f, + 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x62, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, + 0x63, 0x6f, 0x70, 0x79, 0x1a, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x70, 0x62, 0x2f, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x62, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x76, + 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x74, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x74, 0x61, 0x67, + 0x67, 0x65, 0x72, 0x2f, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xc2, 0x01, 0x0a, 0x0c, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x53, 0x0a, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, + 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, + 0x65, 0x73, 0x42, 0x16, 0x9a, 0x84, 0x9e, 0x03, 0x11, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x51, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, + 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x14, 0x9a, 0x84, 0x9e, 0x03, 0x0f, + 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x52, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x04, 0xa8, 0xa6, 0x1f, 0x01, 0x4a, + 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0xd8, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, + 0x65, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x07, + 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x61, 0x0a, 0x17, 0x61, 0x63, 0x63, 0x65, 0x70, + 0x74, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, + 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x15, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x34, 0x0a, 0x0c, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x41, + 0x4d, 0x50, 0x4c, 0x45, 0x53, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x54, 0x52, 0x45, 0x41, + 0x4d, 0x45, 0x44, 0x5f, 0x58, 0x4f, 0x52, 0x5f, 0x43, 0x48, 0x55, 0x4e, 0x4b, 0x53, 0x10, 0x01, + 0x22, 0x46, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x36, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, 0x63, + 0x6f, 0x70, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, + 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xcc, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x12, 0x2c, 0x0a, 0x12, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x73, + 0x12, 0x28, 0x0a, 0x10, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x5f, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x65, 0x6e, 0x64, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x73, 0x12, 0x39, 0x0a, 0x08, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, + 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x2e, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x08, 0x6d, 0x61, 0x74, + 0x63, 0x68, 0x65, 0x72, 0x73, 0x12, 0x30, 0x0a, 0x05, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, + 0x73, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x48, 0x69, 0x6e, 0x74, 0x73, + 0x52, 0x05, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x22, 0x4a, 0x0a, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x3b, 0x0a, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x65, + 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, + 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x65, 0x72, + 0x69, 0x65, 0x73, 0x22, 0x7d, 0x0a, 0x13, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x52, 0x65, + 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0e, 0x63, 0x68, + 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, + 0x63, 0x6f, 0x70, 0x79, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x53, 0x65, 0x72, 0x69, + 0x65, 0x73, 0x52, 0x0d, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x53, 0x65, 0x72, 0x69, 0x65, + 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x71, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, + 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x70, 0x62, 0x2f, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( - ErrInvalidLengthRemote = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRemote = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRemote = fmt.Errorf("proto: unexpected end of group") + file_store_storepb_prompb_remote_proto_rawDescOnce sync.Once + file_store_storepb_prompb_remote_proto_rawDescData = file_store_storepb_prompb_remote_proto_rawDesc ) + +func file_store_storepb_prompb_remote_proto_rawDescGZIP() []byte { + file_store_storepb_prompb_remote_proto_rawDescOnce.Do(func() { + file_store_storepb_prompb_remote_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_storepb_prompb_remote_proto_rawDescData) + }) + return file_store_storepb_prompb_remote_proto_rawDescData +} + +var file_store_storepb_prompb_remote_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_store_storepb_prompb_remote_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_store_storepb_prompb_remote_proto_goTypes = []any{ + (ReadRequest_ResponseType)(0), // 0: prometheus_copy.ReadRequest.ResponseType + (*WriteRequest)(nil), // 1: prometheus_copy.WriteRequest + (*ReadRequest)(nil), // 2: prometheus_copy.ReadRequest + (*ReadResponse)(nil), // 3: prometheus_copy.ReadResponse + (*Query)(nil), // 4: prometheus_copy.Query + (*QueryResult)(nil), // 5: prometheus_copy.QueryResult + (*ChunkedReadResponse)(nil), // 6: prometheus_copy.ChunkedReadResponse + (*TimeSeries)(nil), // 7: prometheus_copy.TimeSeries + (*MetricMetadata)(nil), // 8: prometheus_copy.MetricMetadata + (*LabelMatcher)(nil), // 9: prometheus_copy.LabelMatcher + (*ReadHints)(nil), // 10: prometheus_copy.ReadHints + (*ChunkedSeries)(nil), // 11: prometheus_copy.ChunkedSeries +} +var file_store_storepb_prompb_remote_proto_depIdxs = []int32{ + 7, // 0: prometheus_copy.WriteRequest.timeseries:type_name -> prometheus_copy.TimeSeries + 8, // 1: prometheus_copy.WriteRequest.metadata:type_name -> prometheus_copy.MetricMetadata + 4, // 2: prometheus_copy.ReadRequest.queries:type_name -> prometheus_copy.Query + 0, // 3: prometheus_copy.ReadRequest.accepted_response_types:type_name -> prometheus_copy.ReadRequest.ResponseType + 5, // 4: prometheus_copy.ReadResponse.results:type_name -> prometheus_copy.QueryResult + 9, // 5: prometheus_copy.Query.matchers:type_name -> prometheus_copy.LabelMatcher + 10, // 6: prometheus_copy.Query.hints:type_name -> prometheus_copy.ReadHints + 7, // 7: prometheus_copy.QueryResult.timeseries:type_name -> prometheus_copy.TimeSeries + 11, // 8: prometheus_copy.ChunkedReadResponse.chunked_series:type_name -> prometheus_copy.ChunkedSeries + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_store_storepb_prompb_remote_proto_init() } +func file_store_storepb_prompb_remote_proto_init() { + if File_store_storepb_prompb_remote_proto != nil { + return + } + file_store_storepb_prompb_types_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_store_storepb_prompb_remote_proto_rawDesc, + NumEnums: 1, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_store_storepb_prompb_remote_proto_goTypes, + DependencyIndexes: file_store_storepb_prompb_remote_proto_depIdxs, + EnumInfos: file_store_storepb_prompb_remote_proto_enumTypes, + MessageInfos: file_store_storepb_prompb_remote_proto_msgTypes, + }.Build() + File_store_storepb_prompb_remote_proto = out.File + file_store_storepb_prompb_remote_proto_rawDesc = nil + file_store_storepb_prompb_remote_proto_goTypes = nil + file_store_storepb_prompb_remote_proto_depIdxs = nil +} diff --git a/pkg/store/storepb/prompb/remote.proto b/pkg/store/storepb/prompb/remote.proto index b765bb79060..8ba7bda6494 100644 --- a/pkg/store/storepb/prompb/remote.proto +++ b/pkg/store/storepb/prompb/remote.proto @@ -17,23 +17,19 @@ syntax = "proto3"; package prometheus_copy; -option go_package = "prompb"; +option go_package = "github.com/thanos-io/thanos/pkg/store/storepb/prompb"; import "store/storepb/prompb/types.proto"; -import "gogoproto/gogo.proto"; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; +import "github.com/planetscale/vtprotobuf/vtproto/ext.proto"; +import "tagger/tagger.proto"; message WriteRequest { - repeated TimeSeries timeseries = 1 [(gogoproto.nullable) = false]; + option (vtproto.mempool) = true; + repeated TimeSeries timeseries = 1 [(tagger.tags) = "json:\"timeseries\""]; // Cortex uses this field to determine the source of the write request. // We reserve it to avoid any compatibility issues. reserved 2; - repeated MetricMetadata metadata = 3 [(gogoproto.nullable) = false]; + repeated MetricMetadata metadata = 3 [(tagger.tags) = "json:\"metadata\""]; } // ReadRequest represents a remote read request. diff --git a/pkg/store/storepb/prompb/remote_vtproto.pb.go b/pkg/store/storepb/prompb/remote_vtproto.pb.go new file mode 100644 index 00000000000..dcbba2bb393 --- /dev/null +++ b/pkg/store/storepb/prompb/remote_vtproto.pb.go @@ -0,0 +1,1553 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.1-0.20250313105119-ba97887b0a25 +// source: store/storepb/prompb/remote.proto + +package prompb + +import ( + fmt "fmt" + io "io" + sync "sync" + + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *WriteRequest) CloneVT() *WriteRequest { + if m == nil { + return (*WriteRequest)(nil) + } + r := WriteRequestFromVTPool() + if rhs := m.Timeseries; rhs != nil { + tmpContainer := make([]*TimeSeries, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Timeseries = tmpContainer + } + if rhs := m.Metadata; rhs != nil { + tmpContainer := make([]*MetricMetadata, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Metadata = tmpContainer + } + return r +} + +func (m *WriteRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ReadRequest) CloneVT() *ReadRequest { + if m == nil { + return (*ReadRequest)(nil) + } + r := new(ReadRequest) + if rhs := m.Queries; rhs != nil { + tmpContainer := make([]*Query, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Queries = tmpContainer + } + if rhs := m.AcceptedResponseTypes; rhs != nil { + tmpContainer := make([]ReadRequest_ResponseType, len(rhs)) + copy(tmpContainer, rhs) + r.AcceptedResponseTypes = tmpContainer + } + return r +} + +func (m *ReadRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ReadResponse) CloneVT() *ReadResponse { + if m == nil { + return (*ReadResponse)(nil) + } + r := new(ReadResponse) + if rhs := m.Results; rhs != nil { + tmpContainer := make([]*QueryResult, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Results = tmpContainer + } + return r +} + +func (m *ReadResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Query) CloneVT() *Query { + if m == nil { + return (*Query)(nil) + } + r := new(Query) + r.StartTimestampMs = m.StartTimestampMs + r.EndTimestampMs = m.EndTimestampMs + r.Hints = m.Hints.CloneVT() + if rhs := m.Matchers; rhs != nil { + tmpContainer := make([]*LabelMatcher, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Matchers = tmpContainer + } + return r +} + +func (m *Query) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *QueryResult) CloneVT() *QueryResult { + if m == nil { + return (*QueryResult)(nil) + } + r := new(QueryResult) + if rhs := m.Timeseries; rhs != nil { + tmpContainer := make([]*TimeSeries, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Timeseries = tmpContainer + } + return r +} + +func (m *QueryResult) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ChunkedReadResponse) CloneVT() *ChunkedReadResponse { + if m == nil { + return (*ChunkedReadResponse)(nil) + } + r := new(ChunkedReadResponse) + r.QueryIndex = m.QueryIndex + if rhs := m.ChunkedSeries; rhs != nil { + tmpContainer := make([]*ChunkedSeries, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.ChunkedSeries = tmpContainer + } + return r +} + +func (m *ChunkedReadResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *WriteRequest) EqualVT(that *WriteRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Timeseries) != len(that.Timeseries) { + return false + } + for i, vx := range this.Timeseries { + vy := that.Timeseries[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &TimeSeries{} + } + if q == nil { + q = &TimeSeries{} + } + if !p.EqualVT(q) { + return false + } + } + } + if len(this.Metadata) != len(that.Metadata) { + return false + } + for i, vx := range this.Metadata { + vy := that.Metadata[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &MetricMetadata{} + } + if q == nil { + q = &MetricMetadata{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *WriteRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*WriteRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ReadRequest) EqualVT(that *ReadRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Queries) != len(that.Queries) { + return false + } + for i, vx := range this.Queries { + vy := that.Queries[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Query{} + } + if q == nil { + q = &Query{} + } + if !p.EqualVT(q) { + return false + } + } + } + if len(this.AcceptedResponseTypes) != len(that.AcceptedResponseTypes) { + return false + } + for i, vx := range this.AcceptedResponseTypes { + vy := that.AcceptedResponseTypes[i] + if vx != vy { + return false + } + } + return true +} + +func (this *ReadRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ReadRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ReadResponse) EqualVT(that *ReadResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Results) != len(that.Results) { + return false + } + for i, vx := range this.Results { + vy := that.Results[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &QueryResult{} + } + if q == nil { + q = &QueryResult{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *ReadResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ReadResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Query) EqualVT(that *Query) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.StartTimestampMs != that.StartTimestampMs { + return false + } + if this.EndTimestampMs != that.EndTimestampMs { + return false + } + if len(this.Matchers) != len(that.Matchers) { + return false + } + for i, vx := range this.Matchers { + vy := that.Matchers[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &LabelMatcher{} + } + if q == nil { + q = &LabelMatcher{} + } + if !p.EqualVT(q) { + return false + } + } + } + if !this.Hints.EqualVT(that.Hints) { + return false + } + return true +} + +func (this *Query) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Query) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *QueryResult) EqualVT(that *QueryResult) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Timeseries) != len(that.Timeseries) { + return false + } + for i, vx := range this.Timeseries { + vy := that.Timeseries[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &TimeSeries{} + } + if q == nil { + q = &TimeSeries{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *QueryResult) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*QueryResult) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ChunkedReadResponse) EqualVT(that *ChunkedReadResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.ChunkedSeries) != len(that.ChunkedSeries) { + return false + } + for i, vx := range this.ChunkedSeries { + vy := that.ChunkedSeries[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &ChunkedSeries{} + } + if q == nil { + q = &ChunkedSeries{} + } + if !p.EqualVT(q) { + return false + } + } + } + if this.QueryIndex != that.QueryIndex { + return false + } + return true +} + +func (this *ChunkedReadResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ChunkedReadResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *WriteRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WriteRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *WriteRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Metadata) > 0 { + for iNdEx := len(m.Metadata) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Metadata[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Timeseries) > 0 { + for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Timeseries[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ReadRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ReadRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ReadRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AcceptedResponseTypes) > 0 { + var pksize2 int + for _, num := range m.AcceptedResponseTypes { + pksize2 += protohelpers.SizeOfVarint(uint64(num)) + } + i -= pksize2 + j1 := i + for _, num1 := range m.AcceptedResponseTypes { + num := uint64(num1) + for num >= 1<<7 { + dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA[j1] = uint8(num) + j1++ + } + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) + i-- + dAtA[i] = 0x12 + } + if len(m.Queries) > 0 { + for iNdEx := len(m.Queries) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Queries[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ReadResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ReadResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ReadResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Results) > 0 { + for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Results[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Query) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Query) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Query) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.Hints != nil { + size, err := m.Hints.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if len(m.Matchers) > 0 { + for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Matchers[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + } + if m.EndTimestampMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.EndTimestampMs)) + i-- + dAtA[i] = 0x10 + } + if m.StartTimestampMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StartTimestampMs)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryResult) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryResult) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *QueryResult) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Timeseries) > 0 { + for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Timeseries[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ChunkedReadResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ChunkedReadResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ChunkedReadResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.QueryIndex != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.QueryIndex)) + i-- + dAtA[i] = 0x10 + } + if len(m.ChunkedSeries) > 0 { + for iNdEx := len(m.ChunkedSeries) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.ChunkedSeries[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +var vtprotoPool_WriteRequest = sync.Pool{ + New: func() interface{} { + return &WriteRequest{} + }, +} + +func (m *WriteRequest) ResetVT() { + if m != nil { + for _, mm := range m.Timeseries { + mm.ResetVT() + } + f0 := m.Timeseries[:0] + for _, mm := range m.Metadata { + mm.ResetVT() + } + f1 := m.Metadata[:0] + m.Reset() + m.Timeseries = f0 + m.Metadata = f1 + } +} +func (m *WriteRequest) ReturnToVTPool() { + if m != nil { + m.ResetVT() + vtprotoPool_WriteRequest.Put(m) + } +} +func WriteRequestFromVTPool() *WriteRequest { + return vtprotoPool_WriteRequest.Get().(*WriteRequest) +} +func (m *WriteRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Timeseries) > 0 { + for _, e := range m.Timeseries { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.Metadata) > 0 { + for _, e := range m.Metadata { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *ReadRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Queries) > 0 { + for _, e := range m.Queries { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.AcceptedResponseTypes) > 0 { + l = 0 + for _, e := range m.AcceptedResponseTypes { + l += protohelpers.SizeOfVarint(uint64(e)) + } + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l + } + return n +} + +func (m *ReadResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Results) > 0 { + for _, e := range m.Results { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *Query) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StartTimestampMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StartTimestampMs)) + } + if m.EndTimestampMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.EndTimestampMs)) + } + if len(m.Matchers) > 0 { + for _, e := range m.Matchers { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.Hints != nil { + l = m.Hints.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *QueryResult) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Timeseries) > 0 { + for _, e := range m.Timeseries { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *ChunkedReadResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ChunkedSeries) > 0 { + for _, e := range m.ChunkedSeries { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.QueryIndex != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.QueryIndex)) + } + return n +} + +func (m *WriteRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WriteRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WriteRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if len(m.Timeseries) == cap(m.Timeseries) { + m.Timeseries = append(m.Timeseries, &TimeSeries{}) + } else { + m.Timeseries = m.Timeseries[:len(m.Timeseries)+1] + if m.Timeseries[len(m.Timeseries)-1] == nil { + m.Timeseries[len(m.Timeseries)-1] = &TimeSeries{} + } + } + if err := m.Timeseries[len(m.Timeseries)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if len(m.Metadata) == cap(m.Metadata) { + m.Metadata = append(m.Metadata, &MetricMetadata{}) + } else { + m.Metadata = m.Metadata[:len(m.Metadata)+1] + if m.Metadata[len(m.Metadata)-1] == nil { + m.Metadata[len(m.Metadata)-1] = &MetricMetadata{} + } + } + if err := m.Metadata[len(m.Metadata)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ReadRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ReadRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ReadRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Queries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Queries = append(m.Queries, &Query{}) + if err := m.Queries[len(m.Queries)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType == 0 { + var v ReadRequest_ResponseType + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= ReadRequest_ResponseType(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AcceptedResponseTypes = append(m.AcceptedResponseTypes, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + if elementCount != 0 && len(m.AcceptedResponseTypes) == 0 { + m.AcceptedResponseTypes = make([]ReadRequest_ResponseType, 0, elementCount) + } + for iNdEx < postIndex { + var v ReadRequest_ResponseType + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= ReadRequest_ResponseType(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AcceptedResponseTypes = append(m.AcceptedResponseTypes, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field AcceptedResponseTypes", wireType) + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ReadResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ReadResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ReadResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Results = append(m.Results, &QueryResult{}) + if err := m.Results[len(m.Results)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Query) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Query: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Query: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTimestampMs", wireType) + } + m.StartTimestampMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartTimestampMs |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EndTimestampMs", wireType) + } + m.EndTimestampMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EndTimestampMs |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Matchers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Matchers = append(m.Matchers, &LabelMatcher{}) + if err := m.Matchers[len(m.Matchers)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Hints == nil { + m.Hints = &ReadHints{} + } + if err := m.Hints.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryResult) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Timeseries = append(m.Timeseries, &TimeSeries{}) + if err := m.Timeseries[len(m.Timeseries)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ChunkedReadResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ChunkedReadResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChunkedReadResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChunkedSeries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChunkedSeries = append(m.ChunkedSeries, &ChunkedSeries{}) + if err := m.ChunkedSeries[len(m.ChunkedSeries)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryIndex", wireType) + } + m.QueryIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.QueryIndex |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pkg/store/storepb/prompb/samples.go b/pkg/store/storepb/prompb/samples.go index 0da00daf4df..f9e17532e17 100644 --- a/pkg/store/storepb/prompb/samples.go +++ b/pkg/store/storepb/prompb/samples.go @@ -11,10 +11,10 @@ import ( // SamplesFromSamplePairs converts a slice of model.SamplePair // to a slice of Sample. -func SamplesFromSamplePairs(samples []model.SamplePair) []Sample { - result := make([]Sample, 0, len(samples)) +func SamplesFromSamplePairs(samples []model.SamplePair) []*Sample { + result := make([]*Sample, 0, len(samples)) for _, s := range samples { - result = append(result, Sample{ + result = append(result, &Sample{ Value: float64(s.Value), Timestamp: int64(s.Timestamp), }) @@ -25,12 +25,12 @@ func SamplesFromSamplePairs(samples []model.SamplePair) []Sample { // SamplesFromPromqlSamples converts a slice of promql.Sample // to a slice of Sample. -func SamplesFromPromqlSamples(samples ...promql.Sample) ([]Sample, []Histogram) { - floats := make([]Sample, 0, len(samples)) - histograms := make([]Histogram, 0, len(samples)) +func SamplesFromPromqlSamples(samples ...promql.Sample) ([]*Sample, []*Histogram) { + floats := make([]*Sample, 0, len(samples)) + histograms := make([]*Histogram, 0, len(samples)) for _, s := range samples { if s.H == nil { - floats = append(floats, Sample{ + floats = append(floats, &Sample{ Value: s.F, Timestamp: s.T, }) @@ -43,15 +43,15 @@ func SamplesFromPromqlSamples(samples ...promql.Sample) ([]Sample, []Histogram) } // SamplesFromPromqlSeries converts promql.Series to a slice of Sample and a slice of Histogram. -func SamplesFromPromqlSeries(series promql.Series) ([]Sample, []Histogram) { - floats := make([]Sample, 0, len(series.Floats)) +func SamplesFromPromqlSeries(series promql.Series) ([]*Sample, []*Histogram) { + floats := make([]*Sample, 0, len(series.Floats)) for _, f := range series.Floats { - floats = append(floats, Sample{ + floats = append(floats, &Sample{ Value: f.F, Timestamp: f.T, }) } - histograms := make([]Histogram, 0, len(series.Histograms)) + histograms := make([]*Histogram, 0, len(series.Histograms)) for _, h := range series.Histograms { histograms = append(histograms, FloatHistogramToHistogramProto(h.T, h.H)) } @@ -63,7 +63,7 @@ func SamplesFromPromqlSeries(series promql.Series) ([]Sample, []Histogram) { // provided proto message. The caller has to make sure that the proto message // represents an integer histogram and not a float histogram. // Copied from https://github.com/prometheus/prometheus/blob/0ab95536115adfe50af249d36d73674be694ca3f/storage/remote/codec.go#L626-L645 -func HistogramProtoToHistogram(hp Histogram) *histogram.Histogram { +func HistogramProtoToHistogram(hp *Histogram) *histogram.Histogram { if hp.IsFloatHistogram() { panic("HistogramProtoToHistogram called with a float histogram") } @@ -83,7 +83,7 @@ func HistogramProtoToHistogram(hp Histogram) *histogram.Histogram { // FloatHistogramToHistogramProto converts a float histogram to a protobuf type. // Copied from https://github.com/prometheus/prometheus/blob/0ab95536115adfe50af249d36d73674be694ca3f/storage/remote/codec.go#L647-L667 -func FloatHistogramProtoToFloatHistogram(hp Histogram) *histogram.FloatHistogram { +func FloatHistogramProtoToFloatHistogram(hp *Histogram) *histogram.FloatHistogram { if !hp.IsFloatHistogram() { panic("FloatHistogramProtoToFloatHistogram called with an integer histogram") } @@ -105,7 +105,7 @@ func FloatHistogramProtoToFloatHistogram(hp Histogram) *histogram.FloatHistogram // provided proto message to a Float Histogram. The caller has to make sure that // the proto message represents an float histogram and not a integer histogram. // Copied from https://github.com/prometheus/prometheus/blob/0ab95536115adfe50af249d36d73674be694ca3f/storage/remote/codec.go#L669-L688 -func HistogramProtoToFloatHistogram(hp Histogram) *histogram.FloatHistogram { +func HistogramProtoToFloatHistogram(hp *Histogram) *histogram.FloatHistogram { if hp.IsFloatHistogram() { panic("HistogramProtoToFloatHistogram called with a float histogram") } @@ -123,7 +123,7 @@ func HistogramProtoToFloatHistogram(hp Histogram) *histogram.FloatHistogram { } } -func spansProtoToSpans(s []BucketSpan) []histogram.Span { +func spansProtoToSpans(s []*BucketSpan) []histogram.Span { spans := make([]histogram.Span, len(s)) for i := 0; i < len(s); i++ { spans[i] = histogram.Span{Offset: s[i].Offset, Length: s[i].Length} @@ -143,8 +143,8 @@ func deltasToCounts(deltas []int64) []float64 { } // Copied from https://github.com/prometheus/prometheus/blob/0ab95536115adfe50af249d36d73674be694ca3f/storage/remote/codec.go#L709-L723 -func HistogramToHistogramProto(timestamp int64, h *histogram.Histogram) Histogram { - return Histogram{ +func HistogramToHistogramProto(timestamp int64, h *histogram.Histogram) *Histogram { + return &Histogram{ Count: &Histogram_CountInt{CountInt: h.Count}, Sum: h.Sum, Schema: h.Schema, @@ -160,8 +160,8 @@ func HistogramToHistogramProto(timestamp int64, h *histogram.Histogram) Histogra } // Copied from https://github.com/prometheus/prometheus/blob/0ab95536115adfe50af249d36d73674be694ca3f/storage/remote/codec.go#L725-L739 -func FloatHistogramToHistogramProto(timestamp int64, fh *histogram.FloatHistogram) Histogram { - return Histogram{ +func FloatHistogramToHistogramProto(timestamp int64, fh *histogram.FloatHistogram) *Histogram { + return &Histogram{ Count: &Histogram_CountFloat{CountFloat: fh.Count}, Sum: fh.Sum, Schema: fh.Schema, @@ -176,10 +176,10 @@ func FloatHistogramToHistogramProto(timestamp int64, fh *histogram.FloatHistogra } } -func spansToSpansProto(s []histogram.Span) []BucketSpan { - spans := make([]BucketSpan, len(s)) +func spansToSpansProto(s []histogram.Span) []*BucketSpan { + spans := make([]*BucketSpan, len(s)) for i := 0; i < len(s); i++ { - spans[i] = BucketSpan{Offset: s[i].Offset, Length: s[i].Length} + spans[i] = &BucketSpan{Offset: s[i].Offset, Length: s[i].Length} } return spans diff --git a/pkg/store/storepb/prompb/types.pb.go b/pkg/store/storepb/prompb/types.pb.go index 46aca14f64a..1a9181d0a30 100644 --- a/pkg/store/storepb/prompb/types.pb.go +++ b/pkg/store/storepb/prompb/types.pb.go @@ -1,31 +1,44 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Copyright 2017 Prometheus Team +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.20.1 // source: store/storepb/prompb/types.proto package prompb import ( - encoding_binary "encoding/binary" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/thanos-io/thanos/pkg/store/labelpb" - github_com_thanos_io_thanos_pkg_store_labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" + reflect "reflect" + sync "sync" + + _ "github.com/planetscale/vtprotobuf/vtproto" + _ "github.com/srikrsna/protoc-gen-gotag/tagger" + labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type MetricMetadata_MetricType int32 @@ -40,65 +53,107 @@ const ( MetricMetadata_STATESET MetricMetadata_MetricType = 7 ) -var MetricMetadata_MetricType_name = map[int32]string{ - 0: "UNKNOWN", - 1: "COUNTER", - 2: "GAUGE", - 3: "HISTOGRAM", - 4: "GAUGEHISTOGRAM", - 5: "SUMMARY", - 6: "INFO", - 7: "STATESET", -} +// Enum value maps for MetricMetadata_MetricType. +var ( + MetricMetadata_MetricType_name = map[int32]string{ + 0: "UNKNOWN", + 1: "COUNTER", + 2: "GAUGE", + 3: "HISTOGRAM", + 4: "GAUGEHISTOGRAM", + 5: "SUMMARY", + 6: "INFO", + 7: "STATESET", + } + MetricMetadata_MetricType_value = map[string]int32{ + "UNKNOWN": 0, + "COUNTER": 1, + "GAUGE": 2, + "HISTOGRAM": 3, + "GAUGEHISTOGRAM": 4, + "SUMMARY": 5, + "INFO": 6, + "STATESET": 7, + } +) -var MetricMetadata_MetricType_value = map[string]int32{ - "UNKNOWN": 0, - "COUNTER": 1, - "GAUGE": 2, - "HISTOGRAM": 3, - "GAUGEHISTOGRAM": 4, - "SUMMARY": 5, - "INFO": 6, - "STATESET": 7, +func (x MetricMetadata_MetricType) Enum() *MetricMetadata_MetricType { + p := new(MetricMetadata_MetricType) + *p = x + return p } func (x MetricMetadata_MetricType) String() string { - return proto.EnumName(MetricMetadata_MetricType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MetricMetadata_MetricType) Descriptor() protoreflect.EnumDescriptor { + return file_store_storepb_prompb_types_proto_enumTypes[0].Descriptor() +} + +func (MetricMetadata_MetricType) Type() protoreflect.EnumType { + return &file_store_storepb_prompb_types_proto_enumTypes[0] +} + +func (x MetricMetadata_MetricType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } +// Deprecated: Use MetricMetadata_MetricType.Descriptor instead. func (MetricMetadata_MetricType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{0, 0} + return file_store_storepb_prompb_types_proto_rawDescGZIP(), []int{0, 0} } type Histogram_ResetHint int32 const ( - Histogram_UNKNOWN Histogram_ResetHint = 0 - Histogram_YES Histogram_ResetHint = 1 - Histogram_NO Histogram_ResetHint = 2 - Histogram_GAUGE Histogram_ResetHint = 3 + Histogram_UNKNOWN Histogram_ResetHint = 0 // Need to test for a counter reset explicitly. + Histogram_YES Histogram_ResetHint = 1 // This is the 1st histogram after a counter reset. + Histogram_NO Histogram_ResetHint = 2 // There was no counter reset between this and the previous Histogram. + Histogram_GAUGE Histogram_ResetHint = 3 // This is a gauge histogram where counter resets don't happen. ) -var Histogram_ResetHint_name = map[int32]string{ - 0: "UNKNOWN", - 1: "YES", - 2: "NO", - 3: "GAUGE", -} +// Enum value maps for Histogram_ResetHint. +var ( + Histogram_ResetHint_name = map[int32]string{ + 0: "UNKNOWN", + 1: "YES", + 2: "NO", + 3: "GAUGE", + } + Histogram_ResetHint_value = map[string]int32{ + "UNKNOWN": 0, + "YES": 1, + "NO": 2, + "GAUGE": 3, + } +) -var Histogram_ResetHint_value = map[string]int32{ - "UNKNOWN": 0, - "YES": 1, - "NO": 2, - "GAUGE": 3, +func (x Histogram_ResetHint) Enum() *Histogram_ResetHint { + p := new(Histogram_ResetHint) + *p = x + return p } func (x Histogram_ResetHint) String() string { - return proto.EnumName(Histogram_ResetHint_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Histogram_ResetHint) Descriptor() protoreflect.EnumDescriptor { + return file_store_storepb_prompb_types_proto_enumTypes[1].Descriptor() +} + +func (Histogram_ResetHint) Type() protoreflect.EnumType { + return &file_store_storepb_prompb_types_proto_enumTypes[1] +} + +func (x Histogram_ResetHint) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } +// Deprecated: Use Histogram_ResetHint.Descriptor instead. func (Histogram_ResetHint) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{3, 0} + return file_store_storepb_prompb_types_proto_rawDescGZIP(), []int{3, 0} } type LabelMatcher_Type int32 @@ -110,26 +165,47 @@ const ( LabelMatcher_NRE LabelMatcher_Type = 3 ) -var LabelMatcher_Type_name = map[int32]string{ - 0: "EQ", - 1: "NEQ", - 2: "RE", - 3: "NRE", -} +// Enum value maps for LabelMatcher_Type. +var ( + LabelMatcher_Type_name = map[int32]string{ + 0: "EQ", + 1: "NEQ", + 2: "RE", + 3: "NRE", + } + LabelMatcher_Type_value = map[string]int32{ + "EQ": 0, + "NEQ": 1, + "RE": 2, + "NRE": 3, + } +) -var LabelMatcher_Type_value = map[string]int32{ - "EQ": 0, - "NEQ": 1, - "RE": 2, - "NRE": 3, +func (x LabelMatcher_Type) Enum() *LabelMatcher_Type { + p := new(LabelMatcher_Type) + *p = x + return p } func (x LabelMatcher_Type) String() string { - return proto.EnumName(LabelMatcher_Type_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (LabelMatcher_Type) Descriptor() protoreflect.EnumDescriptor { + return file_store_storepb_prompb_types_proto_enumTypes[2].Descriptor() +} + +func (LabelMatcher_Type) Type() protoreflect.EnumType { + return &file_store_storepb_prompb_types_proto_enumTypes[2] +} + +func (x LabelMatcher_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } +// Deprecated: Use LabelMatcher_Type.Descriptor instead. func (LabelMatcher_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{6, 0} + return file_store_storepb_prompb_types_proto_rawDescGZIP(), []int{6, 0} } // We require this to match chunkenc.Encoding. @@ -142,29 +218,54 @@ const ( Chunk_FLOAT_HISTOGRAM Chunk_Encoding = 3 ) -var Chunk_Encoding_name = map[int32]string{ - 0: "UNKNOWN", - 1: "XOR", - 2: "HISTOGRAM", - 3: "FLOAT_HISTOGRAM", -} +// Enum value maps for Chunk_Encoding. +var ( + Chunk_Encoding_name = map[int32]string{ + 0: "UNKNOWN", + 1: "XOR", + 2: "HISTOGRAM", + 3: "FLOAT_HISTOGRAM", + } + Chunk_Encoding_value = map[string]int32{ + "UNKNOWN": 0, + "XOR": 1, + "HISTOGRAM": 2, + "FLOAT_HISTOGRAM": 3, + } +) -var Chunk_Encoding_value = map[string]int32{ - "UNKNOWN": 0, - "XOR": 1, - "HISTOGRAM": 2, - "FLOAT_HISTOGRAM": 3, +func (x Chunk_Encoding) Enum() *Chunk_Encoding { + p := new(Chunk_Encoding) + *p = x + return p } func (x Chunk_Encoding) String() string { - return proto.EnumName(Chunk_Encoding_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Chunk_Encoding) Descriptor() protoreflect.EnumDescriptor { + return file_store_storepb_prompb_types_proto_enumTypes[3].Descriptor() +} + +func (Chunk_Encoding) Type() protoreflect.EnumType { + return &file_store_storepb_prompb_types_proto_enumTypes[3] +} + +func (x Chunk_Encoding) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } +// Deprecated: Use Chunk_Encoding.Descriptor instead. func (Chunk_Encoding) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{8, 0} + return file_store_storepb_prompb_types_proto_rawDescGZIP(), []int{8, 0} } type MetricMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Represents the metric type, these match the set from Prometheus. // Refer to pkg/textparse/interface.go for details. Type MetricMetadata_MetricType `protobuf:"varint,1,opt,name=type,proto3,enum=prometheus_copy.MetricMetadata_MetricType" json:"type,omitempty"` @@ -173,171 +274,177 @@ type MetricMetadata struct { Unit string `protobuf:"bytes,5,opt,name=unit,proto3" json:"unit,omitempty"` } -func (m *MetricMetadata) Reset() { *m = MetricMetadata{} } -func (m *MetricMetadata) String() string { return proto.CompactTextString(m) } -func (*MetricMetadata) ProtoMessage() {} -func (*MetricMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{0} -} -func (m *MetricMetadata) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MetricMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MetricMetadata.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MetricMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricMetadata.Merge(m, src) +func (x *MetricMetadata) Reset() { + *x = MetricMetadata{} + mi := &file_store_storepb_prompb_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *MetricMetadata) XXX_Size() int { - return m.Size() + +func (x *MetricMetadata) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MetricMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_MetricMetadata.DiscardUnknown(m) + +func (*MetricMetadata) ProtoMessage() {} + +func (x *MetricMetadata) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_prompb_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_MetricMetadata proto.InternalMessageInfo +// Deprecated: Use MetricMetadata.ProtoReflect.Descriptor instead. +func (*MetricMetadata) Descriptor() ([]byte, []int) { + return file_store_storepb_prompb_types_proto_rawDescGZIP(), []int{0} +} -func (m *MetricMetadata) GetType() MetricMetadata_MetricType { - if m != nil { - return m.Type +func (x *MetricMetadata) GetType() MetricMetadata_MetricType { + if x != nil { + return x.Type } return MetricMetadata_UNKNOWN } -func (m *MetricMetadata) GetMetricFamilyName() string { - if m != nil { - return m.MetricFamilyName +func (x *MetricMetadata) GetMetricFamilyName() string { + if x != nil { + return x.MetricFamilyName } return "" } -func (m *MetricMetadata) GetHelp() string { - if m != nil { - return m.Help +func (x *MetricMetadata) GetHelp() string { + if x != nil { + return x.Help } return "" } -func (m *MetricMetadata) GetUnit() string { - if m != nil { - return m.Unit +func (x *MetricMetadata) GetUnit() string { + if x != nil { + return x.Unit } return "" } type Sample struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` } -func (m *Sample) Reset() { *m = Sample{} } -func (m *Sample) String() string { return proto.CompactTextString(m) } -func (*Sample) ProtoMessage() {} -func (*Sample) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{1} -} -func (m *Sample) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Sample) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Sample.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Sample) XXX_Merge(src proto.Message) { - xxx_messageInfo_Sample.Merge(m, src) +func (x *Sample) Reset() { + *x = Sample{} + mi := &file_store_storepb_prompb_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Sample) XXX_Size() int { - return m.Size() + +func (x *Sample) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Sample) XXX_DiscardUnknown() { - xxx_messageInfo_Sample.DiscardUnknown(m) + +func (*Sample) ProtoMessage() {} + +func (x *Sample) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_prompb_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Sample proto.InternalMessageInfo +// Deprecated: Use Sample.ProtoReflect.Descriptor instead. +func (*Sample) Descriptor() ([]byte, []int) { + return file_store_storepb_prompb_types_proto_rawDescGZIP(), []int{1} +} -func (m *Sample) GetValue() float64 { - if m != nil { - return m.Value +func (x *Sample) GetValue() float64 { + if x != nil { + return x.Value } return 0 } -func (m *Sample) GetTimestamp() int64 { - if m != nil { - return m.Timestamp +func (x *Sample) GetTimestamp() int64 { + if x != nil { + return x.Timestamp } return 0 } type Exemplar struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Optional, can be empty. - Labels []github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel" json:"labels"` - Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"` + Labels []*labelpb.Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` + Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"` // timestamp is in ms format, see pkg/timestamp/timestamp.go for // conversion from time.Time to Prometheus timestamp. Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` } -func (m *Exemplar) Reset() { *m = Exemplar{} } -func (m *Exemplar) String() string { return proto.CompactTextString(m) } -func (*Exemplar) ProtoMessage() {} -func (*Exemplar) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{2} -} -func (m *Exemplar) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Exemplar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Exemplar.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +func (x *Exemplar) Reset() { + *x = Exemplar{} + mi := &file_store_storepb_prompb_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Exemplar) XXX_Merge(src proto.Message) { - xxx_messageInfo_Exemplar.Merge(m, src) + +func (x *Exemplar) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Exemplar) XXX_Size() int { - return m.Size() + +func (*Exemplar) ProtoMessage() {} + +func (x *Exemplar) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_prompb_types_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *Exemplar) XXX_DiscardUnknown() { - xxx_messageInfo_Exemplar.DiscardUnknown(m) + +// Deprecated: Use Exemplar.ProtoReflect.Descriptor instead. +func (*Exemplar) Descriptor() ([]byte, []int) { + return file_store_storepb_prompb_types_proto_rawDescGZIP(), []int{2} } -var xxx_messageInfo_Exemplar proto.InternalMessageInfo +func (x *Exemplar) GetLabels() []*labelpb.Label { + if x != nil { + return x.Labels + } + return nil +} -func (m *Exemplar) GetValue() float64 { - if m != nil { - return m.Value +func (x *Exemplar) GetValue() float64 { + if x != nil { + return x.Value } return 0 } -func (m *Exemplar) GetTimestamp() int64 { - if m != nil { - return m.Timestamp +func (x *Exemplar) GetTimestamp() int64 { + if x != nil { + return x.Timestamp } return 0 } @@ -349,12 +456,16 @@ func (m *Exemplar) GetTimestamp() int64 { // histograms. This Histogram message can represent both, the usual // integer histogram as well as a float histogram. type Histogram struct { - // Types that are valid to be assigned to Count: + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Count: // // *Histogram_CountInt // *Histogram_CountFloat Count isHistogram_Count `protobuf_oneof:"count"` - Sum float64 `protobuf:"fixed64,3,opt,name=sum,proto3" json:"sum,omitempty"` + Sum float64 `protobuf:"fixed64,3,opt,name=sum,proto3" json:"sum,omitempty"` // Sum of observations in the histogram. // The schema defines the bucket schema. Currently, valid numbers // are -4 <= n <= 8. They are all for base-2 bucket schemas, where 1 // is a bucket boundary in each case, and then each power of two is @@ -363,492 +474,493 @@ type Histogram struct { // future, more bucket schemas may be added using numbers < -4 or > // 8. Schema int32 `protobuf:"zigzag32,4,opt,name=schema,proto3" json:"schema,omitempty"` - ZeroThreshold float64 `protobuf:"fixed64,5,opt,name=zero_threshold,json=zeroThreshold,proto3" json:"zero_threshold,omitempty"` - // Types that are valid to be assigned to ZeroCount: + ZeroThreshold float64 `protobuf:"fixed64,5,opt,name=zero_threshold,json=zeroThreshold,proto3" json:"zero_threshold,omitempty"` // Breadth of the zero bucket. + // Types that are assignable to ZeroCount: // // *Histogram_ZeroCountInt // *Histogram_ZeroCountFloat ZeroCount isHistogram_ZeroCount `protobuf_oneof:"zero_count"` // Negative Buckets. - NegativeSpans []BucketSpan `protobuf:"bytes,8,rep,name=negative_spans,json=negativeSpans,proto3" json:"negative_spans"` + NegativeSpans []*BucketSpan `protobuf:"bytes,8,rep,name=negative_spans,json=negativeSpans,proto3" json:"negative_spans"` // Use either "negative_deltas" or "negative_counts", the former for // regular histograms with integer counts, the latter for float // histograms. - NegativeDeltas []int64 `protobuf:"zigzag64,9,rep,packed,name=negative_deltas,json=negativeDeltas,proto3" json:"negative_deltas,omitempty"` - NegativeCounts []float64 `protobuf:"fixed64,10,rep,packed,name=negative_counts,json=negativeCounts,proto3" json:"negative_counts,omitempty"` + NegativeDeltas []int64 `protobuf:"zigzag64,9,rep,packed,name=negative_deltas,json=negativeDeltas,proto3" json:"negative_deltas,omitempty"` // Count delta of each bucket compared to previous one (or to zero for 1st bucket). + NegativeCounts []float64 `protobuf:"fixed64,10,rep,packed,name=negative_counts,json=negativeCounts,proto3" json:"negative_counts,omitempty"` // Absolute count of each bucket. // Positive Buckets. - PositiveSpans []BucketSpan `protobuf:"bytes,11,rep,name=positive_spans,json=positiveSpans,proto3" json:"positive_spans"` + PositiveSpans []*BucketSpan `protobuf:"bytes,11,rep,name=positive_spans,json=positiveSpans,proto3" json:"positive_spans"` // Use either "positive_deltas" or "positive_counts", the former for // regular histograms with integer counts, the latter for float // histograms. - PositiveDeltas []int64 `protobuf:"zigzag64,12,rep,packed,name=positive_deltas,json=positiveDeltas,proto3" json:"positive_deltas,omitempty"` - PositiveCounts []float64 `protobuf:"fixed64,13,rep,packed,name=positive_counts,json=positiveCounts,proto3" json:"positive_counts,omitempty"` + PositiveDeltas []int64 `protobuf:"zigzag64,12,rep,packed,name=positive_deltas,json=positiveDeltas,proto3" json:"positive_deltas,omitempty"` // Count delta of each bucket compared to previous one (or to zero for 1st bucket). + PositiveCounts []float64 `protobuf:"fixed64,13,rep,packed,name=positive_counts,json=positiveCounts,proto3" json:"positive_counts,omitempty"` // Absolute count of each bucket. ResetHint Histogram_ResetHint `protobuf:"varint,14,opt,name=reset_hint,json=resetHint,proto3,enum=prometheus_copy.Histogram_ResetHint" json:"reset_hint,omitempty"` // timestamp is in ms format, see model/timestamp/timestamp.go for // conversion from time.Time to Prometheus timestamp. Timestamp int64 `protobuf:"varint,15,opt,name=timestamp,proto3" json:"timestamp,omitempty"` } -func (m *Histogram) Reset() { *m = Histogram{} } -func (m *Histogram) String() string { return proto.CompactTextString(m) } -func (*Histogram) ProtoMessage() {} -func (*Histogram) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{3} -} -func (m *Histogram) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Histogram) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Histogram.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Histogram) XXX_Merge(src proto.Message) { - xxx_messageInfo_Histogram.Merge(m, src) +func (x *Histogram) Reset() { + *x = Histogram{} + mi := &file_store_storepb_prompb_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Histogram) XXX_Size() int { - return m.Size() -} -func (m *Histogram) XXX_DiscardUnknown() { - xxx_messageInfo_Histogram.DiscardUnknown(m) + +func (x *Histogram) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_Histogram proto.InternalMessageInfo +func (*Histogram) ProtoMessage() {} -type isHistogram_Count interface { - isHistogram_Count() - MarshalTo([]byte) (int, error) - Size() int -} -type isHistogram_ZeroCount interface { - isHistogram_ZeroCount() - MarshalTo([]byte) (int, error) - Size() int +func (x *Histogram) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_prompb_types_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -type Histogram_CountInt struct { - CountInt uint64 `protobuf:"varint,1,opt,name=count_int,json=countInt,proto3,oneof" json:"count_int,omitempty"` -} -type Histogram_CountFloat struct { - CountFloat float64 `protobuf:"fixed64,2,opt,name=count_float,json=countFloat,proto3,oneof" json:"count_float,omitempty"` -} -type Histogram_ZeroCountInt struct { - ZeroCountInt uint64 `protobuf:"varint,6,opt,name=zero_count_int,json=zeroCountInt,proto3,oneof" json:"zero_count_int,omitempty"` -} -type Histogram_ZeroCountFloat struct { - ZeroCountFloat float64 `protobuf:"fixed64,7,opt,name=zero_count_float,json=zeroCountFloat,proto3,oneof" json:"zero_count_float,omitempty"` +// Deprecated: Use Histogram.ProtoReflect.Descriptor instead. +func (*Histogram) Descriptor() ([]byte, []int) { + return file_store_storepb_prompb_types_proto_rawDescGZIP(), []int{3} } -func (*Histogram_CountInt) isHistogram_Count() {} -func (*Histogram_CountFloat) isHistogram_Count() {} -func (*Histogram_ZeroCountInt) isHistogram_ZeroCount() {} -func (*Histogram_ZeroCountFloat) isHistogram_ZeroCount() {} - func (m *Histogram) GetCount() isHistogram_Count { if m != nil { return m.Count } return nil } -func (m *Histogram) GetZeroCount() isHistogram_ZeroCount { - if m != nil { - return m.ZeroCount - } - return nil -} -func (m *Histogram) GetCountInt() uint64 { - if x, ok := m.GetCount().(*Histogram_CountInt); ok { +func (x *Histogram) GetCountInt() uint64 { + if x, ok := x.GetCount().(*Histogram_CountInt); ok { return x.CountInt } return 0 } -func (m *Histogram) GetCountFloat() float64 { - if x, ok := m.GetCount().(*Histogram_CountFloat); ok { +func (x *Histogram) GetCountFloat() float64 { + if x, ok := x.GetCount().(*Histogram_CountFloat); ok { return x.CountFloat } return 0 } -func (m *Histogram) GetSum() float64 { - if m != nil { - return m.Sum +func (x *Histogram) GetSum() float64 { + if x != nil { + return x.Sum } return 0 } -func (m *Histogram) GetSchema() int32 { - if m != nil { - return m.Schema +func (x *Histogram) GetSchema() int32 { + if x != nil { + return x.Schema } return 0 } -func (m *Histogram) GetZeroThreshold() float64 { - if m != nil { - return m.ZeroThreshold +func (x *Histogram) GetZeroThreshold() float64 { + if x != nil { + return x.ZeroThreshold } return 0 } -func (m *Histogram) GetZeroCountInt() uint64 { - if x, ok := m.GetZeroCount().(*Histogram_ZeroCountInt); ok { +func (m *Histogram) GetZeroCount() isHistogram_ZeroCount { + if m != nil { + return m.ZeroCount + } + return nil +} + +func (x *Histogram) GetZeroCountInt() uint64 { + if x, ok := x.GetZeroCount().(*Histogram_ZeroCountInt); ok { return x.ZeroCountInt } return 0 } -func (m *Histogram) GetZeroCountFloat() float64 { - if x, ok := m.GetZeroCount().(*Histogram_ZeroCountFloat); ok { +func (x *Histogram) GetZeroCountFloat() float64 { + if x, ok := x.GetZeroCount().(*Histogram_ZeroCountFloat); ok { return x.ZeroCountFloat } return 0 } -func (m *Histogram) GetNegativeSpans() []BucketSpan { - if m != nil { - return m.NegativeSpans +func (x *Histogram) GetNegativeSpans() []*BucketSpan { + if x != nil { + return x.NegativeSpans } return nil } -func (m *Histogram) GetNegativeDeltas() []int64 { - if m != nil { - return m.NegativeDeltas +func (x *Histogram) GetNegativeDeltas() []int64 { + if x != nil { + return x.NegativeDeltas } return nil } -func (m *Histogram) GetNegativeCounts() []float64 { - if m != nil { - return m.NegativeCounts +func (x *Histogram) GetNegativeCounts() []float64 { + if x != nil { + return x.NegativeCounts } return nil } -func (m *Histogram) GetPositiveSpans() []BucketSpan { - if m != nil { - return m.PositiveSpans +func (x *Histogram) GetPositiveSpans() []*BucketSpan { + if x != nil { + return x.PositiveSpans } return nil } -func (m *Histogram) GetPositiveDeltas() []int64 { - if m != nil { - return m.PositiveDeltas +func (x *Histogram) GetPositiveDeltas() []int64 { + if x != nil { + return x.PositiveDeltas } return nil } -func (m *Histogram) GetPositiveCounts() []float64 { - if m != nil { - return m.PositiveCounts +func (x *Histogram) GetPositiveCounts() []float64 { + if x != nil { + return x.PositiveCounts } return nil } -func (m *Histogram) GetResetHint() Histogram_ResetHint { - if m != nil { - return m.ResetHint +func (x *Histogram) GetResetHint() Histogram_ResetHint { + if x != nil { + return x.ResetHint } return Histogram_UNKNOWN } -func (m *Histogram) GetTimestamp() int64 { - if m != nil { - return m.Timestamp +func (x *Histogram) GetTimestamp() int64 { + if x != nil { + return x.Timestamp } return 0 } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Histogram) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Histogram_CountInt)(nil), - (*Histogram_CountFloat)(nil), - (*Histogram_ZeroCountInt)(nil), - (*Histogram_ZeroCountFloat)(nil), - } +type isHistogram_Count interface { + isHistogram_Count() +} + +type Histogram_CountInt struct { + CountInt uint64 `protobuf:"varint,1,opt,name=count_int,json=countInt,proto3,oneof"` +} + +type Histogram_CountFloat struct { + CountFloat float64 `protobuf:"fixed64,2,opt,name=count_float,json=countFloat,proto3,oneof"` +} + +func (*Histogram_CountInt) isHistogram_Count() {} + +func (*Histogram_CountFloat) isHistogram_Count() {} + +type isHistogram_ZeroCount interface { + isHistogram_ZeroCount() +} + +type Histogram_ZeroCountInt struct { + ZeroCountInt uint64 `protobuf:"varint,6,opt,name=zero_count_int,json=zeroCountInt,proto3,oneof"` +} + +type Histogram_ZeroCountFloat struct { + ZeroCountFloat float64 `protobuf:"fixed64,7,opt,name=zero_count_float,json=zeroCountFloat,proto3,oneof"` } +func (*Histogram_ZeroCountInt) isHistogram_ZeroCount() {} + +func (*Histogram_ZeroCountFloat) isHistogram_ZeroCount() {} + // A BucketSpan defines a number of consecutive buckets with their // offset. Logically, it would be more straightforward to include the // bucket counts in the Span. However, the protobuf representation is // more compact in the way the data is structured here (with all the // buckets in a single array separate from the Spans). type BucketSpan struct { - Offset int32 `protobuf:"zigzag32,1,opt,name=offset,proto3" json:"offset,omitempty"` - Length uint32 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *BucketSpan) Reset() { *m = BucketSpan{} } -func (m *BucketSpan) String() string { return proto.CompactTextString(m) } -func (*BucketSpan) ProtoMessage() {} -func (*BucketSpan) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{4} -} -func (m *BucketSpan) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BucketSpan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BucketSpan.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + Offset int32 `protobuf:"zigzag32,1,opt,name=offset,proto3" json:"offset,omitempty"` // Gap to previous span, or starting point for 1st span (which can be negative). + Length uint32 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"` // Length of consecutive buckets. } -func (m *BucketSpan) XXX_Merge(src proto.Message) { - xxx_messageInfo_BucketSpan.Merge(m, src) + +func (x *BucketSpan) Reset() { + *x = BucketSpan{} + mi := &file_store_storepb_prompb_types_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *BucketSpan) XXX_Size() int { - return m.Size() + +func (x *BucketSpan) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BucketSpan) XXX_DiscardUnknown() { - xxx_messageInfo_BucketSpan.DiscardUnknown(m) + +func (*BucketSpan) ProtoMessage() {} + +func (x *BucketSpan) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_prompb_types_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BucketSpan proto.InternalMessageInfo +// Deprecated: Use BucketSpan.ProtoReflect.Descriptor instead. +func (*BucketSpan) Descriptor() ([]byte, []int) { + return file_store_storepb_prompb_types_proto_rawDescGZIP(), []int{4} +} -func (m *BucketSpan) GetOffset() int32 { - if m != nil { - return m.Offset +func (x *BucketSpan) GetOffset() int32 { + if x != nil { + return x.Offset } return 0 } -func (m *BucketSpan) GetLength() uint32 { - if m != nil { - return m.Length +func (x *BucketSpan) GetLength() uint32 { + if x != nil { + return x.Length } return 0 } // TimeSeries represents samples and labels for a single time series. type TimeSeries struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Labels have to be sorted by label names and without duplicated label names. - // TODO(bwplotka): Don't use zero copy ZLabels, see https://github.com/thanos-io/thanos/pull/3279 for details. - Labels []github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel" json:"labels"` - Samples []Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"samples"` - Exemplars []Exemplar `protobuf:"bytes,3,rep,name=exemplars,proto3" json:"exemplars"` - Histograms []Histogram `protobuf:"bytes,4,rep,name=histograms,proto3" json:"histograms"` + Labels []*labelpb.Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` + Samples []*Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"samples"` + Exemplars []*Exemplar `protobuf:"bytes,3,rep,name=exemplars,proto3" json:"exemplars"` + Histograms []*Histogram `protobuf:"bytes,4,rep,name=histograms,proto3" json:"histograms"` } -func (m *TimeSeries) Reset() { *m = TimeSeries{} } -func (m *TimeSeries) String() string { return proto.CompactTextString(m) } -func (*TimeSeries) ProtoMessage() {} -func (*TimeSeries) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{5} -} -func (m *TimeSeries) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TimeSeries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TimeSeries.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +func (x *TimeSeries) Reset() { + *x = TimeSeries{} + mi := &file_store_storepb_prompb_types_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *TimeSeries) XXX_Merge(src proto.Message) { - xxx_messageInfo_TimeSeries.Merge(m, src) + +func (x *TimeSeries) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TimeSeries) XXX_Size() int { - return m.Size() + +func (*TimeSeries) ProtoMessage() {} + +func (x *TimeSeries) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_prompb_types_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *TimeSeries) XXX_DiscardUnknown() { - xxx_messageInfo_TimeSeries.DiscardUnknown(m) + +// Deprecated: Use TimeSeries.ProtoReflect.Descriptor instead. +func (*TimeSeries) Descriptor() ([]byte, []int) { + return file_store_storepb_prompb_types_proto_rawDescGZIP(), []int{5} } -var xxx_messageInfo_TimeSeries proto.InternalMessageInfo +func (x *TimeSeries) GetLabels() []*labelpb.Label { + if x != nil { + return x.Labels + } + return nil +} -func (m *TimeSeries) GetSamples() []Sample { - if m != nil { - return m.Samples +func (x *TimeSeries) GetSamples() []*Sample { + if x != nil { + return x.Samples } return nil } -func (m *TimeSeries) GetExemplars() []Exemplar { - if m != nil { - return m.Exemplars +func (x *TimeSeries) GetExemplars() []*Exemplar { + if x != nil { + return x.Exemplars } return nil } -func (m *TimeSeries) GetHistograms() []Histogram { - if m != nil { - return m.Histograms +func (x *TimeSeries) GetHistograms() []*Histogram { + if x != nil { + return x.Histograms } return nil } // Matcher specifies a rule, which can match or set of labels or not. type LabelMatcher struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Type LabelMatcher_Type `protobuf:"varint,1,opt,name=type,proto3,enum=prometheus_copy.LabelMatcher_Type" json:"type,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` } -func (m *LabelMatcher) Reset() { *m = LabelMatcher{} } -func (m *LabelMatcher) String() string { return proto.CompactTextString(m) } -func (*LabelMatcher) ProtoMessage() {} -func (*LabelMatcher) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{6} -} -func (m *LabelMatcher) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelMatcher) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelMatcher.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +func (x *LabelMatcher) Reset() { + *x = LabelMatcher{} + mi := &file_store_storepb_prompb_types_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *LabelMatcher) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelMatcher.Merge(m, src) -} -func (m *LabelMatcher) XXX_Size() int { - return m.Size() + +func (x *LabelMatcher) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *LabelMatcher) XXX_DiscardUnknown() { - xxx_messageInfo_LabelMatcher.DiscardUnknown(m) + +func (*LabelMatcher) ProtoMessage() {} + +func (x *LabelMatcher) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_prompb_types_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_LabelMatcher proto.InternalMessageInfo +// Deprecated: Use LabelMatcher.ProtoReflect.Descriptor instead. +func (*LabelMatcher) Descriptor() ([]byte, []int) { + return file_store_storepb_prompb_types_proto_rawDescGZIP(), []int{6} +} -func (m *LabelMatcher) GetType() LabelMatcher_Type { - if m != nil { - return m.Type +func (x *LabelMatcher) GetType() LabelMatcher_Type { + if x != nil { + return x.Type } return LabelMatcher_EQ } -func (m *LabelMatcher) GetName() string { - if m != nil { - return m.Name +func (x *LabelMatcher) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *LabelMatcher) GetValue() string { - if m != nil { - return m.Value +func (x *LabelMatcher) GetValue() string { + if x != nil { + return x.Value } return "" } type ReadHints struct { - StepMs int64 `protobuf:"varint,1,opt,name=step_ms,json=stepMs,proto3" json:"step_ms,omitempty"` - Func string `protobuf:"bytes,2,opt,name=func,proto3" json:"func,omitempty"` - StartMs int64 `protobuf:"varint,3,opt,name=start_ms,json=startMs,proto3" json:"start_ms,omitempty"` - EndMs int64 `protobuf:"varint,4,opt,name=end_ms,json=endMs,proto3" json:"end_ms,omitempty"` - Grouping []string `protobuf:"bytes,5,rep,name=grouping,proto3" json:"grouping,omitempty"` - By bool `protobuf:"varint,6,opt,name=by,proto3" json:"by,omitempty"` - RangeMs int64 `protobuf:"varint,7,opt,name=range_ms,json=rangeMs,proto3" json:"range_ms,omitempty"` -} - -func (m *ReadHints) Reset() { *m = ReadHints{} } -func (m *ReadHints) String() string { return proto.CompactTextString(m) } -func (*ReadHints) ProtoMessage() {} -func (*ReadHints) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{7} -} -func (m *ReadHints) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ReadHints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ReadHints.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StepMs int64 `protobuf:"varint,1,opt,name=step_ms,json=stepMs,proto3" json:"step_ms,omitempty"` // Query step size in milliseconds. + Func string `protobuf:"bytes,2,opt,name=func,proto3" json:"func,omitempty"` // String representation of surrounding function or aggregation. + StartMs int64 `protobuf:"varint,3,opt,name=start_ms,json=startMs,proto3" json:"start_ms,omitempty"` // Start time in milliseconds. + EndMs int64 `protobuf:"varint,4,opt,name=end_ms,json=endMs,proto3" json:"end_ms,omitempty"` // End time in milliseconds. + Grouping []string `protobuf:"bytes,5,rep,name=grouping,proto3" json:"grouping,omitempty"` // List of label names used in aggregation. + By bool `protobuf:"varint,6,opt,name=by,proto3" json:"by,omitempty"` // Indicate whether it is without or by. + RangeMs int64 `protobuf:"varint,7,opt,name=range_ms,json=rangeMs,proto3" json:"range_ms,omitempty"` // Range vector selector range in milliseconds. } -func (m *ReadHints) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadHints.Merge(m, src) + +func (x *ReadHints) Reset() { + *x = ReadHints{} + mi := &file_store_storepb_prompb_types_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ReadHints) XXX_Size() int { - return m.Size() + +func (x *ReadHints) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ReadHints) XXX_DiscardUnknown() { - xxx_messageInfo_ReadHints.DiscardUnknown(m) + +func (*ReadHints) ProtoMessage() {} + +func (x *ReadHints) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_prompb_types_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ReadHints proto.InternalMessageInfo +// Deprecated: Use ReadHints.ProtoReflect.Descriptor instead. +func (*ReadHints) Descriptor() ([]byte, []int) { + return file_store_storepb_prompb_types_proto_rawDescGZIP(), []int{7} +} -func (m *ReadHints) GetStepMs() int64 { - if m != nil { - return m.StepMs +func (x *ReadHints) GetStepMs() int64 { + if x != nil { + return x.StepMs } return 0 } -func (m *ReadHints) GetFunc() string { - if m != nil { - return m.Func +func (x *ReadHints) GetFunc() string { + if x != nil { + return x.Func } return "" } -func (m *ReadHints) GetStartMs() int64 { - if m != nil { - return m.StartMs +func (x *ReadHints) GetStartMs() int64 { + if x != nil { + return x.StartMs } return 0 } -func (m *ReadHints) GetEndMs() int64 { - if m != nil { - return m.EndMs +func (x *ReadHints) GetEndMs() int64 { + if x != nil { + return x.EndMs } return 0 } -func (m *ReadHints) GetGrouping() []string { - if m != nil { - return m.Grouping +func (x *ReadHints) GetGrouping() []string { + if x != nil { + return x.Grouping } return nil } -func (m *ReadHints) GetBy() bool { - if m != nil { - return m.By +func (x *ReadHints) GetBy() bool { + if x != nil { + return x.By } return false } -func (m *ReadHints) GetRangeMs() int64 { - if m != nil { - return m.RangeMs +func (x *ReadHints) GetRangeMs() int64 { + if x != nil { + return x.RangeMs } return 0 } @@ -856,3033 +968,378 @@ func (m *ReadHints) GetRangeMs() int64 { // Chunk represents a TSDB chunk. // Time range [min, max] is inclusive. type Chunk struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + MinTimeMs int64 `protobuf:"varint,1,opt,name=min_time_ms,json=minTimeMs,proto3" json:"min_time_ms,omitempty"` MaxTimeMs int64 `protobuf:"varint,2,opt,name=max_time_ms,json=maxTimeMs,proto3" json:"max_time_ms,omitempty"` Type Chunk_Encoding `protobuf:"varint,3,opt,name=type,proto3,enum=prometheus_copy.Chunk_Encoding" json:"type,omitempty"` Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` } -func (m *Chunk) Reset() { *m = Chunk{} } -func (m *Chunk) String() string { return proto.CompactTextString(m) } -func (*Chunk) ProtoMessage() {} -func (*Chunk) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{8} -} -func (m *Chunk) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Chunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Chunk.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +func (x *Chunk) Reset() { + *x = Chunk{} + mi := &file_store_storepb_prompb_types_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Chunk) XXX_Merge(src proto.Message) { - xxx_messageInfo_Chunk.Merge(m, src) -} -func (m *Chunk) XXX_Size() int { - return m.Size() + +func (x *Chunk) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Chunk) XXX_DiscardUnknown() { - xxx_messageInfo_Chunk.DiscardUnknown(m) + +func (*Chunk) ProtoMessage() {} + +func (x *Chunk) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_prompb_types_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Chunk proto.InternalMessageInfo +// Deprecated: Use Chunk.ProtoReflect.Descriptor instead. +func (*Chunk) Descriptor() ([]byte, []int) { + return file_store_storepb_prompb_types_proto_rawDescGZIP(), []int{8} +} -func (m *Chunk) GetMinTimeMs() int64 { - if m != nil { - return m.MinTimeMs +func (x *Chunk) GetMinTimeMs() int64 { + if x != nil { + return x.MinTimeMs } return 0 } -func (m *Chunk) GetMaxTimeMs() int64 { - if m != nil { - return m.MaxTimeMs +func (x *Chunk) GetMaxTimeMs() int64 { + if x != nil { + return x.MaxTimeMs } return 0 } -func (m *Chunk) GetType() Chunk_Encoding { - if m != nil { - return m.Type +func (x *Chunk) GetType() Chunk_Encoding { + if x != nil { + return x.Type } return Chunk_UNKNOWN } -func (m *Chunk) GetData() []byte { - if m != nil { - return m.Data +func (x *Chunk) GetData() []byte { + if x != nil { + return x.Data } return nil } // ChunkedSeries represents single, encoded time series. type ChunkedSeries struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Labels should be sorted. - Labels []github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel" json:"labels"` + Labels []*labelpb.Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` // Chunks will be in start time order and may overlap. - Chunks []Chunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks"` + Chunks []*Chunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks"` } -func (m *ChunkedSeries) Reset() { *m = ChunkedSeries{} } -func (m *ChunkedSeries) String() string { return proto.CompactTextString(m) } -func (*ChunkedSeries) ProtoMessage() {} -func (*ChunkedSeries) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{9} -} -func (m *ChunkedSeries) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChunkedSeries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChunkedSeries.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ChunkedSeries) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChunkedSeries.Merge(m, src) -} -func (m *ChunkedSeries) XXX_Size() int { - return m.Size() +func (x *ChunkedSeries) Reset() { + *x = ChunkedSeries{} + mi := &file_store_storepb_prompb_types_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ChunkedSeries) XXX_DiscardUnknown() { - xxx_messageInfo_ChunkedSeries.DiscardUnknown(m) + +func (x *ChunkedSeries) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_ChunkedSeries proto.InternalMessageInfo +func (*ChunkedSeries) ProtoMessage() {} -func (m *ChunkedSeries) GetChunks() []Chunk { - if m != nil { - return m.Chunks +func (x *ChunkedSeries) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_prompb_types_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) } -func init() { - proto.RegisterEnum("prometheus_copy.MetricMetadata_MetricType", MetricMetadata_MetricType_name, MetricMetadata_MetricType_value) - proto.RegisterEnum("prometheus_copy.Histogram_ResetHint", Histogram_ResetHint_name, Histogram_ResetHint_value) - proto.RegisterEnum("prometheus_copy.LabelMatcher_Type", LabelMatcher_Type_name, LabelMatcher_Type_value) - proto.RegisterEnum("prometheus_copy.Chunk_Encoding", Chunk_Encoding_name, Chunk_Encoding_value) - proto.RegisterType((*MetricMetadata)(nil), "prometheus_copy.MetricMetadata") - proto.RegisterType((*Sample)(nil), "prometheus_copy.Sample") - proto.RegisterType((*Exemplar)(nil), "prometheus_copy.Exemplar") - proto.RegisterType((*Histogram)(nil), "prometheus_copy.Histogram") - proto.RegisterType((*BucketSpan)(nil), "prometheus_copy.BucketSpan") - proto.RegisterType((*TimeSeries)(nil), "prometheus_copy.TimeSeries") - proto.RegisterType((*LabelMatcher)(nil), "prometheus_copy.LabelMatcher") - proto.RegisterType((*ReadHints)(nil), "prometheus_copy.ReadHints") - proto.RegisterType((*Chunk)(nil), "prometheus_copy.Chunk") - proto.RegisterType((*ChunkedSeries)(nil), "prometheus_copy.ChunkedSeries") -} - -func init() { proto.RegisterFile("store/storepb/prompb/types.proto", fileDescriptor_166e07899dab7c14) } - -var fileDescriptor_166e07899dab7c14 = []byte{ - // 1150 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x8f, 0xda, 0x46, - 0x14, 0xc7, 0x36, 0x18, 0xfc, 0x16, 0x58, 0x67, 0x9a, 0x26, 0xce, 0xb6, 0x25, 0xd4, 0xea, 0x1f, - 0x14, 0xb5, 0x20, 0x25, 0x51, 0x7b, 0x49, 0xab, 0x2e, 0x1b, 0x36, 0x44, 0x0d, 0xa0, 0x0c, 0xac, - 0xda, 0xe4, 0x82, 0x06, 0x98, 0xc5, 0xd6, 0xe2, 0x3f, 0xf2, 0x0c, 0xd1, 0xd2, 0x4f, 0xd1, 0x73, - 0x6f, 0x55, 0x6f, 0xed, 0xa9, 0xdf, 0x22, 0xc7, 0x9c, 0xaa, 0x2a, 0x87, 0xa8, 0xda, 0xfd, 0x22, - 0xd5, 0x8c, 0x6d, 0x0c, 0x4b, 0x23, 0xf5, 0x94, 0x0b, 0x7a, 0xef, 0xf7, 0xfe, 0xfd, 0x3c, 0xef, - 0xcd, 0x3c, 0xa0, 0xce, 0x78, 0x10, 0xd1, 0x96, 0xfc, 0x0d, 0x27, 0xad, 0x30, 0x0a, 0xbc, 0x70, - 0xd2, 0xe2, 0xab, 0x90, 0xb2, 0x66, 0x18, 0x05, 0x3c, 0x40, 0xfb, 0x02, 0xa3, 0xdc, 0xa1, 0x4b, - 0x36, 0x9e, 0x06, 0xe1, 0xea, 0xe0, 0xfa, 0x3c, 0x98, 0x07, 0xd2, 0xd6, 0x12, 0x52, 0xec, 0x76, - 0x70, 0x2b, 0x4e, 0xb4, 0x20, 0x13, 0xba, 0xd8, 0xce, 0x60, 0xff, 0xaa, 0x42, 0xb5, 0x47, 0x79, - 0xe4, 0x4e, 0x7b, 0x94, 0x93, 0x19, 0xe1, 0x04, 0x7d, 0x0b, 0x79, 0xe1, 0x61, 0x29, 0x75, 0xa5, - 0x51, 0xbd, 0x7b, 0xa7, 0x79, 0xa5, 0x46, 0x73, 0xdb, 0x3d, 0x51, 0x47, 0xab, 0x90, 0x62, 0x19, - 0x87, 0xbe, 0x00, 0xe4, 0x49, 0x6c, 0x7c, 0x4a, 0x3c, 0x77, 0xb1, 0x1a, 0xfb, 0xc4, 0xa3, 0x96, - 0x5a, 0x57, 0x1a, 0x06, 0x36, 0x63, 0xcb, 0xb1, 0x34, 0xf4, 0x89, 0x47, 0x11, 0x82, 0xbc, 0x43, - 0x17, 0xa1, 0x95, 0x97, 0x76, 0x29, 0x0b, 0x6c, 0xe9, 0xbb, 0xdc, 0x2a, 0xc4, 0x98, 0x90, 0xed, - 0x15, 0x40, 0x56, 0x09, 0xed, 0x41, 0xf1, 0xa4, 0xff, 0x7d, 0x7f, 0xf0, 0x43, 0xdf, 0xcc, 0x09, - 0xe5, 0x68, 0x70, 0xd2, 0x1f, 0x75, 0xb0, 0xa9, 0x20, 0x03, 0x0a, 0x8f, 0x0e, 0x4f, 0x1e, 0x75, - 0x4c, 0x15, 0x55, 0xc0, 0xe8, 0x3e, 0x1e, 0x8e, 0x06, 0x8f, 0xf0, 0x61, 0xcf, 0xd4, 0x10, 0x82, - 0xaa, 0xb4, 0x64, 0x58, 0x5e, 0x84, 0x0e, 0x4f, 0x7a, 0xbd, 0x43, 0xfc, 0xcc, 0x2c, 0xa0, 0x12, - 0xe4, 0x1f, 0xf7, 0x8f, 0x07, 0xa6, 0x8e, 0xca, 0x50, 0x1a, 0x8e, 0x0e, 0x47, 0x9d, 0x61, 0x67, - 0x64, 0x16, 0xed, 0x07, 0xa0, 0x0f, 0x89, 0x17, 0x2e, 0x28, 0xba, 0x0e, 0x85, 0x17, 0x64, 0xb1, - 0x8c, 0xcf, 0x46, 0xc1, 0xb1, 0x82, 0x3e, 0x04, 0x83, 0xbb, 0x1e, 0x65, 0x9c, 0x78, 0xa1, 0xfc, - 0x4e, 0x0d, 0x67, 0x80, 0xfd, 0x9b, 0x02, 0xa5, 0xce, 0x39, 0xf5, 0xc2, 0x05, 0x89, 0xd0, 0x14, - 0x74, 0xd9, 0x05, 0x66, 0x29, 0x75, 0xad, 0xb1, 0x77, 0xb7, 0xd2, 0xe4, 0x0e, 0xf1, 0x03, 0xd6, - 0x7c, 0x22, 0xd0, 0xf6, 0x83, 0x97, 0x6f, 0x6e, 0xe7, 0x5e, 0xbf, 0xb9, 0x7d, 0x7f, 0xee, 0x72, - 0x67, 0x39, 0x69, 0x4e, 0x03, 0xaf, 0x15, 0x3b, 0x7c, 0xe9, 0x06, 0x89, 0xd4, 0x0a, 0xcf, 0xe6, - 0xad, 0xad, 0x86, 0x36, 0x9f, 0xcb, 0x68, 0x9c, 0xa4, 0xce, 0x58, 0xaa, 0x6f, 0x65, 0xa9, 0x5d, - 0x65, 0xf9, 0xba, 0x00, 0x46, 0xd7, 0x65, 0x3c, 0x98, 0x47, 0xc4, 0x43, 0x1f, 0x81, 0x31, 0x0d, - 0x96, 0x3e, 0x1f, 0xbb, 0x3e, 0x97, 0xdf, 0x9a, 0xef, 0xe6, 0x70, 0x49, 0x42, 0x8f, 0x7d, 0x8e, - 0x3e, 0x86, 0xbd, 0xd8, 0x7c, 0xba, 0x08, 0x08, 0x8f, 0xcb, 0x74, 0x73, 0x18, 0x24, 0x78, 0x2c, - 0x30, 0x64, 0x82, 0xc6, 0x96, 0x9e, 0xac, 0xa3, 0x60, 0x21, 0xa2, 0x1b, 0xa0, 0xb3, 0xa9, 0x43, - 0x3d, 0x22, 0x5b, 0x7d, 0x0d, 0x27, 0x1a, 0xfa, 0x14, 0xaa, 0x3f, 0xd1, 0x28, 0x18, 0x73, 0x27, - 0xa2, 0xcc, 0x09, 0x16, 0x33, 0xd9, 0x76, 0x05, 0x57, 0x04, 0x3a, 0x4a, 0x41, 0xf4, 0x59, 0xe2, - 0x96, 0xf1, 0xd2, 0x25, 0x2f, 0x05, 0x97, 0x05, 0x7e, 0x94, 0x72, 0xbb, 0x03, 0xe6, 0x86, 0x5f, - 0x4c, 0xb0, 0x28, 0x09, 0x2a, 0xb8, 0xba, 0xf6, 0x8c, 0x49, 0x76, 0xa1, 0xea, 0xd3, 0x39, 0xe1, - 0xee, 0x0b, 0x3a, 0x66, 0x21, 0xf1, 0x99, 0x55, 0x92, 0x5d, 0xf9, 0x60, 0x67, 0xe6, 0xdb, 0xcb, - 0xe9, 0x19, 0xe5, 0xc3, 0x90, 0xf8, 0xed, 0xbc, 0xe8, 0x11, 0xae, 0xa4, 0x81, 0x02, 0x63, 0xe8, - 0x73, 0xd8, 0x5f, 0x67, 0x9a, 0xd1, 0x05, 0x27, 0xcc, 0x32, 0xea, 0x5a, 0x03, 0xe1, 0x75, 0x81, - 0x87, 0x12, 0xdd, 0x72, 0x94, 0x14, 0x99, 0x05, 0x75, 0xad, 0xa1, 0x64, 0x8e, 0x92, 0x1f, 0x13, - 0xdc, 0xc2, 0x80, 0xb9, 0x1b, 0xdc, 0xf6, 0xfe, 0x37, 0xb7, 0x34, 0x70, 0xcd, 0x6d, 0x9d, 0x29, - 0xe1, 0x56, 0x8e, 0xb9, 0xa5, 0x70, 0xc6, 0x6d, 0xed, 0x98, 0x70, 0xab, 0xc4, 0xdc, 0x52, 0x38, - 0xe1, 0x76, 0x04, 0x10, 0x51, 0x46, 0xf9, 0xd8, 0x11, 0x7d, 0xa8, 0xca, 0x77, 0xe2, 0x93, 0x1d, - 0x5e, 0xeb, 0x71, 0x6a, 0x62, 0xe1, 0xdc, 0x75, 0x7d, 0x8e, 0x8d, 0x28, 0x15, 0xb7, 0xe7, 0x71, - 0xff, 0xea, 0x3c, 0xde, 0x07, 0x63, 0x1d, 0xb5, 0x7d, 0xdb, 0x8b, 0xa0, 0x3d, 0xeb, 0x0c, 0x4d, - 0x05, 0xe9, 0xa0, 0xf6, 0x07, 0xa6, 0x9a, 0xdd, 0x78, 0xad, 0x5d, 0x84, 0x82, 0x24, 0xde, 0x2e, - 0x03, 0x64, 0x53, 0x60, 0x3f, 0x00, 0xc8, 0x0e, 0x49, 0x0c, 0x62, 0x70, 0x7a, 0xca, 0x68, 0x3c, - 0xd9, 0xd7, 0x70, 0xa2, 0x09, 0x7c, 0x41, 0xfd, 0x39, 0x77, 0xe4, 0x40, 0x57, 0x70, 0xa2, 0xd9, - 0x7f, 0xa8, 0x00, 0x23, 0xd7, 0xa3, 0x43, 0x1a, 0xb9, 0x94, 0xbd, 0x9b, 0x2b, 0xfc, 0x35, 0x14, - 0x99, 0x7c, 0x72, 0x98, 0xa5, 0xca, 0x2a, 0x37, 0x77, 0x8e, 0x37, 0x7e, 0x92, 0x92, 0x96, 0xa7, - 0xde, 0xe8, 0x1b, 0x30, 0x68, 0xf2, 0xd8, 0x30, 0x4b, 0x93, 0xa1, 0xb7, 0x76, 0x42, 0xd3, 0xe7, - 0x28, 0x09, 0xce, 0x22, 0xd0, 0x77, 0x00, 0x4e, 0xda, 0x36, 0x66, 0xe5, 0x65, 0xfc, 0xc1, 0xdb, - 0x3b, 0x9b, 0x24, 0xd8, 0x88, 0xb1, 0x7f, 0x51, 0xa0, 0x2c, 0xbf, 0xa5, 0x47, 0xf8, 0xd4, 0xa1, - 0x11, 0xfa, 0x6a, 0x6b, 0x9d, 0xd8, 0x3b, 0xc9, 0x36, 0x9d, 0x9b, 0x1b, 0x6b, 0x04, 0x41, 0x7e, - 0x63, 0x71, 0x48, 0x39, 0x7b, 0xd9, 0x34, 0x09, 0xc6, 0x8a, 0xdd, 0x80, 0xbc, 0x5c, 0x0a, 0x3a, - 0xa8, 0x9d, 0xa7, 0xf1, 0x84, 0xf4, 0x3b, 0x4f, 0xe3, 0x09, 0xc1, 0x62, 0x11, 0x08, 0x00, 0x77, - 0x4c, 0xcd, 0xfe, 0x53, 0x11, 0x63, 0x45, 0x66, 0x62, 0xaa, 0x18, 0xba, 0x09, 0x45, 0xc6, 0x69, - 0x38, 0xf6, 0x98, 0x24, 0xa7, 0x61, 0x5d, 0xa8, 0x3d, 0x26, 0x4a, 0x9f, 0x2e, 0xfd, 0x69, 0x5a, - 0x5a, 0xc8, 0xe8, 0x16, 0x94, 0x18, 0x27, 0x11, 0x17, 0xde, 0xf1, 0xeb, 0x59, 0x94, 0x7a, 0x8f, - 0xa1, 0xf7, 0x41, 0xa7, 0xfe, 0x6c, 0x2c, 0x0f, 0x4c, 0x18, 0x0a, 0xd4, 0x9f, 0xf5, 0x18, 0x3a, - 0x80, 0xd2, 0x3c, 0x0a, 0x96, 0xa1, 0xeb, 0xcf, 0xad, 0x42, 0x5d, 0x6b, 0x18, 0x78, 0xad, 0xa3, - 0x2a, 0xa8, 0x93, 0x95, 0x7c, 0xc1, 0x4a, 0x58, 0x9d, 0xac, 0x44, 0xf6, 0x88, 0xf8, 0x73, 0x2a, - 0x92, 0x14, 0xe3, 0xec, 0x52, 0xef, 0x31, 0xfb, 0x2f, 0x05, 0x0a, 0x47, 0xce, 0xd2, 0x3f, 0x43, - 0x35, 0xd8, 0xf3, 0x5c, 0x7f, 0x2c, 0x2e, 0x49, 0xc6, 0xd9, 0xf0, 0x5c, 0x5f, 0x4c, 0x67, 0x8f, - 0x49, 0x3b, 0x39, 0x5f, 0xdb, 0x93, 0x4d, 0xe4, 0x91, 0xf3, 0xc4, 0x7e, 0x2f, 0xe9, 0x84, 0x26, - 0x3b, 0x71, 0x7b, 0xa7, 0x13, 0xb2, 0x4a, 0xb3, 0xe3, 0x4f, 0x83, 0x99, 0xeb, 0xcf, 0xb3, 0x36, - 0x88, 0x35, 0x2f, 0x3f, 0xad, 0x8c, 0xa5, 0x6c, 0x3f, 0x84, 0x52, 0xea, 0xb5, 0x73, 0x37, 0x7f, - 0x1c, 0x88, 0x2d, 0xbc, 0xb5, 0x7a, 0x55, 0xf4, 0x1e, 0xec, 0x1f, 0x3f, 0x19, 0x1c, 0x8e, 0xc6, - 0x1b, 0xfb, 0xd8, 0xfe, 0x5d, 0x81, 0x8a, 0x2c, 0x49, 0x67, 0xef, 0xf2, 0x6a, 0xdd, 0x07, 0x7d, - 0x2a, 0xaa, 0xa6, 0x37, 0xeb, 0xc6, 0x7f, 0x9f, 0x43, 0x32, 0xda, 0x89, 0x6f, 0xbb, 0xfe, 0xf2, - 0xa2, 0xa6, 0xbc, 0xba, 0xa8, 0x29, 0xff, 0x5c, 0xd4, 0x94, 0x9f, 0x2f, 0x6b, 0xb9, 0x57, 0x97, - 0xb5, 0xdc, 0xdf, 0x97, 0xb5, 0xdc, 0x73, 0x3d, 0xfe, 0x5f, 0x36, 0xd1, 0xe5, 0x1f, 0xaa, 0x7b, - 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x67, 0xa4, 0x22, 0x7f, 0xb6, 0x09, 0x00, 0x00, -} - -func (m *MetricMetadata) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MetricMetadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MetricMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Unit) > 0 { - i -= len(m.Unit) - copy(dAtA[i:], m.Unit) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Unit))) - i-- - dAtA[i] = 0x2a - } - if len(m.Help) > 0 { - i -= len(m.Help) - copy(dAtA[i:], m.Help) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Help))) - i-- - dAtA[i] = 0x22 - } - if len(m.MetricFamilyName) > 0 { - i -= len(m.MetricFamilyName) - copy(dAtA[i:], m.MetricFamilyName) - i = encodeVarintTypes(dAtA, i, uint64(len(m.MetricFamilyName))) - i-- - dAtA[i] = 0x12 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Sample) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Sample) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Sample) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Timestamp != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x10 - } - if m.Value != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) - i-- - dAtA[i] = 0x9 - } - return len(dAtA) - i, nil -} - -func (m *Exemplar) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Exemplar) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Exemplar) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Timestamp != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x18 - } - if m.Value != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) - i-- - dAtA[i] = 0x11 - } - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Histogram) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Histogram) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Histogram) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Timestamp != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x78 - } - if m.ResetHint != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.ResetHint)) - i-- - dAtA[i] = 0x70 - } - if len(m.PositiveCounts) > 0 { - for iNdEx := len(m.PositiveCounts) - 1; iNdEx >= 0; iNdEx-- { - f1 := math.Float64bits(float64(m.PositiveCounts[iNdEx])) - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(f1)) - } - i = encodeVarintTypes(dAtA, i, uint64(len(m.PositiveCounts)*8)) - i-- - dAtA[i] = 0x6a - } - if len(m.PositiveDeltas) > 0 { - var j2 int - dAtA4 := make([]byte, len(m.PositiveDeltas)*10) - for _, num := range m.PositiveDeltas { - x3 := (uint64(num) << 1) ^ uint64((num >> 63)) - for x3 >= 1<<7 { - dAtA4[j2] = uint8(uint64(x3)&0x7f | 0x80) - j2++ - x3 >>= 7 - } - dAtA4[j2] = uint8(x3) - j2++ - } - i -= j2 - copy(dAtA[i:], dAtA4[:j2]) - i = encodeVarintTypes(dAtA, i, uint64(j2)) - i-- - dAtA[i] = 0x62 - } - if len(m.PositiveSpans) > 0 { - for iNdEx := len(m.PositiveSpans) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PositiveSpans[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - } - } - if len(m.NegativeCounts) > 0 { - for iNdEx := len(m.NegativeCounts) - 1; iNdEx >= 0; iNdEx-- { - f5 := math.Float64bits(float64(m.NegativeCounts[iNdEx])) - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(f5)) - } - i = encodeVarintTypes(dAtA, i, uint64(len(m.NegativeCounts)*8)) - i-- - dAtA[i] = 0x52 - } - if len(m.NegativeDeltas) > 0 { - var j6 int - dAtA8 := make([]byte, len(m.NegativeDeltas)*10) - for _, num := range m.NegativeDeltas { - x7 := (uint64(num) << 1) ^ uint64((num >> 63)) - for x7 >= 1<<7 { - dAtA8[j6] = uint8(uint64(x7)&0x7f | 0x80) - j6++ - x7 >>= 7 - } - dAtA8[j6] = uint8(x7) - j6++ - } - i -= j6 - copy(dAtA[i:], dAtA8[:j6]) - i = encodeVarintTypes(dAtA, i, uint64(j6)) - i-- - dAtA[i] = 0x4a - } - if len(m.NegativeSpans) > 0 { - for iNdEx := len(m.NegativeSpans) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.NegativeSpans[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - } - if m.ZeroCount != nil { - { - size := m.ZeroCount.Size() - i -= size - if _, err := m.ZeroCount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if m.ZeroThreshold != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.ZeroThreshold)))) - i-- - dAtA[i] = 0x29 - } - if m.Schema != 0 { - i = encodeVarintTypes(dAtA, i, uint64((uint32(m.Schema)<<1)^uint32((m.Schema>>31)))) - i-- - dAtA[i] = 0x20 - } - if m.Sum != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Sum)))) - i-- - dAtA[i] = 0x19 - } - if m.Count != nil { - { - size := m.Count.Size() - i -= size - if _, err := m.Count.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Histogram_CountInt) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Histogram_CountInt) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintTypes(dAtA, i, uint64(m.CountInt)) - i-- - dAtA[i] = 0x8 - return len(dAtA) - i, nil -} -func (m *Histogram_CountFloat) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Histogram_CountFloat) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.CountFloat)))) - i-- - dAtA[i] = 0x11 - return len(dAtA) - i, nil -} -func (m *Histogram_ZeroCountInt) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Histogram_ZeroCountInt) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintTypes(dAtA, i, uint64(m.ZeroCountInt)) - i-- - dAtA[i] = 0x30 - return len(dAtA) - i, nil -} -func (m *Histogram_ZeroCountFloat) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Histogram_ZeroCountFloat) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.ZeroCountFloat)))) - i-- - dAtA[i] = 0x39 - return len(dAtA) - i, nil -} -func (m *BucketSpan) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BucketSpan) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BucketSpan) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Length != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Length)) - i-- - dAtA[i] = 0x10 - } - if m.Offset != 0 { - i = encodeVarintTypes(dAtA, i, uint64((uint32(m.Offset)<<1)^uint32((m.Offset>>31)))) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TimeSeries) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TimeSeries) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TimeSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Histograms) > 0 { - for iNdEx := len(m.Histograms) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Histograms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Exemplars) > 0 { - for iNdEx := len(m.Exemplars) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Exemplars[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Samples) > 0 { - for iNdEx := len(m.Samples) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Samples[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *LabelMatcher) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LabelMatcher) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelMatcher) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x1a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ReadHints) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ReadHints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ReadHints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.RangeMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.RangeMs)) - i-- - dAtA[i] = 0x38 - } - if m.By { - i-- - if m.By { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if len(m.Grouping) > 0 { - for iNdEx := len(m.Grouping) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Grouping[iNdEx]) - copy(dAtA[i:], m.Grouping[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Grouping[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if m.EndMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.EndMs)) - i-- - dAtA[i] = 0x20 - } - if m.StartMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.StartMs)) - i-- - dAtA[i] = 0x18 - } - if len(m.Func) > 0 { - i -= len(m.Func) - copy(dAtA[i:], m.Func) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Func))) - i-- - dAtA[i] = 0x12 - } - if m.StepMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.StepMs)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Chunk) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Chunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Chunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x22 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x18 - } - if m.MaxTimeMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MaxTimeMs)) - i-- - dAtA[i] = 0x10 - } - if m.MinTimeMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MinTimeMs)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ChunkedSeries) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ChunkedSeries) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChunkedSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Chunks) > 0 { - for iNdEx := len(m.Chunks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Chunks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MetricMetadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = len(m.MetricFamilyName) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Help) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Unit) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Sample) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value != 0 { - n += 9 - } - if m.Timestamp != 0 { - n += 1 + sovTypes(uint64(m.Timestamp)) - } - return n -} - -func (m *Exemplar) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if m.Value != 0 { - n += 9 - } - if m.Timestamp != 0 { - n += 1 + sovTypes(uint64(m.Timestamp)) - } - return n -} - -func (m *Histogram) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Count != nil { - n += m.Count.Size() - } - if m.Sum != 0 { - n += 9 - } - if m.Schema != 0 { - n += 1 + sozTypes(uint64(m.Schema)) - } - if m.ZeroThreshold != 0 { - n += 9 - } - if m.ZeroCount != nil { - n += m.ZeroCount.Size() - } - if len(m.NegativeSpans) > 0 { - for _, e := range m.NegativeSpans { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.NegativeDeltas) > 0 { - l = 0 - for _, e := range m.NegativeDeltas { - l += sozTypes(uint64(e)) - } - n += 1 + sovTypes(uint64(l)) + l - } - if len(m.NegativeCounts) > 0 { - n += 1 + sovTypes(uint64(len(m.NegativeCounts)*8)) + len(m.NegativeCounts)*8 - } - if len(m.PositiveSpans) > 0 { - for _, e := range m.PositiveSpans { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.PositiveDeltas) > 0 { - l = 0 - for _, e := range m.PositiveDeltas { - l += sozTypes(uint64(e)) - } - n += 1 + sovTypes(uint64(l)) + l - } - if len(m.PositiveCounts) > 0 { - n += 1 + sovTypes(uint64(len(m.PositiveCounts)*8)) + len(m.PositiveCounts)*8 - } - if m.ResetHint != 0 { - n += 1 + sovTypes(uint64(m.ResetHint)) - } - if m.Timestamp != 0 { - n += 1 + sovTypes(uint64(m.Timestamp)) - } - return n -} - -func (m *Histogram_CountInt) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovTypes(uint64(m.CountInt)) - return n -} -func (m *Histogram_CountFloat) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 9 - return n -} -func (m *Histogram_ZeroCountInt) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovTypes(uint64(m.ZeroCountInt)) - return n -} -func (m *Histogram_ZeroCountFloat) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 9 - return n -} -func (m *BucketSpan) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Offset != 0 { - n += 1 + sozTypes(uint64(m.Offset)) - } - if m.Length != 0 { - n += 1 + sovTypes(uint64(m.Length)) - } - return n -} - -func (m *TimeSeries) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.Samples) > 0 { - for _, e := range m.Samples { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.Exemplars) > 0 { - for _, e := range m.Exemplars { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.Histograms) > 0 { - for _, e := range m.Histograms { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *LabelMatcher) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ReadHints) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StepMs != 0 { - n += 1 + sovTypes(uint64(m.StepMs)) - } - l = len(m.Func) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.StartMs != 0 { - n += 1 + sovTypes(uint64(m.StartMs)) - } - if m.EndMs != 0 { - n += 1 + sovTypes(uint64(m.EndMs)) - } - if len(m.Grouping) > 0 { - for _, s := range m.Grouping { - l = len(s) - n += 1 + l + sovTypes(uint64(l)) - } - } - if m.By { - n += 2 - } - if m.RangeMs != 0 { - n += 1 + sovTypes(uint64(m.RangeMs)) - } - return n -} - -func (m *Chunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MinTimeMs != 0 { - n += 1 + sovTypes(uint64(m.MinTimeMs)) - } - if m.MaxTimeMs != 0 { - n += 1 + sovTypes(uint64(m.MaxTimeMs)) - } - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ChunkedSeries) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.Chunks) > 0 { - for _, e := range m.Chunks { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MetricMetadata) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MetricMetadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MetricMetadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= MetricMetadata_MetricType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MetricFamilyName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MetricFamilyName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Help", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Help = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Unit", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Unit = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Sample) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Sample: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Sample: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Value = float64(math.Float64frombits(v)) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Exemplar) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Exemplar: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Exemplar: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Value = float64(math.Float64frombits(v)) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Histogram) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Histogram: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Histogram: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CountInt", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Count = &Histogram_CountInt{v} - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field CountFloat", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Count = &Histogram_CountFloat{float64(math.Float64frombits(v))} - case 3: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Sum", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Sum = float64(math.Float64frombits(v)) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - v = int32((uint32(v) >> 1) ^ uint32(((v&1)<<31)>>31)) - m.Schema = v - case 5: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field ZeroThreshold", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.ZeroThreshold = float64(math.Float64frombits(v)) - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ZeroCountInt", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ZeroCount = &Histogram_ZeroCountInt{v} - case 7: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field ZeroCountFloat", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.ZeroCount = &Histogram_ZeroCountFloat{float64(math.Float64frombits(v))} - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NegativeSpans", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NegativeSpans = append(m.NegativeSpans, BucketSpan{}) - if err := m.NegativeSpans[len(m.NegativeSpans)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) - m.NegativeDeltas = append(m.NegativeDeltas, int64(v)) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.NegativeDeltas) == 0 { - m.NegativeDeltas = make([]int64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) - m.NegativeDeltas = append(m.NegativeDeltas, int64(v)) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field NegativeDeltas", wireType) - } - case 10: - if wireType == 1 { - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - v2 := float64(math.Float64frombits(v)) - m.NegativeCounts = append(m.NegativeCounts, v2) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - elementCount = packedLen / 8 - if elementCount != 0 && len(m.NegativeCounts) == 0 { - m.NegativeCounts = make([]float64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - v2 := float64(math.Float64frombits(v)) - m.NegativeCounts = append(m.NegativeCounts, v2) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field NegativeCounts", wireType) - } - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PositiveSpans", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PositiveSpans = append(m.PositiveSpans, BucketSpan{}) - if err := m.PositiveSpans[len(m.PositiveSpans)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) - m.PositiveDeltas = append(m.PositiveDeltas, int64(v)) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.PositiveDeltas) == 0 { - m.PositiveDeltas = make([]int64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) - m.PositiveDeltas = append(m.PositiveDeltas, int64(v)) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field PositiveDeltas", wireType) - } - case 13: - if wireType == 1 { - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - v2 := float64(math.Float64frombits(v)) - m.PositiveCounts = append(m.PositiveCounts, v2) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - elementCount = packedLen / 8 - if elementCount != 0 && len(m.PositiveCounts) == 0 { - m.PositiveCounts = make([]float64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - v2 := float64(math.Float64frombits(v)) - m.PositiveCounts = append(m.PositiveCounts, v2) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field PositiveCounts", wireType) - } - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ResetHint", wireType) - } - m.ResetHint = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ResetHint |= Histogram_ResetHint(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +// Deprecated: Use ChunkedSeries.ProtoReflect.Descriptor instead. +func (*ChunkedSeries) Descriptor() ([]byte, []int) { + return file_store_storepb_prompb_types_proto_rawDescGZIP(), []int{9} } -func (m *BucketSpan) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BucketSpan: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BucketSpan: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - v = int32((uint32(v) >> 1) ^ uint32(((v&1)<<31)>>31)) - m.Offset = v - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Length", wireType) - } - m.Length = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Length |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ChunkedSeries) GetLabels() []*labelpb.Label { + if x != nil { + return x.Labels } return nil } -func (m *TimeSeries) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TimeSeries: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TimeSeries: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Samples", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Samples = append(m.Samples, Sample{}) - if err := m.Samples[len(m.Samples)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Exemplars", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Exemplars = append(m.Exemplars, Exemplar{}) - if err := m.Exemplars[len(m.Exemplars)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Histograms", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Histograms = append(m.Histograms, Histogram{}) - if err := m.Histograms[len(m.Histograms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *ChunkedSeries) GetChunks() []*Chunk { + if x != nil { + return x.Chunks } return nil } -func (m *LabelMatcher) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LabelMatcher: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelMatcher: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= LabelMatcher_Type(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +var File_store_storepb_prompb_types_proto protoreflect.FileDescriptor + +var file_store_storepb_prompb_types_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2f, + 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x62, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0f, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, 0x63, + 0x6f, 0x70, 0x79, 0x1a, 0x19, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x70, 0x62, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x33, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x74, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x76, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x76, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2f, 0x74, 0x61, 0x67, 0x67, + 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa7, 0x02, 0x0a, 0x0e, 0x4d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3e, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x6d, + 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x2e, 0x4d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x46, + 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x6c, + 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x12, 0x12, 0x0a, + 0x04, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x6e, 0x69, + 0x74, 0x22, 0x79, 0x0a, 0x0a, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, + 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x41, 0x55, + 0x47, 0x45, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, + 0x4d, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x47, 0x41, 0x55, 0x47, 0x45, 0x48, 0x49, 0x53, 0x54, + 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x4d, 0x4d, 0x41, + 0x52, 0x59, 0x10, 0x05, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x06, 0x12, 0x0c, + 0x0a, 0x08, 0x53, 0x54, 0x41, 0x54, 0x45, 0x53, 0x45, 0x54, 0x10, 0x07, 0x3a, 0x04, 0xa8, 0xa6, + 0x1f, 0x01, 0x22, 0x42, 0x0a, 0x06, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x3a, 0x04, 0xa8, 0xa6, 0x1f, 0x01, 0x22, 0x7f, 0x0a, 0x08, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x72, 0x12, 0x39, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x42, 0x12, 0x9a, 0x84, 0x9e, 0x03, 0x0d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x22, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x3a, 0x04, 0xa8, 0xa6, 0x1f, 0x01, 0x22, 0x8c, 0x06, 0x0a, 0x09, 0x48, 0x69, 0x73, 0x74, + 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x1d, 0x0a, 0x09, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x49, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x66, 0x6c, + 0x6f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0a, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x11, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, + 0x6f, 0x6c, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0d, 0x7a, 0x65, 0x72, 0x6f, 0x54, + 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x7a, 0x65, 0x72, 0x6f, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, + 0x48, 0x01, 0x52, 0x0c, 0x7a, 0x65, 0x72, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x74, + 0x12, 0x2a, 0x0a, 0x10, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x66, + 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x48, 0x01, 0x52, 0x0e, 0x7a, 0x65, + 0x72, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x12, 0x5e, 0x0a, 0x0e, + 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x6e, 0x73, 0x18, 0x08, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, + 0x73, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x70, 0x61, + 0x6e, 0x42, 0x1a, 0x9a, 0x84, 0x9e, 0x03, 0x15, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6e, 0x65, + 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x6e, 0x73, 0x22, 0x52, 0x0d, 0x6e, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x53, 0x70, 0x61, 0x6e, 0x73, 0x12, 0x27, 0x0a, 0x0f, + 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x73, 0x18, + 0x09, 0x20, 0x03, 0x28, 0x12, 0x52, 0x0e, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x44, + 0x65, 0x6c, 0x74, 0x61, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, + 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0e, + 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x5e, + 0x0a, 0x0e, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x6e, 0x73, + 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, + 0x65, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, + 0x70, 0x61, 0x6e, 0x42, 0x1a, 0x9a, 0x84, 0x9e, 0x03, 0x15, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x6e, 0x73, 0x22, 0x52, + 0x0d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x53, 0x70, 0x61, 0x6e, 0x73, 0x12, 0x27, + 0x0a, 0x0f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, + 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x12, 0x52, 0x0e, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, + 0x65, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x69, 0x76, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x01, + 0x52, 0x0e, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x12, 0x43, 0x0a, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x74, 0x5f, 0x68, 0x69, 0x6e, 0x74, 0x18, 0x0e, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, + 0x73, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, + 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x48, 0x69, 0x6e, 0x74, 0x52, 0x09, 0x72, 0x65, 0x73, 0x65, + 0x74, 0x48, 0x69, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x22, 0x34, 0x0a, 0x09, 0x52, 0x65, 0x73, 0x65, 0x74, 0x48, 0x69, 0x6e, 0x74, + 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, + 0x03, 0x59, 0x45, 0x53, 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x4e, 0x4f, 0x10, 0x02, 0x12, 0x09, + 0x0a, 0x05, 0x47, 0x41, 0x55, 0x47, 0x45, 0x10, 0x03, 0x3a, 0x04, 0xa8, 0xa6, 0x1f, 0x01, 0x42, + 0x07, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x0c, 0x0a, 0x0a, 0x7a, 0x65, 0x72, 0x6f, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x42, 0x0a, 0x0a, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x53, 0x70, 0x61, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x11, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6c, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x04, 0xa8, 0xa6, 0x1f, 0x01, 0x22, 0xb9, 0x02, 0x0a, 0x0a, 0x54, + 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x06, 0x6c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x74, 0x68, 0x61, 0x6e, + 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x42, 0x12, 0x9a, 0x84, 0x9e, 0x03, 0x0d, 0x6a, + 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x52, 0x06, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x12, 0x46, 0x0a, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, + 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x2e, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x13, + 0x9a, 0x84, 0x9e, 0x03, 0x0e, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x73, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x73, 0x22, 0x52, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x4e, 0x0a, 0x09, + 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x70, + 0x79, 0x2e, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x42, 0x15, 0x9a, 0x84, 0x9e, 0x03, + 0x10, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, + 0x22, 0x52, 0x09, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x52, 0x0a, 0x0a, + 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, 0x63, 0x6f, + 0x70, 0x79, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x42, 0x16, 0x9a, 0x84, + 0x9e, 0x03, 0x11, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, + 0x61, 0x6d, 0x73, 0x22, 0x52, 0x0a, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x73, + 0x3a, 0x04, 0xa8, 0xa6, 0x1f, 0x01, 0x22, 0xaa, 0x01, 0x0a, 0x0c, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, + 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x1a, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xb2, + 0xa9, 0x1f, 0x02, 0x08, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xb2, 0xa9, 0x1f, 0x02, + 0x08, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x28, 0x0a, 0x04, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x06, 0x0a, 0x02, 0x45, 0x51, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4e, 0x45, 0x51, + 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x52, 0x45, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x4e, 0x52, + 0x45, 0x10, 0x03, 0x22, 0xb1, 0x01, 0x0a, 0x09, 0x52, 0x65, 0x61, 0x64, 0x48, 0x69, 0x6e, 0x74, + 0x73, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x74, 0x65, 0x70, 0x5f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x65, 0x70, 0x4d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x75, + 0x6e, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x75, 0x6e, 0x63, 0x12, 0x19, + 0x0a, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4d, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x64, + 0x5f, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x64, 0x4d, 0x73, + 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, + 0x62, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x62, 0x79, 0x12, 0x19, 0x0a, 0x08, + 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, + 0x72, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x73, 0x22, 0xd6, 0x01, 0x0a, 0x05, 0x43, 0x68, 0x75, 0x6e, + 0x6b, 0x12, 0x1e, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x4d, + 0x73, 0x12, 0x1e, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x4d, + 0x73, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x70, + 0x79, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x2e, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x44, 0x0a, 0x08, 0x45, 0x6e, + 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x58, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, + 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x46, + 0x4c, 0x4f, 0x41, 0x54, 0x5f, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10, 0x03, + 0x22, 0x8e, 0x01, 0x0a, 0x0d, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x53, 0x65, 0x72, 0x69, + 0x65, 0x73, 0x12, 0x39, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x42, 0x12, 0x9a, 0x84, 0x9e, 0x03, 0x0d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x22, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x42, 0x0a, + 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x2e, + 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x42, 0x12, 0x9a, 0x84, 0x9e, 0x03, 0x0d, 0x6a, 0x73, 0x6f, 0x6e, + 0x3a, 0x22, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x22, 0x52, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, + 0x73, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, + 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x70, 0x62, 0x2f, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } -func (m *ReadHints) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ReadHints: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ReadHints: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StepMs", wireType) - } - m.StepMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StepMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Func", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Func = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartMs", wireType) - } - m.StartMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndMs", wireType) - } - m.EndMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EndMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grouping", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Grouping = append(m.Grouping, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field By", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.By = bool(v != 0) - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeMs", wireType) - } - m.RangeMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RangeMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Chunk) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Chunk: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Chunk: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinTimeMs", wireType) - } - m.MinTimeMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinTimeMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxTimeMs", wireType) - } - m.MaxTimeMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxTimeMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= Chunk_Encoding(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChunkedSeries) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ChunkedSeries: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChunkedSeries: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Chunks = append(m.Chunks, Chunk{}) - if err := m.Chunks[len(m.Chunks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +var ( + file_store_storepb_prompb_types_proto_rawDescOnce sync.Once + file_store_storepb_prompb_types_proto_rawDescData = file_store_storepb_prompb_types_proto_rawDesc +) - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } +func file_store_storepb_prompb_types_proto_rawDescGZIP() []byte { + file_store_storepb_prompb_types_proto_rawDescOnce.Do(func() { + file_store_storepb_prompb_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_storepb_prompb_types_proto_rawDescData) + }) + return file_store_storepb_prompb_types_proto_rawDescData +} + +var file_store_storepb_prompb_types_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_store_storepb_prompb_types_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_store_storepb_prompb_types_proto_goTypes = []any{ + (MetricMetadata_MetricType)(0), // 0: prometheus_copy.MetricMetadata.MetricType + (Histogram_ResetHint)(0), // 1: prometheus_copy.Histogram.ResetHint + (LabelMatcher_Type)(0), // 2: prometheus_copy.LabelMatcher.Type + (Chunk_Encoding)(0), // 3: prometheus_copy.Chunk.Encoding + (*MetricMetadata)(nil), // 4: prometheus_copy.MetricMetadata + (*Sample)(nil), // 5: prometheus_copy.Sample + (*Exemplar)(nil), // 6: prometheus_copy.Exemplar + (*Histogram)(nil), // 7: prometheus_copy.Histogram + (*BucketSpan)(nil), // 8: prometheus_copy.BucketSpan + (*TimeSeries)(nil), // 9: prometheus_copy.TimeSeries + (*LabelMatcher)(nil), // 10: prometheus_copy.LabelMatcher + (*ReadHints)(nil), // 11: prometheus_copy.ReadHints + (*Chunk)(nil), // 12: prometheus_copy.Chunk + (*ChunkedSeries)(nil), // 13: prometheus_copy.ChunkedSeries + (*labelpb.Label)(nil), // 14: thanos.Label +} +var file_store_storepb_prompb_types_proto_depIdxs = []int32{ + 0, // 0: prometheus_copy.MetricMetadata.type:type_name -> prometheus_copy.MetricMetadata.MetricType + 14, // 1: prometheus_copy.Exemplar.labels:type_name -> thanos.Label + 8, // 2: prometheus_copy.Histogram.negative_spans:type_name -> prometheus_copy.BucketSpan + 8, // 3: prometheus_copy.Histogram.positive_spans:type_name -> prometheus_copy.BucketSpan + 1, // 4: prometheus_copy.Histogram.reset_hint:type_name -> prometheus_copy.Histogram.ResetHint + 14, // 5: prometheus_copy.TimeSeries.labels:type_name -> thanos.Label + 5, // 6: prometheus_copy.TimeSeries.samples:type_name -> prometheus_copy.Sample + 6, // 7: prometheus_copy.TimeSeries.exemplars:type_name -> prometheus_copy.Exemplar + 7, // 8: prometheus_copy.TimeSeries.histograms:type_name -> prometheus_copy.Histogram + 2, // 9: prometheus_copy.LabelMatcher.type:type_name -> prometheus_copy.LabelMatcher.Type + 3, // 10: prometheus_copy.Chunk.type:type_name -> prometheus_copy.Chunk.Encoding + 14, // 11: prometheus_copy.ChunkedSeries.labels:type_name -> thanos.Label + 12, // 12: prometheus_copy.ChunkedSeries.chunks:type_name -> prometheus_copy.Chunk + 13, // [13:13] is the sub-list for method output_type + 13, // [13:13] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name +} + +func init() { file_store_storepb_prompb_types_proto_init() } +func file_store_storepb_prompb_types_proto_init() { + if File_store_storepb_prompb_types_proto != nil { + return + } + file_store_storepb_prompb_types_proto_msgTypes[3].OneofWrappers = []any{ + (*Histogram_CountInt)(nil), + (*Histogram_CountFloat)(nil), + (*Histogram_ZeroCountInt)(nil), + (*Histogram_ZeroCountFloat)(nil), } - return 0, io.ErrUnexpectedEOF + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_store_storepb_prompb_types_proto_rawDesc, + NumEnums: 4, + NumMessages: 10, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_store_storepb_prompb_types_proto_goTypes, + DependencyIndexes: file_store_storepb_prompb_types_proto_depIdxs, + EnumInfos: file_store_storepb_prompb_types_proto_enumTypes, + MessageInfos: file_store_storepb_prompb_types_proto_msgTypes, + }.Build() + File_store_storepb_prompb_types_proto = out.File + file_store_storepb_prompb_types_proto_rawDesc = nil + file_store_storepb_prompb_types_proto_goTypes = nil + file_store_storepb_prompb_types_proto_depIdxs = nil } - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/pkg/store/storepb/prompb/types.proto b/pkg/store/storepb/prompb/types.proto index c2d089b06b9..2f9156992e1 100644 --- a/pkg/store/storepb/prompb/types.proto +++ b/pkg/store/storepb/prompb/types.proto @@ -17,18 +17,14 @@ syntax = "proto3"; package prometheus_copy; -option go_package = "prompb"; +option go_package = "github.com/thanos-io/thanos/pkg/store/storepb/prompb"; -import "gogoproto/gogo.proto"; import "store/labelpb/types.proto"; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; +import "github.com/planetscale/vtprotobuf/vtproto/ext.proto"; +import "tagger/tagger.proto"; message MetricMetadata { + option (vtproto.mempool) = true; enum MetricType { UNKNOWN = 0; COUNTER = 1; @@ -49,13 +45,15 @@ message MetricMetadata { } message Sample { + option (vtproto.mempool) = true; double value = 1; int64 timestamp = 2; } message Exemplar { + option (vtproto.mempool) = true; // Optional, can be empty. - repeated thanos.Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel"]; + repeated thanos.Label labels = 1 [(tagger.tags) = "json:\"labels\""]; double value = 2; // timestamp is in ms format, see pkg/timestamp/timestamp.go for // conversion from time.Time to Prometheus timestamp. @@ -69,6 +67,7 @@ message Exemplar { // histograms. This Histogram message can represent both, the usual // integer histogram as well as a float histogram. message Histogram { + option (vtproto.mempool) = true; enum ResetHint { UNKNOWN = 0; // Need to test for a counter reset explicitly. YES = 1; // This is the 1st histogram after a counter reset. @@ -96,7 +95,7 @@ message Histogram { } // Negative Buckets. - repeated BucketSpan negative_spans = 8 [(gogoproto.nullable) = false]; + repeated BucketSpan negative_spans = 8 [(tagger.tags) = "json:\"negative_spans\""]; // Use either "negative_deltas" or "negative_counts", the former for // regular histograms with integer counts, the latter for float // histograms. @@ -104,7 +103,7 @@ message Histogram { repeated double negative_counts = 10; // Absolute count of each bucket. // Positive Buckets. - repeated BucketSpan positive_spans = 11 [(gogoproto.nullable) = false]; + repeated BucketSpan positive_spans = 11 [(tagger.tags) = "json:\"positive_spans\""]; // Use either "positive_deltas" or "positive_counts", the former for // regular histograms with integer counts, the latter for float // histograms. @@ -115,7 +114,7 @@ message Histogram { // timestamp is in ms format, see model/timestamp/timestamp.go for // conversion from time.Time to Prometheus timestamp. int64 timestamp = 15; -} +} // A BucketSpan defines a number of consecutive buckets with their // offset. Logically, it would be more straightforward to include the @@ -123,6 +122,7 @@ message Histogram { // more compact in the way the data is structured here (with all the // buckets in a single array separate from the Spans). message BucketSpan { + option (vtproto.mempool) = true; sint32 offset = 1; // Gap to previous span, or starting point for 1st span (which can be negative). uint32 length = 2; // Length of consecutive buckets. } @@ -130,12 +130,12 @@ message BucketSpan { // TimeSeries represents samples and labels for a single time series. message TimeSeries { + option (vtproto.mempool) = true; // Labels have to be sorted by label names and without duplicated label names. - // TODO(bwplotka): Don't use zero copy ZLabels, see https://github.com/thanos-io/thanos/pull/3279 for details. - repeated thanos.Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel"]; - repeated Sample samples = 2 [(gogoproto.nullable) = false]; - repeated Exemplar exemplars = 3 [(gogoproto.nullable) = false]; - repeated Histogram histograms = 4 [(gogoproto.nullable) = false]; + repeated thanos.Label labels = 1 [(tagger.tags) = "json:\"labels\""]; + repeated Sample samples = 2 [(tagger.tags) = "json:\"samples\""]; + repeated Exemplar exemplars = 3 [(tagger.tags) = "json:\"exemplars\""]; + repeated Histogram histograms = 4 [(tagger.tags) = "json:\"histograms\""]; } // Matcher specifies a rule, which can match or set of labels or not. @@ -147,8 +147,8 @@ message LabelMatcher { NRE = 3; } Type type = 1; - string name = 2; - string value = 3; + string name = 2 [(vtproto.options).unique = true]; + string value = 3 [(vtproto.options).unique = true]; } message ReadHints { @@ -181,7 +181,7 @@ message Chunk { // ChunkedSeries represents single, encoded time series. message ChunkedSeries { // Labels should be sorted. - repeated thanos.Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel"]; + repeated thanos.Label labels = 1 [(tagger.tags) = "json:\"labels\""]; // Chunks will be in start time order and may overlap. - repeated Chunk chunks = 2 [(gogoproto.nullable) = false]; + repeated Chunk chunks = 2 [(tagger.tags) = "json:\"chunks\""]; } diff --git a/pkg/store/storepb/prompb/types_vtproto.pb.go b/pkg/store/storepb/prompb/types_vtproto.pb.go new file mode 100644 index 00000000000..019b478808b --- /dev/null +++ b/pkg/store/storepb/prompb/types_vtproto.pb.go @@ -0,0 +1,3935 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.1-0.20250313105119-ba97887b0a25 +// source: store/storepb/prompb/types.proto + +package prompb + +import ( + binary "encoding/binary" + fmt "fmt" + io "io" + math "math" + sync "sync" + unsafe "unsafe" + + unique "github.com/thanos-io/thanos/pkg/unique" + + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *MetricMetadata) CloneVT() *MetricMetadata { + if m == nil { + return (*MetricMetadata)(nil) + } + r := MetricMetadataFromVTPool() + r.Type = m.Type + r.MetricFamilyName = m.MetricFamilyName + r.Help = m.Help + r.Unit = m.Unit + return r +} + +func (m *MetricMetadata) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Sample) CloneVT() *Sample { + if m == nil { + return (*Sample)(nil) + } + r := SampleFromVTPool() + r.Value = m.Value + r.Timestamp = m.Timestamp + return r +} + +func (m *Sample) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Exemplar) CloneVT() *Exemplar { + if m == nil { + return (*Exemplar)(nil) + } + r := ExemplarFromVTPool() + r.Value = m.Value + r.Timestamp = m.Timestamp + if rhs := m.Labels; rhs != nil { + tmpContainer := make([]*labelpb.Label, len(rhs)) + for k, v := range rhs { + if vtpb, ok := interface{}(v).(interface{ CloneVT() *labelpb.Label }); ok { + tmpContainer[k] = vtpb.CloneVT() + } else { + tmpContainer[k] = proto.Clone(v).(*labelpb.Label) + } + } + r.Labels = tmpContainer + } + return r +} + +func (m *Exemplar) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Histogram) CloneVT() *Histogram { + if m == nil { + return (*Histogram)(nil) + } + r := HistogramFromVTPool() + r.Sum = m.Sum + r.Schema = m.Schema + r.ZeroThreshold = m.ZeroThreshold + r.ResetHint = m.ResetHint + r.Timestamp = m.Timestamp + if m.Count != nil { + r.Count = m.Count.(interface{ CloneVT() isHistogram_Count }).CloneVT() + } + if m.ZeroCount != nil { + r.ZeroCount = m.ZeroCount.(interface{ CloneVT() isHistogram_ZeroCount }).CloneVT() + } + if rhs := m.NegativeSpans; rhs != nil { + tmpContainer := make([]*BucketSpan, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.NegativeSpans = tmpContainer + } + if rhs := m.NegativeDeltas; rhs != nil { + tmpContainer := make([]int64, len(rhs)) + copy(tmpContainer, rhs) + r.NegativeDeltas = tmpContainer + } + if rhs := m.NegativeCounts; rhs != nil { + tmpContainer := make([]float64, len(rhs)) + copy(tmpContainer, rhs) + r.NegativeCounts = tmpContainer + } + if rhs := m.PositiveSpans; rhs != nil { + tmpContainer := make([]*BucketSpan, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.PositiveSpans = tmpContainer + } + if rhs := m.PositiveDeltas; rhs != nil { + tmpContainer := make([]int64, len(rhs)) + copy(tmpContainer, rhs) + r.PositiveDeltas = tmpContainer + } + if rhs := m.PositiveCounts; rhs != nil { + tmpContainer := make([]float64, len(rhs)) + copy(tmpContainer, rhs) + r.PositiveCounts = tmpContainer + } + return r +} + +func (m *Histogram) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Histogram_CountInt) CloneVT() isHistogram_Count { + if m == nil { + return (*Histogram_CountInt)(nil) + } + r := new(Histogram_CountInt) + r.CountInt = m.CountInt + return r +} + +func (m *Histogram_CountFloat) CloneVT() isHistogram_Count { + if m == nil { + return (*Histogram_CountFloat)(nil) + } + r := new(Histogram_CountFloat) + r.CountFloat = m.CountFloat + return r +} + +func (m *Histogram_ZeroCountInt) CloneVT() isHistogram_ZeroCount { + if m == nil { + return (*Histogram_ZeroCountInt)(nil) + } + r := new(Histogram_ZeroCountInt) + r.ZeroCountInt = m.ZeroCountInt + return r +} + +func (m *Histogram_ZeroCountFloat) CloneVT() isHistogram_ZeroCount { + if m == nil { + return (*Histogram_ZeroCountFloat)(nil) + } + r := new(Histogram_ZeroCountFloat) + r.ZeroCountFloat = m.ZeroCountFloat + return r +} + +func (m *BucketSpan) CloneVT() *BucketSpan { + if m == nil { + return (*BucketSpan)(nil) + } + r := BucketSpanFromVTPool() + r.Offset = m.Offset + r.Length = m.Length + return r +} + +func (m *BucketSpan) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *TimeSeries) CloneVT() *TimeSeries { + if m == nil { + return (*TimeSeries)(nil) + } + r := TimeSeriesFromVTPool() + if rhs := m.Labels; rhs != nil { + tmpContainer := make([]*labelpb.Label, len(rhs)) + for k, v := range rhs { + if vtpb, ok := interface{}(v).(interface{ CloneVT() *labelpb.Label }); ok { + tmpContainer[k] = vtpb.CloneVT() + } else { + tmpContainer[k] = proto.Clone(v).(*labelpb.Label) + } + } + r.Labels = tmpContainer + } + if rhs := m.Samples; rhs != nil { + tmpContainer := make([]*Sample, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Samples = tmpContainer + } + if rhs := m.Exemplars; rhs != nil { + tmpContainer := make([]*Exemplar, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Exemplars = tmpContainer + } + if rhs := m.Histograms; rhs != nil { + tmpContainer := make([]*Histogram, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Histograms = tmpContainer + } + return r +} + +func (m *TimeSeries) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *LabelMatcher) CloneVT() *LabelMatcher { + if m == nil { + return (*LabelMatcher)(nil) + } + r := new(LabelMatcher) + r.Type = m.Type + r.Name = m.Name + r.Value = m.Value + return r +} + +func (m *LabelMatcher) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ReadHints) CloneVT() *ReadHints { + if m == nil { + return (*ReadHints)(nil) + } + r := new(ReadHints) + r.StepMs = m.StepMs + r.Func = m.Func + r.StartMs = m.StartMs + r.EndMs = m.EndMs + r.By = m.By + r.RangeMs = m.RangeMs + if rhs := m.Grouping; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Grouping = tmpContainer + } + return r +} + +func (m *ReadHints) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Chunk) CloneVT() *Chunk { + if m == nil { + return (*Chunk)(nil) + } + r := new(Chunk) + r.MinTimeMs = m.MinTimeMs + r.MaxTimeMs = m.MaxTimeMs + r.Type = m.Type + if rhs := m.Data; rhs != nil { + tmpBytes := make([]byte, len(rhs)) + copy(tmpBytes, rhs) + r.Data = tmpBytes + } + return r +} + +func (m *Chunk) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ChunkedSeries) CloneVT() *ChunkedSeries { + if m == nil { + return (*ChunkedSeries)(nil) + } + r := new(ChunkedSeries) + if rhs := m.Labels; rhs != nil { + tmpContainer := make([]*labelpb.Label, len(rhs)) + for k, v := range rhs { + if vtpb, ok := interface{}(v).(interface{ CloneVT() *labelpb.Label }); ok { + tmpContainer[k] = vtpb.CloneVT() + } else { + tmpContainer[k] = proto.Clone(v).(*labelpb.Label) + } + } + r.Labels = tmpContainer + } + if rhs := m.Chunks; rhs != nil { + tmpContainer := make([]*Chunk, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Chunks = tmpContainer + } + return r +} + +func (m *ChunkedSeries) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *MetricMetadata) EqualVT(that *MetricMetadata) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Type != that.Type { + return false + } + if this.MetricFamilyName != that.MetricFamilyName { + return false + } + if this.Help != that.Help { + return false + } + if this.Unit != that.Unit { + return false + } + return true +} + +func (this *MetricMetadata) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*MetricMetadata) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Sample) EqualVT(that *Sample) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Value != that.Value { + return false + } + if this.Timestamp != that.Timestamp { + return false + } + return true +} + +func (this *Sample) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Sample) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Exemplar) EqualVT(that *Exemplar) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Labels) != len(that.Labels) { + return false + } + for i, vx := range this.Labels { + vy := that.Labels[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &labelpb.Label{} + } + if q == nil { + q = &labelpb.Label{} + } + if equal, ok := interface{}(p).(interface{ EqualVT(*labelpb.Label) bool }); ok { + if !equal.EqualVT(q) { + return false + } + } else if !proto.Equal(p, q) { + return false + } + } + } + if this.Value != that.Value { + return false + } + if this.Timestamp != that.Timestamp { + return false + } + return true +} + +func (this *Exemplar) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Exemplar) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Histogram) EqualVT(that *Histogram) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Count == nil && that.Count != nil { + return false + } else if this.Count != nil { + if that.Count == nil { + return false + } + if !this.Count.(interface{ EqualVT(isHistogram_Count) bool }).EqualVT(that.Count) { + return false + } + } + if this.ZeroCount == nil && that.ZeroCount != nil { + return false + } else if this.ZeroCount != nil { + if that.ZeroCount == nil { + return false + } + if !this.ZeroCount.(interface { + EqualVT(isHistogram_ZeroCount) bool + }).EqualVT(that.ZeroCount) { + return false + } + } + if this.Sum != that.Sum { + return false + } + if this.Schema != that.Schema { + return false + } + if this.ZeroThreshold != that.ZeroThreshold { + return false + } + if len(this.NegativeSpans) != len(that.NegativeSpans) { + return false + } + for i, vx := range this.NegativeSpans { + vy := that.NegativeSpans[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &BucketSpan{} + } + if q == nil { + q = &BucketSpan{} + } + if !p.EqualVT(q) { + return false + } + } + } + if len(this.NegativeDeltas) != len(that.NegativeDeltas) { + return false + } + for i, vx := range this.NegativeDeltas { + vy := that.NegativeDeltas[i] + if vx != vy { + return false + } + } + if len(this.NegativeCounts) != len(that.NegativeCounts) { + return false + } + for i, vx := range this.NegativeCounts { + vy := that.NegativeCounts[i] + if vx != vy { + return false + } + } + if len(this.PositiveSpans) != len(that.PositiveSpans) { + return false + } + for i, vx := range this.PositiveSpans { + vy := that.PositiveSpans[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &BucketSpan{} + } + if q == nil { + q = &BucketSpan{} + } + if !p.EqualVT(q) { + return false + } + } + } + if len(this.PositiveDeltas) != len(that.PositiveDeltas) { + return false + } + for i, vx := range this.PositiveDeltas { + vy := that.PositiveDeltas[i] + if vx != vy { + return false + } + } + if len(this.PositiveCounts) != len(that.PositiveCounts) { + return false + } + for i, vx := range this.PositiveCounts { + vy := that.PositiveCounts[i] + if vx != vy { + return false + } + } + if this.ResetHint != that.ResetHint { + return false + } + if this.Timestamp != that.Timestamp { + return false + } + return true +} + +func (this *Histogram) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Histogram) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Histogram_CountInt) EqualVT(thatIface isHistogram_Count) bool { + that, ok := thatIface.(*Histogram_CountInt) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.CountInt != that.CountInt { + return false + } + return true +} + +func (this *Histogram_CountFloat) EqualVT(thatIface isHistogram_Count) bool { + that, ok := thatIface.(*Histogram_CountFloat) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.CountFloat != that.CountFloat { + return false + } + return true +} + +func (this *Histogram_ZeroCountInt) EqualVT(thatIface isHistogram_ZeroCount) bool { + that, ok := thatIface.(*Histogram_ZeroCountInt) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.ZeroCountInt != that.ZeroCountInt { + return false + } + return true +} + +func (this *Histogram_ZeroCountFloat) EqualVT(thatIface isHistogram_ZeroCount) bool { + that, ok := thatIface.(*Histogram_ZeroCountFloat) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.ZeroCountFloat != that.ZeroCountFloat { + return false + } + return true +} + +func (this *BucketSpan) EqualVT(that *BucketSpan) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Offset != that.Offset { + return false + } + if this.Length != that.Length { + return false + } + return true +} + +func (this *BucketSpan) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*BucketSpan) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *TimeSeries) EqualVT(that *TimeSeries) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Labels) != len(that.Labels) { + return false + } + for i, vx := range this.Labels { + vy := that.Labels[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &labelpb.Label{} + } + if q == nil { + q = &labelpb.Label{} + } + if equal, ok := interface{}(p).(interface{ EqualVT(*labelpb.Label) bool }); ok { + if !equal.EqualVT(q) { + return false + } + } else if !proto.Equal(p, q) { + return false + } + } + } + if len(this.Samples) != len(that.Samples) { + return false + } + for i, vx := range this.Samples { + vy := that.Samples[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Sample{} + } + if q == nil { + q = &Sample{} + } + if !p.EqualVT(q) { + return false + } + } + } + if len(this.Exemplars) != len(that.Exemplars) { + return false + } + for i, vx := range this.Exemplars { + vy := that.Exemplars[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Exemplar{} + } + if q == nil { + q = &Exemplar{} + } + if !p.EqualVT(q) { + return false + } + } + } + if len(this.Histograms) != len(that.Histograms) { + return false + } + for i, vx := range this.Histograms { + vy := that.Histograms[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Histogram{} + } + if q == nil { + q = &Histogram{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *TimeSeries) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*TimeSeries) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *LabelMatcher) EqualVT(that *LabelMatcher) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Type != that.Type { + return false + } + if this.Name != that.Name { + return false + } + if this.Value != that.Value { + return false + } + return true +} + +func (this *LabelMatcher) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*LabelMatcher) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ReadHints) EqualVT(that *ReadHints) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.StepMs != that.StepMs { + return false + } + if this.Func != that.Func { + return false + } + if this.StartMs != that.StartMs { + return false + } + if this.EndMs != that.EndMs { + return false + } + if len(this.Grouping) != len(that.Grouping) { + return false + } + for i, vx := range this.Grouping { + vy := that.Grouping[i] + if vx != vy { + return false + } + } + if this.By != that.By { + return false + } + if this.RangeMs != that.RangeMs { + return false + } + return true +} + +func (this *ReadHints) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ReadHints) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Chunk) EqualVT(that *Chunk) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.MinTimeMs != that.MinTimeMs { + return false + } + if this.MaxTimeMs != that.MaxTimeMs { + return false + } + if this.Type != that.Type { + return false + } + if string(this.Data) != string(that.Data) { + return false + } + return true +} + +func (this *Chunk) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Chunk) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ChunkedSeries) EqualVT(that *ChunkedSeries) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Labels) != len(that.Labels) { + return false + } + for i, vx := range this.Labels { + vy := that.Labels[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &labelpb.Label{} + } + if q == nil { + q = &labelpb.Label{} + } + if equal, ok := interface{}(p).(interface{ EqualVT(*labelpb.Label) bool }); ok { + if !equal.EqualVT(q) { + return false + } + } else if !proto.Equal(p, q) { + return false + } + } + } + if len(this.Chunks) != len(that.Chunks) { + return false + } + for i, vx := range this.Chunks { + vy := that.Chunks[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Chunk{} + } + if q == nil { + q = &Chunk{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *ChunkedSeries) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ChunkedSeries) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *MetricMetadata) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MetricMetadata) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MetricMetadata) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Unit) > 0 { + i -= len(m.Unit) + copy(dAtA[i:], m.Unit) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Unit))) + i-- + dAtA[i] = 0x2a + } + if len(m.Help) > 0 { + i -= len(m.Help) + copy(dAtA[i:], m.Help) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Help))) + i-- + dAtA[i] = 0x22 + } + if len(m.MetricFamilyName) > 0 { + i -= len(m.MetricFamilyName) + copy(dAtA[i:], m.MetricFamilyName) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.MetricFamilyName))) + i-- + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Sample) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Sample) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Sample) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.Timestamp != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x10 + } + if m.Value != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) + i-- + dAtA[i] = 0x9 + } + return len(dAtA) - i, nil +} + +func (m *Exemplar) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Exemplar) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Exemplar) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.Timestamp != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x18 + } + if m.Value != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) + i-- + dAtA[i] = 0x11 + } + if len(m.Labels) > 0 { + for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.Labels[iNdEx]).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Labels[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Histogram) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Histogram) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Histogram) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if vtmsg, ok := m.ZeroCount.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if vtmsg, ok := m.Count.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if m.Timestamp != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x78 + } + if m.ResetHint != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ResetHint)) + i-- + dAtA[i] = 0x70 + } + if len(m.PositiveCounts) > 0 { + for iNdEx := len(m.PositiveCounts) - 1; iNdEx >= 0; iNdEx-- { + f1 := math.Float64bits(float64(m.PositiveCounts[iNdEx])) + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(f1)) + } + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PositiveCounts)*8)) + i-- + dAtA[i] = 0x6a + } + if len(m.PositiveDeltas) > 0 { + var pksize3 int + for _, num := range m.PositiveDeltas { + pksize3 += protohelpers.SizeOfZigzag(uint64(num)) + } + i -= pksize3 + j2 := i + for _, num := range m.PositiveDeltas { + x4 := (uint64(num) << 1) ^ uint64((num >> 63)) + for x4 >= 1<<7 { + dAtA[j2] = uint8(uint64(x4)&0x7f | 0x80) + j2++ + x4 >>= 7 + } + dAtA[j2] = uint8(x4) + j2++ + } + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize3)) + i-- + dAtA[i] = 0x62 + } + if len(m.PositiveSpans) > 0 { + for iNdEx := len(m.PositiveSpans) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.PositiveSpans[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x5a + } + } + if len(m.NegativeCounts) > 0 { + for iNdEx := len(m.NegativeCounts) - 1; iNdEx >= 0; iNdEx-- { + f5 := math.Float64bits(float64(m.NegativeCounts[iNdEx])) + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(f5)) + } + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.NegativeCounts)*8)) + i-- + dAtA[i] = 0x52 + } + if len(m.NegativeDeltas) > 0 { + var pksize7 int + for _, num := range m.NegativeDeltas { + pksize7 += protohelpers.SizeOfZigzag(uint64(num)) + } + i -= pksize7 + j6 := i + for _, num := range m.NegativeDeltas { + x8 := (uint64(num) << 1) ^ uint64((num >> 63)) + for x8 >= 1<<7 { + dAtA[j6] = uint8(uint64(x8)&0x7f | 0x80) + j6++ + x8 >>= 7 + } + dAtA[j6] = uint8(x8) + j6++ + } + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize7)) + i-- + dAtA[i] = 0x4a + } + if len(m.NegativeSpans) > 0 { + for iNdEx := len(m.NegativeSpans) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.NegativeSpans[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } + } + if m.ZeroThreshold != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.ZeroThreshold)))) + i-- + dAtA[i] = 0x29 + } + if m.Schema != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(m.Schema)<<1)^uint32((m.Schema>>31)))) + i-- + dAtA[i] = 0x20 + } + if m.Sum != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Sum)))) + i-- + dAtA[i] = 0x19 + } + return len(dAtA) - i, nil +} + +func (m *Histogram_CountInt) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Histogram_CountInt) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.CountInt)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} +func (m *Histogram_CountFloat) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Histogram_CountFloat) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.CountFloat)))) + i-- + dAtA[i] = 0x11 + return len(dAtA) - i, nil +} +func (m *Histogram_ZeroCountInt) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Histogram_ZeroCountInt) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ZeroCountInt)) + i-- + dAtA[i] = 0x30 + return len(dAtA) - i, nil +} +func (m *Histogram_ZeroCountFloat) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Histogram_ZeroCountFloat) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.ZeroCountFloat)))) + i-- + dAtA[i] = 0x39 + return len(dAtA) - i, nil +} +func (m *BucketSpan) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BucketSpan) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *BucketSpan) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.Length != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Length)) + i-- + dAtA[i] = 0x10 + } + if m.Offset != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64((uint32(m.Offset)<<1)^uint32((m.Offset>>31)))) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TimeSeries) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TimeSeries) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *TimeSeries) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Histograms) > 0 { + for iNdEx := len(m.Histograms) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Histograms[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Exemplars) > 0 { + for iNdEx := len(m.Exemplars) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Exemplars[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Samples) > 0 { + for iNdEx := len(m.Samples) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Samples[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Labels) > 0 { + for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.Labels[iNdEx]).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Labels[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *LabelMatcher) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LabelMatcher) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LabelMatcher) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ReadHints) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ReadHints) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ReadHints) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.RangeMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RangeMs)) + i-- + dAtA[i] = 0x38 + } + if m.By { + i-- + if m.By { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if len(m.Grouping) > 0 { + for iNdEx := len(m.Grouping) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Grouping[iNdEx]) + copy(dAtA[i:], m.Grouping[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Grouping[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if m.EndMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.EndMs)) + i-- + dAtA[i] = 0x20 + } + if m.StartMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StartMs)) + i-- + dAtA[i] = 0x18 + } + if len(m.Func) > 0 { + i -= len(m.Func) + copy(dAtA[i:], m.Func) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Func))) + i-- + dAtA[i] = 0x12 + } + if m.StepMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StepMs)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Chunk) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Chunk) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Chunk) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x22 + } + if m.Type != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x18 + } + if m.MaxTimeMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MaxTimeMs)) + i-- + dAtA[i] = 0x10 + } + if m.MinTimeMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MinTimeMs)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ChunkedSeries) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ChunkedSeries) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ChunkedSeries) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Chunks) > 0 { + for iNdEx := len(m.Chunks) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Chunks[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Labels) > 0 { + for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.Labels[iNdEx]).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Labels[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +var vtprotoPool_MetricMetadata = sync.Pool{ + New: func() interface{} { + return &MetricMetadata{} + }, +} + +func (m *MetricMetadata) ResetVT() { + if m != nil { + m.Reset() + } +} +func (m *MetricMetadata) ReturnToVTPool() { + if m != nil { + m.ResetVT() + vtprotoPool_MetricMetadata.Put(m) + } +} +func MetricMetadataFromVTPool() *MetricMetadata { + return vtprotoPool_MetricMetadata.Get().(*MetricMetadata) +} + +var vtprotoPool_Sample = sync.Pool{ + New: func() interface{} { + return &Sample{} + }, +} + +func (m *Sample) ResetVT() { + if m != nil { + m.Reset() + } +} +func (m *Sample) ReturnToVTPool() { + if m != nil { + m.ResetVT() + vtprotoPool_Sample.Put(m) + } +} +func SampleFromVTPool() *Sample { + return vtprotoPool_Sample.Get().(*Sample) +} + +var vtprotoPool_Exemplar = sync.Pool{ + New: func() interface{} { + return &Exemplar{} + }, +} + +func (m *Exemplar) ResetVT() { + if m != nil { + for _, mm := range m.Labels { + mm.ResetVT() + } + f0 := m.Labels[:0] + m.Reset() + m.Labels = f0 + } +} +func (m *Exemplar) ReturnToVTPool() { + if m != nil { + m.ResetVT() + vtprotoPool_Exemplar.Put(m) + } +} +func ExemplarFromVTPool() *Exemplar { + return vtprotoPool_Exemplar.Get().(*Exemplar) +} + +var vtprotoPool_Histogram = sync.Pool{ + New: func() interface{} { + return &Histogram{} + }, +} + +func (m *Histogram) ResetVT() { + if m != nil { + for _, mm := range m.NegativeSpans { + mm.ResetVT() + } + f0 := m.NegativeSpans[:0] + f1 := m.NegativeDeltas[:0] + f2 := m.NegativeCounts[:0] + for _, mm := range m.PositiveSpans { + mm.ResetVT() + } + f3 := m.PositiveSpans[:0] + f4 := m.PositiveDeltas[:0] + f5 := m.PositiveCounts[:0] + m.Reset() + m.NegativeSpans = f0 + m.NegativeDeltas = f1 + m.NegativeCounts = f2 + m.PositiveSpans = f3 + m.PositiveDeltas = f4 + m.PositiveCounts = f5 + } +} +func (m *Histogram) ReturnToVTPool() { + if m != nil { + m.ResetVT() + vtprotoPool_Histogram.Put(m) + } +} +func HistogramFromVTPool() *Histogram { + return vtprotoPool_Histogram.Get().(*Histogram) +} + +var vtprotoPool_BucketSpan = sync.Pool{ + New: func() interface{} { + return &BucketSpan{} + }, +} + +func (m *BucketSpan) ResetVT() { + if m != nil { + m.Reset() + } +} +func (m *BucketSpan) ReturnToVTPool() { + if m != nil { + m.ResetVT() + vtprotoPool_BucketSpan.Put(m) + } +} +func BucketSpanFromVTPool() *BucketSpan { + return vtprotoPool_BucketSpan.Get().(*BucketSpan) +} + +var vtprotoPool_TimeSeries = sync.Pool{ + New: func() interface{} { + return &TimeSeries{} + }, +} + +func (m *TimeSeries) ResetVT() { + if m != nil { + for _, mm := range m.Labels { + mm.ResetVT() + } + f0 := m.Labels[:0] + for _, mm := range m.Samples { + mm.ResetVT() + } + f1 := m.Samples[:0] + for _, mm := range m.Exemplars { + mm.ResetVT() + } + f2 := m.Exemplars[:0] + for _, mm := range m.Histograms { + mm.ResetVT() + } + f3 := m.Histograms[:0] + m.Reset() + m.Labels = f0 + m.Samples = f1 + m.Exemplars = f2 + m.Histograms = f3 + } +} +func (m *TimeSeries) ReturnToVTPool() { + if m != nil { + m.ResetVT() + vtprotoPool_TimeSeries.Put(m) + } +} +func TimeSeriesFromVTPool() *TimeSeries { + return vtprotoPool_TimeSeries.Get().(*TimeSeries) +} +func (m *MetricMetadata) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Type)) + } + l = len(m.MetricFamilyName) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Help) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Unit) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *Sample) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != 0 { + n += 9 + } + if m.Timestamp != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Timestamp)) + } + return n +} + +func (m *Exemplar) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Labels) > 0 { + for _, e := range m.Labels { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.Value != 0 { + n += 9 + } + if m.Timestamp != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Timestamp)) + } + return n +} + +func (m *Histogram) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Count.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + if m.Sum != 0 { + n += 9 + } + if m.Schema != 0 { + n += 1 + protohelpers.SizeOfZigzag(uint64(m.Schema)) + } + if m.ZeroThreshold != 0 { + n += 9 + } + if vtmsg, ok := m.ZeroCount.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + if len(m.NegativeSpans) > 0 { + for _, e := range m.NegativeSpans { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.NegativeDeltas) > 0 { + l = 0 + for _, e := range m.NegativeDeltas { + l += protohelpers.SizeOfZigzag(uint64(e)) + } + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l + } + if len(m.NegativeCounts) > 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(len(m.NegativeCounts)*8)) + len(m.NegativeCounts)*8 + } + if len(m.PositiveSpans) > 0 { + for _, e := range m.PositiveSpans { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.PositiveDeltas) > 0 { + l = 0 + for _, e := range m.PositiveDeltas { + l += protohelpers.SizeOfZigzag(uint64(e)) + } + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l + } + if len(m.PositiveCounts) > 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(len(m.PositiveCounts)*8)) + len(m.PositiveCounts)*8 + } + if m.ResetHint != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ResetHint)) + } + if m.Timestamp != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Timestamp)) + } + return n +} + +func (m *Histogram_CountInt) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + protohelpers.SizeOfVarint(uint64(m.CountInt)) + return n +} +func (m *Histogram_CountFloat) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 9 + return n +} +func (m *Histogram_ZeroCountInt) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + protohelpers.SizeOfVarint(uint64(m.ZeroCountInt)) + return n +} +func (m *Histogram_ZeroCountFloat) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 9 + return n +} +func (m *BucketSpan) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Offset != 0 { + n += 1 + protohelpers.SizeOfZigzag(uint64(m.Offset)) + } + if m.Length != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Length)) + } + return n +} + +func (m *TimeSeries) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Labels) > 0 { + for _, e := range m.Labels { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.Samples) > 0 { + for _, e := range m.Samples { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.Exemplars) > 0 { + for _, e := range m.Exemplars { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.Histograms) > 0 { + for _, e := range m.Histograms { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *LabelMatcher) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Type)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *ReadHints) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StepMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StepMs)) + } + l = len(m.Func) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.StartMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StartMs)) + } + if m.EndMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.EndMs)) + } + if len(m.Grouping) > 0 { + for _, s := range m.Grouping { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.By { + n += 2 + } + if m.RangeMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.RangeMs)) + } + return n +} + +func (m *Chunk) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MinTimeMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MinTimeMs)) + } + if m.MaxTimeMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MaxTimeMs)) + } + if m.Type != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Type)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *ChunkedSeries) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Labels) > 0 { + for _, e := range m.Labels { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.Chunks) > 0 { + for _, e := range m.Chunks { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *MetricMetadata) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MetricMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MetricMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= MetricMetadata_MetricType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MetricFamilyName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MetricFamilyName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Help", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Help = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Unit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Unit = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Sample) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Sample: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Sample: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Value = float64(math.Float64frombits(v)) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Exemplar) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Exemplar: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Exemplar: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if len(m.Labels) == cap(m.Labels) { + m.Labels = append(m.Labels, &labelpb.Label{}) + } else { + m.Labels = m.Labels[:len(m.Labels)+1] + if m.Labels[len(m.Labels)-1] == nil { + m.Labels[len(m.Labels)-1] = &labelpb.Label{} + } + } + if unmarshal, ok := interface{}(m.Labels[len(m.Labels)-1]).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Labels[len(m.Labels)-1]); err != nil { + return err + } + } + iNdEx = postIndex + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Value = float64(math.Float64frombits(v)) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Histogram) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Histogram: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Histogram: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CountInt", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Count = &Histogram_CountInt{CountInt: v} + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field CountFloat", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Count = &Histogram_CountFloat{CountFloat: float64(math.Float64frombits(v))} + case 3: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Sum", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Sum = float64(math.Float64frombits(v)) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = int32((uint32(v) >> 1) ^ uint32(((v&1)<<31)>>31)) + m.Schema = v + case 5: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field ZeroThreshold", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.ZeroThreshold = float64(math.Float64frombits(v)) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ZeroCountInt", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ZeroCount = &Histogram_ZeroCountInt{ZeroCountInt: v} + case 7: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field ZeroCountFloat", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.ZeroCount = &Histogram_ZeroCountFloat{ZeroCountFloat: float64(math.Float64frombits(v))} + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NegativeSpans", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if len(m.NegativeSpans) == cap(m.NegativeSpans) { + m.NegativeSpans = append(m.NegativeSpans, &BucketSpan{}) + } else { + m.NegativeSpans = m.NegativeSpans[:len(m.NegativeSpans)+1] + if m.NegativeSpans[len(m.NegativeSpans)-1] == nil { + m.NegativeSpans[len(m.NegativeSpans)-1] = &BucketSpan{} + } + } + if err := m.NegativeSpans[len(m.NegativeSpans)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.NegativeDeltas = append(m.NegativeDeltas, int64(v)) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.NegativeDeltas) == 0 && cap(m.NegativeDeltas) < elementCount { + m.NegativeDeltas = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.NegativeDeltas = append(m.NegativeDeltas, int64(v)) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field NegativeDeltas", wireType) + } + case 10: + if wireType == 1 { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + v2 := float64(math.Float64frombits(v)) + m.NegativeCounts = append(m.NegativeCounts, v2) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + elementCount = packedLen / 8 + if elementCount != 0 && len(m.NegativeCounts) == 0 && cap(m.NegativeCounts) < elementCount { + m.NegativeCounts = make([]float64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + v2 := float64(math.Float64frombits(v)) + m.NegativeCounts = append(m.NegativeCounts, v2) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field NegativeCounts", wireType) + } + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PositiveSpans", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if len(m.PositiveSpans) == cap(m.PositiveSpans) { + m.PositiveSpans = append(m.PositiveSpans, &BucketSpan{}) + } else { + m.PositiveSpans = m.PositiveSpans[:len(m.PositiveSpans)+1] + if m.PositiveSpans[len(m.PositiveSpans)-1] == nil { + m.PositiveSpans[len(m.PositiveSpans)-1] = &BucketSpan{} + } + } + if err := m.PositiveSpans[len(m.PositiveSpans)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.PositiveDeltas = append(m.PositiveDeltas, int64(v)) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.PositiveDeltas) == 0 && cap(m.PositiveDeltas) < elementCount { + m.PositiveDeltas = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.PositiveDeltas = append(m.PositiveDeltas, int64(v)) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field PositiveDeltas", wireType) + } + case 13: + if wireType == 1 { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + v2 := float64(math.Float64frombits(v)) + m.PositiveCounts = append(m.PositiveCounts, v2) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + elementCount = packedLen / 8 + if elementCount != 0 && len(m.PositiveCounts) == 0 && cap(m.PositiveCounts) < elementCount { + m.PositiveCounts = make([]float64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + v2 := float64(math.Float64frombits(v)) + m.PositiveCounts = append(m.PositiveCounts, v2) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field PositiveCounts", wireType) + } + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ResetHint", wireType) + } + m.ResetHint = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ResetHint |= Histogram_ResetHint(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BucketSpan) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BucketSpan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BucketSpan: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = int32((uint32(v) >> 1) ^ uint32(((v&1)<<31)>>31)) + m.Offset = v + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Length", wireType) + } + m.Length = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Length |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TimeSeries) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TimeSeries: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TimeSeries: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if len(m.Labels) == cap(m.Labels) { + m.Labels = append(m.Labels, &labelpb.Label{}) + } else { + m.Labels = m.Labels[:len(m.Labels)+1] + if m.Labels[len(m.Labels)-1] == nil { + m.Labels[len(m.Labels)-1] = &labelpb.Label{} + } + } + if unmarshal, ok := interface{}(m.Labels[len(m.Labels)-1]).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Labels[len(m.Labels)-1]); err != nil { + return err + } + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Samples", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if len(m.Samples) == cap(m.Samples) { + m.Samples = append(m.Samples, &Sample{}) + } else { + m.Samples = m.Samples[:len(m.Samples)+1] + if m.Samples[len(m.Samples)-1] == nil { + m.Samples[len(m.Samples)-1] = &Sample{} + } + } + if err := m.Samples[len(m.Samples)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Exemplars", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if len(m.Exemplars) == cap(m.Exemplars) { + m.Exemplars = append(m.Exemplars, &Exemplar{}) + } else { + m.Exemplars = m.Exemplars[:len(m.Exemplars)+1] + if m.Exemplars[len(m.Exemplars)-1] == nil { + m.Exemplars[len(m.Exemplars)-1] = &Exemplar{} + } + } + if err := m.Exemplars[len(m.Exemplars)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Histograms", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if len(m.Histograms) == cap(m.Histograms) { + m.Histograms = append(m.Histograms, &Histogram{}) + } else { + m.Histograms = m.Histograms[:len(m.Histograms)+1] + if m.Histograms[len(m.Histograms)-1] == nil { + m.Histograms[len(m.Histograms)-1] = &Histogram{} + } + } + if err := m.Histograms[len(m.Histograms)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LabelMatcher) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LabelMatcher: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LabelMatcher: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= LabelMatcher_Type(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unique.Make(unsafe.String(&dAtA[iNdEx], intStringLen)).Value() + } + m.Name = stringValue + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unique.Make(unsafe.String(&dAtA[iNdEx], intStringLen)).Value() + } + m.Value = stringValue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ReadHints) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ReadHints: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ReadHints: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StepMs", wireType) + } + m.StepMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StepMs |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Func", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Func = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartMs", wireType) + } + m.StartMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartMs |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EndMs", wireType) + } + m.EndMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EndMs |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grouping", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Grouping = append(m.Grouping, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field By", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.By = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RangeMs", wireType) + } + m.RangeMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RangeMs |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Chunk) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Chunk: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Chunk: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinTimeMs", wireType) + } + m.MinTimeMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinTimeMs |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxTimeMs", wireType) + } + m.MaxTimeMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxTimeMs |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= Chunk_Encoding(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ChunkedSeries) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ChunkedSeries: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChunkedSeries: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Labels = append(m.Labels, &labelpb.Label{}) + if unmarshal, ok := interface{}(m.Labels[len(m.Labels)-1]).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Labels[len(m.Labels)-1]); err != nil { + return err + } + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Chunks = append(m.Chunks, &Chunk{}) + if err := m.Chunks[len(m.Chunks)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pkg/store/storepb/query_hints.go b/pkg/store/storepb/query_hints.go index 956481a584a..479441d75ba 100644 --- a/pkg/store/storepb/query_hints.go +++ b/pkg/store/storepb/query_hints.go @@ -8,7 +8,7 @@ import ( "strings" ) -func (m *QueryHints) toPromQL(labelMatchers []LabelMatcher) string { +func (m *QueryHints) toPromQL(labelMatchers []*LabelMatcher) string { grouping := m.Grouping.toPromQL() matchers := MatchersToString(labelMatchers...) queryRange := m.Range.toPromQL() diff --git a/pkg/store/storepb/rpc.pb.go b/pkg/store/storepb/rpc.pb.go index 9d39f27e14a..85e148917bf 100644 --- a/pkg/store/storepb/rpc.pb.go +++ b/pkg/store/storepb/rpc.pb.go @@ -1,34 +1,33 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.20.1 // source: store/storepb/rpc.proto package storepb import ( - context "context" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - types "github.com/gogo/protobuf/types" + reflect "reflect" + sync "sync" + + _ "github.com/planetscale/vtprotobuf/vtproto" + _ "github.com/srikrsna/protoc-gen-gotag/tagger" prompb "github.com/thanos-io/thanos/pkg/store/storepb/prompb" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" + _ "github.com/thanos-io/thanos/pkg/vtproto/gen/vtpoolext" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type Aggr int32 @@ -41,113 +40,160 @@ const ( Aggr_COUNTER Aggr = 5 ) -var Aggr_name = map[int32]string{ - 0: "RAW", - 1: "COUNT", - 2: "SUM", - 3: "MIN", - 4: "MAX", - 5: "COUNTER", -} +// Enum value maps for Aggr. +var ( + Aggr_name = map[int32]string{ + 0: "RAW", + 1: "COUNT", + 2: "SUM", + 3: "MIN", + 4: "MAX", + 5: "COUNTER", + } + Aggr_value = map[string]int32{ + "RAW": 0, + "COUNT": 1, + "SUM": 2, + "MIN": 3, + "MAX": 4, + "COUNTER": 5, + } +) -var Aggr_value = map[string]int32{ - "RAW": 0, - "COUNT": 1, - "SUM": 2, - "MIN": 3, - "MAX": 4, - "COUNTER": 5, +func (x Aggr) Enum() *Aggr { + p := new(Aggr) + *p = x + return p } func (x Aggr) String() string { - return proto.EnumName(Aggr_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Aggr) Descriptor() protoreflect.EnumDescriptor { + return file_store_storepb_rpc_proto_enumTypes[0].Descriptor() +} + +func (Aggr) Type() protoreflect.EnumType { + return &file_store_storepb_rpc_proto_enumTypes[0] +} + +func (x Aggr) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } +// Deprecated: Use Aggr.Descriptor instead. func (Aggr) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{0} + return file_store_storepb_rpc_proto_rawDescGZIP(), []int{0} } type WriteResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *WriteResponse) Reset() { *m = WriteResponse{} } -func (m *WriteResponse) String() string { return proto.CompactTextString(m) } -func (*WriteResponse) ProtoMessage() {} -func (*WriteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{0} -} -func (m *WriteResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WriteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WriteResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *WriteResponse) Reset() { + *x = WriteResponse{} + mi := &file_store_storepb_rpc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WriteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteResponse) ProtoMessage() {} + +func (x *WriteResponse) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_rpc_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *WriteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteResponse.Merge(m, src) -} -func (m *WriteResponse) XXX_Size() int { - return m.Size() + +// Deprecated: Use WriteResponse.ProtoReflect.Descriptor instead. +func (*WriteResponse) Descriptor() ([]byte, []int) { + return file_store_storepb_rpc_proto_rawDescGZIP(), []int{0} } -func (m *WriteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_WriteResponse.DiscardUnknown(m) + +type WriteRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timeseries []*prompb.TimeSeries `protobuf:"bytes,1,rep,name=timeseries,proto3" json:"timeseries"` + Tenant string `protobuf:"bytes,2,opt,name=tenant,proto3" json:"tenant,omitempty"` + Replica int64 `protobuf:"varint,3,opt,name=replica,proto3" json:"replica,omitempty"` } -var xxx_messageInfo_WriteResponse proto.InternalMessageInfo +func (x *WriteRequest) Reset() { + *x = WriteRequest{} + mi := &file_store_storepb_rpc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -type WriteRequest struct { - Timeseries []prompb.TimeSeries `protobuf:"bytes,1,rep,name=timeseries,proto3" json:"timeseries"` - Tenant string `protobuf:"bytes,2,opt,name=tenant,proto3" json:"tenant,omitempty"` - Replica int64 `protobuf:"varint,3,opt,name=replica,proto3" json:"replica,omitempty"` +func (x *WriteRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *WriteRequest) Reset() { *m = WriteRequest{} } -func (m *WriteRequest) String() string { return proto.CompactTextString(m) } -func (*WriteRequest) ProtoMessage() {} -func (*WriteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{1} -} -func (m *WriteRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WriteRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (*WriteRequest) ProtoMessage() {} + +func (x *WriteRequest) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_rpc_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *WriteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteRequest.Merge(m, src) + +// Deprecated: Use WriteRequest.ProtoReflect.Descriptor instead. +func (*WriteRequest) Descriptor() ([]byte, []int) { + return file_store_storepb_rpc_proto_rawDescGZIP(), []int{1} } -func (m *WriteRequest) XXX_Size() int { - return m.Size() + +func (x *WriteRequest) GetTimeseries() []*prompb.TimeSeries { + if x != nil { + return x.Timeseries + } + return nil } -func (m *WriteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WriteRequest.DiscardUnknown(m) + +func (x *WriteRequest) GetTenant() string { + if x != nil { + return x.Tenant + } + return "" } -var xxx_messageInfo_WriteRequest proto.InternalMessageInfo +func (x *WriteRequest) GetReplica() int64 { + if x != nil { + return x.Replica + } + return 0 +} type SeriesRequest struct { - MinTime int64 `protobuf:"varint,1,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` - MaxTime int64 `protobuf:"varint,2,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` - Matchers []LabelMatcher `protobuf:"bytes,3,rep,name=matchers,proto3" json:"matchers"` - MaxResolutionWindow int64 `protobuf:"varint,4,opt,name=max_resolution_window,json=maxResolutionWindow,proto3" json:"max_resolution_window,omitempty"` - Aggregates []Aggr `protobuf:"varint,5,rep,packed,name=aggregates,proto3,enum=thanos.Aggr" json:"aggregates,omitempty"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MinTime int64 `protobuf:"varint,1,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` + MaxTime int64 `protobuf:"varint,2,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` + Matchers []*LabelMatcher `protobuf:"bytes,3,rep,name=matchers,proto3" json:"matchers"` + MaxResolutionWindow int64 `protobuf:"varint,4,opt,name=max_resolution_window,json=maxResolutionWindow,proto3" json:"max_resolution_window,omitempty"` + Aggregates []Aggr `protobuf:"varint,5,rep,packed,name=aggregates,proto3,enum=thanos.Aggr" json:"aggregates,omitempty"` // Deprecated. Use partial_response_strategy instead. PartialResponseDisabled bool `protobuf:"varint,6,opt,name=partial_response_disabled,json=partialResponseDisabled,proto3" json:"partial_response_disabled,omitempty"` // TODO(bwplotka): Move Thanos components to use strategy instead. Including QueryAPI. @@ -157,7 +203,7 @@ type SeriesRequest struct { // hints is an opaque data structure that can be used to carry additional information. // The content of this field and whether it's supported depends on the // implementation of a specific store. - Hints *types.Any `protobuf:"bytes,9,opt,name=hints,proto3" json:"hints,omitempty"` + Hints *anypb.Any `protobuf:"bytes,9,opt,name=hints,proto3" json:"hints,omitempty"` // Query step size in milliseconds. // Deprecated: Use query_hints instead. Step int64 `protobuf:"varint,10,opt,name=step,proto3" json:"step,omitempty"` @@ -184,44 +230,150 @@ type SeriesRequest struct { Limit int64 `protobuf:"varint,15,opt,name=limit,proto3" json:"limit,omitempty"` } -func (m *SeriesRequest) Reset() { *m = SeriesRequest{} } -func (m *SeriesRequest) String() string { return proto.CompactTextString(m) } -func (*SeriesRequest) ProtoMessage() {} -func (*SeriesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{2} -} -func (m *SeriesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SeriesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SeriesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *SeriesRequest) Reset() { + *x = SeriesRequest{} + mi := &file_store_storepb_rpc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SeriesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SeriesRequest) ProtoMessage() {} + +func (x *SeriesRequest) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_rpc_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SeriesRequest.ProtoReflect.Descriptor instead. +func (*SeriesRequest) Descriptor() ([]byte, []int) { + return file_store_storepb_rpc_proto_rawDescGZIP(), []int{2} +} + +func (x *SeriesRequest) GetMinTime() int64 { + if x != nil { + return x.MinTime + } + return 0 +} + +func (x *SeriesRequest) GetMaxTime() int64 { + if x != nil { + return x.MaxTime + } + return 0 +} + +func (x *SeriesRequest) GetMatchers() []*LabelMatcher { + if x != nil { + return x.Matchers + } + return nil +} + +func (x *SeriesRequest) GetMaxResolutionWindow() int64 { + if x != nil { + return x.MaxResolutionWindow + } + return 0 +} + +func (x *SeriesRequest) GetAggregates() []Aggr { + if x != nil { + return x.Aggregates + } + return nil +} + +func (x *SeriesRequest) GetPartialResponseDisabled() bool { + if x != nil { + return x.PartialResponseDisabled + } + return false +} + +func (x *SeriesRequest) GetPartialResponseStrategy() PartialResponseStrategy { + if x != nil { + return x.PartialResponseStrategy + } + return PartialResponseStrategy_WARN +} + +func (x *SeriesRequest) GetSkipChunks() bool { + if x != nil { + return x.SkipChunks + } + return false +} + +func (x *SeriesRequest) GetHints() *anypb.Any { + if x != nil { + return x.Hints } + return nil +} + +func (x *SeriesRequest) GetStep() int64 { + if x != nil { + return x.Step + } + return 0 } -func (m *SeriesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SeriesRequest.Merge(m, src) + +func (x *SeriesRequest) GetRange() int64 { + if x != nil { + return x.Range + } + return 0 +} + +func (x *SeriesRequest) GetQueryHints() *QueryHints { + if x != nil { + return x.QueryHints + } + return nil } -func (m *SeriesRequest) XXX_Size() int { - return m.Size() + +func (x *SeriesRequest) GetShardInfo() *ShardInfo { + if x != nil { + return x.ShardInfo + } + return nil } -func (m *SeriesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SeriesRequest.DiscardUnknown(m) + +func (x *SeriesRequest) GetWithoutReplicaLabels() []string { + if x != nil { + return x.WithoutReplicaLabels + } + return nil } -var xxx_messageInfo_SeriesRequest proto.InternalMessageInfo +func (x *SeriesRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} // QueryHints represents hints from PromQL that might help to // pre-aggregate or prepare series for faster use by clients. // Analogous to storage.SelectHints plus additional info. // As "hints" name suggests all of the items here are best effort. type QueryHints struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Query step size in milliseconds. StepMillis int64 `protobuf:"varint,1,opt,name=step_millis,json=stepMillis,proto3" json:"step_millis,omitempty"` // The surrounding function or aggregation. @@ -232,41 +384,70 @@ type QueryHints struct { Range *Range `protobuf:"bytes,5,opt,name=range,proto3" json:"range,omitempty"` } -func (m *QueryHints) Reset() { *m = QueryHints{} } -func (m *QueryHints) String() string { return proto.CompactTextString(m) } -func (*QueryHints) ProtoMessage() {} -func (*QueryHints) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{3} -} -func (m *QueryHints) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryHints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryHints.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *QueryHints) Reset() { + *x = QueryHints{} + mi := &file_store_storepb_rpc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QueryHints) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryHints) ProtoMessage() {} + +func (x *QueryHints) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_rpc_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryHints.ProtoReflect.Descriptor instead. +func (*QueryHints) Descriptor() ([]byte, []int) { + return file_store_storepb_rpc_proto_rawDescGZIP(), []int{3} } -func (m *QueryHints) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryHints.Merge(m, src) + +func (x *QueryHints) GetStepMillis() int64 { + if x != nil { + return x.StepMillis + } + return 0 } -func (m *QueryHints) XXX_Size() int { - return m.Size() + +func (x *QueryHints) GetFunc() *Func { + if x != nil { + return x.Func + } + return nil } -func (m *QueryHints) XXX_DiscardUnknown() { - xxx_messageInfo_QueryHints.DiscardUnknown(m) + +func (x *QueryHints) GetGrouping() *Grouping { + if x != nil { + return x.Grouping + } + return nil } -var xxx_messageInfo_QueryHints proto.InternalMessageInfo +func (x *QueryHints) GetRange() *Range { + if x != nil { + return x.Range + } + return nil +} // ShardInfo are the parameters used to shard series in Stores. type ShardInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // The index of the current shard. ShardIndex int64 `protobuf:"varint,1,opt,name=shard_index,json=shardIndex,proto3" json:"shard_index,omitempty"` // The total number of shards. @@ -277,215 +458,253 @@ type ShardInfo struct { Labels []string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty"` } -func (m *ShardInfo) Reset() { *m = ShardInfo{} } -func (m *ShardInfo) String() string { return proto.CompactTextString(m) } -func (*ShardInfo) ProtoMessage() {} -func (*ShardInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{4} -} -func (m *ShardInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ShardInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ShardInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ShardInfo) Reset() { + *x = ShardInfo{} + mi := &file_store_storepb_rpc_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ShardInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShardInfo) ProtoMessage() {} + +func (x *ShardInfo) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_rpc_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) +} + +// Deprecated: Use ShardInfo.ProtoReflect.Descriptor instead. +func (*ShardInfo) Descriptor() ([]byte, []int) { + return file_store_storepb_rpc_proto_rawDescGZIP(), []int{4} } -func (m *ShardInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ShardInfo.Merge(m, src) + +func (x *ShardInfo) GetShardIndex() int64 { + if x != nil { + return x.ShardIndex + } + return 0 } -func (m *ShardInfo) XXX_Size() int { - return m.Size() + +func (x *ShardInfo) GetTotalShards() int64 { + if x != nil { + return x.TotalShards + } + return 0 } -func (m *ShardInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ShardInfo.DiscardUnknown(m) + +func (x *ShardInfo) GetBy() bool { + if x != nil { + return x.By + } + return false } -var xxx_messageInfo_ShardInfo proto.InternalMessageInfo +func (x *ShardInfo) GetLabels() []string { + if x != nil { + return x.Labels + } + return nil +} type Func struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // The function or aggregation name Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } -func (m *Func) Reset() { *m = Func{} } -func (m *Func) String() string { return proto.CompactTextString(m) } -func (*Func) ProtoMessage() {} -func (*Func) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{5} -} -func (m *Func) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Func) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Func.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +func (x *Func) Reset() { + *x = Func{} + mi := &file_store_storepb_rpc_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Func) XXX_Merge(src proto.Message) { - xxx_messageInfo_Func.Merge(m, src) + +func (x *Func) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Func) XXX_Size() int { - return m.Size() + +func (*Func) ProtoMessage() {} + +func (x *Func) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_rpc_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *Func) XXX_DiscardUnknown() { - xxx_messageInfo_Func.DiscardUnknown(m) + +// Deprecated: Use Func.ProtoReflect.Descriptor instead. +func (*Func) Descriptor() ([]byte, []int) { + return file_store_storepb_rpc_proto_rawDescGZIP(), []int{5} } -var xxx_messageInfo_Func proto.InternalMessageInfo +func (x *Func) GetName() string { + if x != nil { + return x.Name + } + return "" +} type Grouping struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Indicate whether it is without or by. By bool `protobuf:"varint,1,opt,name=by,proto3" json:"by,omitempty"` // List of label names used in the grouping. Labels []string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty"` } -func (m *Grouping) Reset() { *m = Grouping{} } -func (m *Grouping) String() string { return proto.CompactTextString(m) } -func (*Grouping) ProtoMessage() {} -func (*Grouping) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{6} -} -func (m *Grouping) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Grouping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Grouping.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *Grouping) Reset() { + *x = Grouping{} + mi := &file_store_storepb_rpc_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Grouping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Grouping) ProtoMessage() {} + +func (x *Grouping) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_rpc_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *Grouping) XXX_Merge(src proto.Message) { - xxx_messageInfo_Grouping.Merge(m, src) -} -func (m *Grouping) XXX_Size() int { - return m.Size() + +// Deprecated: Use Grouping.ProtoReflect.Descriptor instead. +func (*Grouping) Descriptor() ([]byte, []int) { + return file_store_storepb_rpc_proto_rawDescGZIP(), []int{6} } -func (m *Grouping) XXX_DiscardUnknown() { - xxx_messageInfo_Grouping.DiscardUnknown(m) + +func (x *Grouping) GetBy() bool { + if x != nil { + return x.By + } + return false } -var xxx_messageInfo_Grouping proto.InternalMessageInfo +func (x *Grouping) GetLabels() []string { + if x != nil { + return x.Labels + } + return nil +} type Range struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Millis int64 `protobuf:"varint,1,opt,name=millis,proto3" json:"millis,omitempty"` } -func (m *Range) Reset() { *m = Range{} } -func (m *Range) String() string { return proto.CompactTextString(m) } -func (*Range) ProtoMessage() {} -func (*Range) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{7} -} -func (m *Range) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Range) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Range.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +func (x *Range) Reset() { + *x = Range{} + mi := &file_store_storepb_rpc_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Range) XXX_Merge(src proto.Message) { - xxx_messageInfo_Range.Merge(m, src) + +func (x *Range) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Range) XXX_Size() int { - return m.Size() + +func (*Range) ProtoMessage() {} + +func (x *Range) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_rpc_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *Range) XXX_DiscardUnknown() { - xxx_messageInfo_Range.DiscardUnknown(m) + +// Deprecated: Use Range.ProtoReflect.Descriptor instead. +func (*Range) Descriptor() ([]byte, []int) { + return file_store_storepb_rpc_proto_rawDescGZIP(), []int{7} } -var xxx_messageInfo_Range proto.InternalMessageInfo +func (x *Range) GetMillis() int64 { + if x != nil { + return x.Millis + } + return 0 +} type SeriesResponse struct { - // Types that are valid to be assigned to Result: + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Result: + // // *SeriesResponse_Series // *SeriesResponse_Warning // *SeriesResponse_Hints Result isSeriesResponse_Result `protobuf_oneof:"result"` } -func (m *SeriesResponse) Reset() { *m = SeriesResponse{} } -func (m *SeriesResponse) String() string { return proto.CompactTextString(m) } -func (*SeriesResponse) ProtoMessage() {} -func (*SeriesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{8} -} -func (m *SeriesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SeriesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SeriesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +func (x *SeriesResponse) Reset() { + *x = SeriesResponse{} + mi := &file_store_storepb_rpc_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *SeriesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SeriesResponse.Merge(m, src) -} -func (m *SeriesResponse) XXX_Size() int { - return m.Size() -} -func (m *SeriesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SeriesResponse.DiscardUnknown(m) + +func (x *SeriesResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_SeriesResponse proto.InternalMessageInfo +func (*SeriesResponse) ProtoMessage() {} -type isSeriesResponse_Result interface { - isSeriesResponse_Result() - MarshalTo([]byte) (int, error) - Size() int +func (x *SeriesResponse) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_rpc_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -type SeriesResponse_Series struct { - Series *Series `protobuf:"bytes,1,opt,name=series,proto3,oneof" json:"series,omitempty"` -} -type SeriesResponse_Warning struct { - Warning string `protobuf:"bytes,2,opt,name=warning,proto3,oneof" json:"warning,omitempty"` -} -type SeriesResponse_Hints struct { - Hints *types.Any `protobuf:"bytes,3,opt,name=hints,proto3,oneof" json:"hints,omitempty"` +// Deprecated: Use SeriesResponse.ProtoReflect.Descriptor instead. +func (*SeriesResponse) Descriptor() ([]byte, []int) { + return file_store_storepb_rpc_proto_rawDescGZIP(), []int{8} } -func (*SeriesResponse_Series) isSeriesResponse_Result() {} -func (*SeriesResponse_Warning) isSeriesResponse_Result() {} -func (*SeriesResponse_Hints) isSeriesResponse_Result() {} - func (m *SeriesResponse) GetResult() isSeriesResponse_Result { if m != nil { return m.Result @@ -493,37 +712,62 @@ func (m *SeriesResponse) GetResult() isSeriesResponse_Result { return nil } -func (m *SeriesResponse) GetSeries() *Series { - if x, ok := m.GetResult().(*SeriesResponse_Series); ok { +func (x *SeriesResponse) GetSeries() *Series { + if x, ok := x.GetResult().(*SeriesResponse_Series); ok { return x.Series } return nil } -func (m *SeriesResponse) GetWarning() string { - if x, ok := m.GetResult().(*SeriesResponse_Warning); ok { +func (x *SeriesResponse) GetWarning() string { + if x, ok := x.GetResult().(*SeriesResponse_Warning); ok { return x.Warning } return "" } -func (m *SeriesResponse) GetHints() *types.Any { - if x, ok := m.GetResult().(*SeriesResponse_Hints); ok { +func (x *SeriesResponse) GetHints() *anypb.Any { + if x, ok := x.GetResult().(*SeriesResponse_Hints); ok { return x.Hints } return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*SeriesResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*SeriesResponse_Series)(nil), - (*SeriesResponse_Warning)(nil), - (*SeriesResponse_Hints)(nil), - } +type isSeriesResponse_Result interface { + isSeriesResponse_Result() +} + +type SeriesResponse_Series struct { + // / series contains 1 response series. The series labels are sorted by name. + Series *Series `protobuf:"bytes,1,opt,name=series,proto3,oneof"` } +type SeriesResponse_Warning struct { + // / warning is considered an information piece in place of series for warning purposes. + // / It is used to warn store API user about suspicious cases or partial response (if enabled). + Warning string `protobuf:"bytes,2,opt,name=warning,proto3,oneof"` +} + +type SeriesResponse_Hints struct { + // / hints is an opaque data structure that can be used to carry additional information from + // / the store. The content of this field and whether it's supported depends on the + // / implementation of a specific store. It's also implementation specific if it's allowed that + // / multiple SeriesResponse frames contain hints for a single Series() request and how should they + // / be handled in such case (ie. merged vs keep the first/last one). + Hints *anypb.Any `protobuf:"bytes,3,opt,name=hints,proto3,oneof"` +} + +func (*SeriesResponse_Series) isSeriesResponse_Result() {} + +func (*SeriesResponse_Warning) isSeriesResponse_Result() {} + +func (*SeriesResponse_Hints) isSeriesResponse_Result() {} + type LabelNamesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + PartialResponseDisabled bool `protobuf:"varint,1,opt,name=partial_response_disabled,json=partialResponseDisabled,proto3" json:"partial_response_disabled,omitempty"` // TODO(bwplotka): Move Thanos components to use strategy instead. Including QueryAPI. PartialResponseStrategy PartialResponseStrategy `protobuf:"varint,2,opt,name=partial_response_strategy,json=partialResponseStrategy,proto3,enum=thanos.PartialResponseStrategy" json:"partial_response_strategy,omitempty"` @@ -532,4047 +776,642 @@ type LabelNamesRequest struct { // hints is an opaque data structure that can be used to carry additional information. // The content of this field and whether it's supported depends on the // implementation of a specific store. - Hints *types.Any `protobuf:"bytes,5,opt,name=hints,proto3" json:"hints,omitempty"` - Matchers []LabelMatcher `protobuf:"bytes,6,rep,name=matchers,proto3" json:"matchers"` + Hints *anypb.Any `protobuf:"bytes,5,opt,name=hints,proto3" json:"hints,omitempty"` + Matchers []*LabelMatcher `protobuf:"bytes,6,rep,name=matchers,proto3" json:"matchers"` // same as in series request. WithoutReplicaLabels []string `protobuf:"bytes,7,rep,name=without_replica_labels,json=withoutReplicaLabels,proto3" json:"without_replica_labels,omitempty"` // limit is used to limit the number of results returned Limit int64 `protobuf:"varint,8,opt,name=limit,proto3" json:"limit,omitempty"` } -func (m *LabelNamesRequest) Reset() { *m = LabelNamesRequest{} } -func (m *LabelNamesRequest) String() string { return proto.CompactTextString(m) } -func (*LabelNamesRequest) ProtoMessage() {} -func (*LabelNamesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{9} -} -func (m *LabelNamesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelNamesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelNamesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *LabelNamesRequest) Reset() { + *x = LabelNamesRequest{} + mi := &file_store_storepb_rpc_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LabelNamesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LabelNamesRequest) ProtoMessage() {} + +func (x *LabelNamesRequest) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_rpc_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *LabelNamesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelNamesRequest.Merge(m, src) + +// Deprecated: Use LabelNamesRequest.ProtoReflect.Descriptor instead. +func (*LabelNamesRequest) Descriptor() ([]byte, []int) { + return file_store_storepb_rpc_proto_rawDescGZIP(), []int{9} } -func (m *LabelNamesRequest) XXX_Size() int { - return m.Size() + +func (x *LabelNamesRequest) GetPartialResponseDisabled() bool { + if x != nil { + return x.PartialResponseDisabled + } + return false } -func (m *LabelNamesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_LabelNamesRequest.DiscardUnknown(m) + +func (x *LabelNamesRequest) GetPartialResponseStrategy() PartialResponseStrategy { + if x != nil { + return x.PartialResponseStrategy + } + return PartialResponseStrategy_WARN } -var xxx_messageInfo_LabelNamesRequest proto.InternalMessageInfo +func (x *LabelNamesRequest) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} -type LabelNamesResponse struct { - Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` - Warnings []string `protobuf:"bytes,2,rep,name=warnings,proto3" json:"warnings,omitempty"` - /// hints is an opaque data structure that can be used to carry additional information from - /// the store. The content of this field and whether it's supported depends on the - /// implementation of a specific store. - Hints *types.Any `protobuf:"bytes,3,opt,name=hints,proto3" json:"hints,omitempty"` +func (x *LabelNamesRequest) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 } -func (m *LabelNamesResponse) Reset() { *m = LabelNamesResponse{} } -func (m *LabelNamesResponse) String() string { return proto.CompactTextString(m) } -func (*LabelNamesResponse) ProtoMessage() {} -func (*LabelNamesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{10} -} -func (m *LabelNamesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelNamesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelNamesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *LabelNamesRequest) GetHints() *anypb.Any { + if x != nil { + return x.Hints } + return nil } -func (m *LabelNamesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelNamesResponse.Merge(m, src) + +func (x *LabelNamesRequest) GetMatchers() []*LabelMatcher { + if x != nil { + return x.Matchers + } + return nil } -func (m *LabelNamesResponse) XXX_Size() int { - return m.Size() + +func (x *LabelNamesRequest) GetWithoutReplicaLabels() []string { + if x != nil { + return x.WithoutReplicaLabels + } + return nil } -func (m *LabelNamesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LabelNamesResponse.DiscardUnknown(m) + +func (x *LabelNamesRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 } -var xxx_messageInfo_LabelNamesResponse proto.InternalMessageInfo +type LabelNamesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -type LabelValuesRequest struct { - Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"` - PartialResponseDisabled bool `protobuf:"varint,2,opt,name=partial_response_disabled,json=partialResponseDisabled,proto3" json:"partial_response_disabled,omitempty"` - // TODO(bwplotka): Move Thanos components to use strategy instead. Including QueryAPI. - PartialResponseStrategy PartialResponseStrategy `protobuf:"varint,3,opt,name=partial_response_strategy,json=partialResponseStrategy,proto3,enum=thanos.PartialResponseStrategy" json:"partial_response_strategy,omitempty"` - Start int64 `protobuf:"varint,4,opt,name=start,proto3" json:"start,omitempty"` - End int64 `protobuf:"varint,5,opt,name=end,proto3" json:"end,omitempty"` - // hints is an opaque data structure that can be used to carry additional information. - // The content of this field and whether it's supported depends on the - // implementation of a specific store. - Hints *types.Any `protobuf:"bytes,6,opt,name=hints,proto3" json:"hints,omitempty"` - Matchers []LabelMatcher `protobuf:"bytes,7,rep,name=matchers,proto3" json:"matchers"` - // same as in series request. - WithoutReplicaLabels []string `protobuf:"bytes,8,rep,name=without_replica_labels,json=withoutReplicaLabels,proto3" json:"without_replica_labels,omitempty"` - // limit is used to limit the number of results returned - Limit int64 `protobuf:"varint,9,opt,name=limit,proto3" json:"limit,omitempty"` -} - -func (m *LabelValuesRequest) Reset() { *m = LabelValuesRequest{} } -func (m *LabelValuesRequest) String() string { return proto.CompactTextString(m) } -func (*LabelValuesRequest) ProtoMessage() {} -func (*LabelValuesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{11} -} -func (m *LabelValuesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelValuesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelValuesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LabelValuesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelValuesRequest.Merge(m, src) -} -func (m *LabelValuesRequest) XXX_Size() int { - return m.Size() -} -func (m *LabelValuesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_LabelValuesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_LabelValuesRequest proto.InternalMessageInfo - -type LabelValuesResponse struct { - Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` + Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` Warnings []string `protobuf:"bytes,2,rep,name=warnings,proto3" json:"warnings,omitempty"` - /// hints is an opaque data structure that can be used to carry additional information from - /// the store. The content of this field and whether it's supported depends on the - /// implementation of a specific store. - Hints *types.Any `protobuf:"bytes,3,opt,name=hints,proto3" json:"hints,omitempty"` -} - -func (m *LabelValuesResponse) Reset() { *m = LabelValuesResponse{} } -func (m *LabelValuesResponse) String() string { return proto.CompactTextString(m) } -func (*LabelValuesResponse) ProtoMessage() {} -func (*LabelValuesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{12} -} -func (m *LabelValuesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelValuesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelValuesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LabelValuesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelValuesResponse.Merge(m, src) -} -func (m *LabelValuesResponse) XXX_Size() int { - return m.Size() -} -func (m *LabelValuesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LabelValuesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_LabelValuesResponse proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("thanos.Aggr", Aggr_name, Aggr_value) - proto.RegisterType((*WriteResponse)(nil), "thanos.WriteResponse") - proto.RegisterType((*WriteRequest)(nil), "thanos.WriteRequest") - proto.RegisterType((*SeriesRequest)(nil), "thanos.SeriesRequest") - proto.RegisterType((*QueryHints)(nil), "thanos.QueryHints") - proto.RegisterType((*ShardInfo)(nil), "thanos.ShardInfo") - proto.RegisterType((*Func)(nil), "thanos.Func") - proto.RegisterType((*Grouping)(nil), "thanos.Grouping") - proto.RegisterType((*Range)(nil), "thanos.Range") - proto.RegisterType((*SeriesResponse)(nil), "thanos.SeriesResponse") - proto.RegisterType((*LabelNamesRequest)(nil), "thanos.LabelNamesRequest") - proto.RegisterType((*LabelNamesResponse)(nil), "thanos.LabelNamesResponse") - proto.RegisterType((*LabelValuesRequest)(nil), "thanos.LabelValuesRequest") - proto.RegisterType((*LabelValuesResponse)(nil), "thanos.LabelValuesResponse") -} - -func init() { proto.RegisterFile("store/storepb/rpc.proto", fileDescriptor_a938d55a388af629) } - -var fileDescriptor_a938d55a388af629 = []byte{ - // 1149 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4b, 0x6f, 0x23, 0x45, - 0x10, 0xf6, 0x78, 0x3c, 0x7e, 0x94, 0x13, 0xaf, 0xb7, 0xd7, 0xc9, 0x4e, 0xbc, 0x92, 0x63, 0x8c, - 0x90, 0xac, 0x55, 0xe4, 0xac, 0xbc, 0x08, 0x09, 0xc4, 0x25, 0x09, 0x2c, 0x59, 0x89, 0x04, 0xe8, - 0xec, 0x12, 0x04, 0x87, 0x51, 0xdb, 0xee, 0x8c, 0x47, 0x3b, 0xaf, 0x4c, 0xf7, 0x90, 0xf8, 0x0c, - 0x67, 0xc4, 0x9d, 0xdb, 0xfe, 0x9a, 0xdc, 0xd8, 0x23, 0x27, 0x04, 0xc9, 0x1f, 0x41, 0xfd, 0x18, - 0x3f, 0x82, 0xf7, 0xa5, 0xe4, 0x62, 0x75, 0x7d, 0x5f, 0x75, 0x4d, 0x75, 0xf5, 0x57, 0xe5, 0x86, - 0xfb, 0x8c, 0x47, 0x09, 0xdd, 0x96, 0xbf, 0xf1, 0x60, 0x3b, 0x89, 0x87, 0xbd, 0x38, 0x89, 0x78, - 0x84, 0x8a, 0x7c, 0x4c, 0xc2, 0x88, 0x35, 0x37, 0x16, 0x1d, 0xf8, 0x24, 0xa6, 0x4c, 0xb9, 0x34, - 0x1b, 0x6e, 0xe4, 0x46, 0x72, 0xb9, 0x2d, 0x56, 0x1a, 0x6d, 0x2f, 0x6e, 0x88, 0x93, 0x28, 0xb8, - 0xb6, 0x6f, 0xc3, 0x8d, 0x22, 0xd7, 0xa7, 0xdb, 0xd2, 0x1a, 0xa4, 0x27, 0xdb, 0x24, 0x9c, 0x28, - 0xaa, 0x73, 0x07, 0x56, 0x8f, 0x13, 0x8f, 0x53, 0x4c, 0x59, 0x1c, 0x85, 0x8c, 0x76, 0x7e, 0x31, - 0x60, 0x45, 0x23, 0xa7, 0x29, 0x65, 0x1c, 0xed, 0x00, 0x70, 0x2f, 0xa0, 0x8c, 0x26, 0x1e, 0x65, - 0xb6, 0xd1, 0x36, 0xbb, 0xd5, 0xfe, 0x03, 0xb1, 0x3b, 0xa0, 0x7c, 0x4c, 0x53, 0xe6, 0x0c, 0xa3, - 0x78, 0xd2, 0x7b, 0xe6, 0x05, 0xf4, 0x48, 0xba, 0xec, 0x16, 0x2e, 0xfe, 0xde, 0xcc, 0xe1, 0xb9, - 0x4d, 0x68, 0x1d, 0x8a, 0x9c, 0x86, 0x24, 0xe4, 0x76, 0xbe, 0x6d, 0x74, 0x2b, 0x58, 0x5b, 0xc8, - 0x86, 0x52, 0x42, 0x63, 0xdf, 0x1b, 0x12, 0xdb, 0x6c, 0x1b, 0x5d, 0x13, 0x67, 0x66, 0xe7, 0xa5, - 0x05, 0xab, 0x2a, 0x5c, 0x96, 0xc6, 0x06, 0x94, 0x03, 0x2f, 0x74, 0x44, 0x54, 0xdb, 0x50, 0xce, - 0x81, 0x17, 0x8a, 0xcf, 0x4a, 0x8a, 0x9c, 0x2b, 0x2a, 0xaf, 0x29, 0x72, 0x2e, 0xa9, 0x4f, 0x04, - 0xc5, 0x87, 0x63, 0x9a, 0x30, 0xdb, 0x94, 0xa9, 0x37, 0x7a, 0xaa, 0xce, 0xbd, 0xaf, 0xc9, 0x80, - 0xfa, 0x07, 0x8a, 0xd4, 0x39, 0x4f, 0x7d, 0x51, 0x1f, 0xd6, 0x44, 0xc8, 0x84, 0xb2, 0xc8, 0x4f, - 0xb9, 0x17, 0x85, 0xce, 0x99, 0x17, 0x8e, 0xa2, 0x33, 0xbb, 0x20, 0xe3, 0xdf, 0x0b, 0xc8, 0x39, - 0x9e, 0x72, 0xc7, 0x92, 0x42, 0x5b, 0x00, 0xc4, 0x75, 0x13, 0xea, 0x12, 0x4e, 0x99, 0x6d, 0xb5, - 0xcd, 0x6e, 0xad, 0xbf, 0x92, 0x7d, 0x6d, 0xc7, 0x75, 0x13, 0x3c, 0xc7, 0xa3, 0xcf, 0x60, 0x23, - 0x26, 0x09, 0xf7, 0x88, 0x2f, 0xbe, 0x22, 0x6b, 0xef, 0x8c, 0x3c, 0x46, 0x06, 0x3e, 0x1d, 0xd9, - 0xc5, 0xb6, 0xd1, 0x2d, 0xe3, 0xfb, 0xda, 0x21, 0xbb, 0x9b, 0x2f, 0x34, 0x8d, 0x7e, 0x5a, 0xb2, - 0x97, 0xf1, 0x84, 0x70, 0xea, 0x4e, 0xec, 0x52, 0xdb, 0xe8, 0xd6, 0xfa, 0x9b, 0xd9, 0x87, 0xbf, - 0x5d, 0x8c, 0x71, 0xa4, 0xdd, 0xfe, 0x17, 0x3c, 0x23, 0xd0, 0x26, 0x54, 0xd9, 0x0b, 0x2f, 0x76, - 0x86, 0xe3, 0x34, 0x7c, 0xc1, 0xec, 0xb2, 0x4c, 0x05, 0x04, 0xb4, 0x27, 0x11, 0xf4, 0x10, 0xac, - 0xb1, 0x17, 0x72, 0x66, 0x57, 0xda, 0x86, 0x2c, 0xa8, 0x52, 0x57, 0x2f, 0x53, 0x57, 0x6f, 0x27, - 0x9c, 0x60, 0xe5, 0x82, 0x10, 0x14, 0x18, 0xa7, 0xb1, 0x0d, 0xb2, 0x6c, 0x72, 0x8d, 0x1a, 0x60, - 0x25, 0x24, 0x74, 0xa9, 0x5d, 0x95, 0xa0, 0x32, 0xd0, 0x63, 0xa8, 0x9e, 0xa6, 0x34, 0x99, 0x38, - 0x2a, 0xf6, 0x8a, 0x8c, 0x8d, 0xb2, 0x53, 0x7c, 0x27, 0xa8, 0x7d, 0xc1, 0x60, 0x38, 0x9d, 0xae, - 0xd1, 0x23, 0x00, 0x36, 0x26, 0xc9, 0xc8, 0xf1, 0xc2, 0x93, 0xc8, 0x5e, 0x95, 0x7b, 0xee, 0x66, - 0x7b, 0x8e, 0x04, 0xf3, 0x34, 0x3c, 0x89, 0x70, 0x85, 0x65, 0x4b, 0xf4, 0x31, 0xac, 0x9f, 0x79, - 0x7c, 0x1c, 0xa5, 0xdc, 0xd1, 0x5a, 0x73, 0x7c, 0x21, 0x04, 0x66, 0xd7, 0xda, 0x66, 0xb7, 0x82, - 0x1b, 0x9a, 0xc5, 0x8a, 0x94, 0x22, 0x61, 0x22, 0x65, 0xdf, 0x0b, 0x3c, 0x6e, 0xdf, 0x51, 0x29, - 0x4b, 0xa3, 0xf3, 0xd2, 0x00, 0x98, 0x25, 0x26, 0x0b, 0xc7, 0x69, 0xec, 0x04, 0x9e, 0xef, 0x7b, - 0x4c, 0x8b, 0x14, 0x04, 0x74, 0x20, 0x11, 0xd4, 0x86, 0xc2, 0x49, 0x1a, 0x0e, 0xa5, 0x46, 0xab, - 0x33, 0x69, 0x3c, 0x49, 0xc3, 0x21, 0x96, 0x0c, 0xda, 0x82, 0xb2, 0x9b, 0x44, 0x69, 0xec, 0x85, - 0xae, 0x54, 0x5a, 0xb5, 0x5f, 0xcf, 0xbc, 0xbe, 0xd2, 0x38, 0x9e, 0x7a, 0xa0, 0x0f, 0xb3, 0x42, - 0x5a, 0xd2, 0x75, 0x35, 0x73, 0xc5, 0x02, 0xd4, 0x75, 0xed, 0x9c, 0x41, 0x65, 0x5a, 0x08, 0x99, - 0xa2, 0xae, 0xd7, 0x88, 0x9e, 0x4f, 0x53, 0x54, 0xfc, 0x88, 0x9e, 0xa3, 0x0f, 0x60, 0x85, 0x47, - 0x9c, 0xf8, 0x8e, 0xc4, 0x98, 0x6e, 0xa7, 0xaa, 0xc4, 0x64, 0x18, 0x86, 0x6a, 0x90, 0x1f, 0x4c, - 0x64, 0xbf, 0x96, 0x71, 0x7e, 0x30, 0x11, 0xcd, 0xad, 0x2b, 0x58, 0x90, 0x15, 0xd4, 0x56, 0xa7, - 0x09, 0x05, 0x71, 0x32, 0x21, 0x81, 0x90, 0xe8, 0xa6, 0xad, 0x60, 0xb9, 0xee, 0xf4, 0xa1, 0x9c, - 0x9d, 0x47, 0xc7, 0x33, 0x96, 0xc4, 0x33, 0x17, 0xe2, 0x6d, 0x82, 0x25, 0x0f, 0x26, 0x1c, 0x16, - 0x4a, 0xac, 0xad, 0xce, 0x6f, 0x06, 0xd4, 0xb2, 0x99, 0xa1, 0x34, 0x8d, 0xba, 0x50, 0x9c, 0xce, - 0x2d, 0x51, 0xa2, 0xda, 0x54, 0x1b, 0x12, 0xdd, 0xcf, 0x61, 0xcd, 0xa3, 0x26, 0x94, 0xce, 0x48, - 0x12, 0x8a, 0xc2, 0xcb, 0x19, 0xb5, 0x9f, 0xc3, 0x19, 0x80, 0xb6, 0x32, 0xc1, 0x9b, 0xaf, 0x17, - 0xfc, 0x7e, 0x4e, 0x4b, 0x7e, 0xb7, 0x0c, 0xc5, 0x84, 0xb2, 0xd4, 0xe7, 0x9d, 0x5f, 0x4d, 0xb8, - 0x2b, 0x05, 0x74, 0x48, 0x82, 0xd9, 0x20, 0x7b, 0x63, 0xe3, 0x1b, 0x37, 0x68, 0xfc, 0xfc, 0x0d, - 0x1b, 0xbf, 0x01, 0x16, 0xe3, 0x24, 0xe1, 0x7a, 0x16, 0x2b, 0x03, 0xd5, 0xc1, 0xa4, 0xe1, 0x48, - 0xcf, 0x3d, 0xb1, 0x9c, 0xf5, 0xbf, 0xf5, 0xf6, 0xfe, 0x9f, 0x9f, 0xbf, 0xc5, 0xf7, 0x98, 0xbf, - 0xaf, 0x6f, 0xd3, 0xd2, 0xbb, 0xb4, 0x69, 0x79, 0xbe, 0x4d, 0x13, 0x40, 0xf3, 0xb7, 0xa0, 0xa5, - 0xd1, 0x00, 0x4b, 0x48, 0x51, 0xfd, 0xa3, 0x55, 0xb0, 0x32, 0x50, 0x13, 0xca, 0xfa, 0xd6, 0x85, - 0xf6, 0x05, 0x31, 0xb5, 0x67, 0xe7, 0x36, 0xdf, 0x7a, 0xee, 0xce, 0x1f, 0xa6, 0xfe, 0xe8, 0xf7, - 0xc4, 0x4f, 0x67, 0x77, 0x2f, 0x12, 0x14, 0xa8, 0x6e, 0x06, 0x65, 0xbc, 0x59, 0x11, 0xf9, 0x1b, - 0x28, 0xc2, 0xbc, 0x2d, 0x45, 0x14, 0x96, 0x28, 0xc2, 0x5a, 0xa2, 0x88, 0xe2, 0xfb, 0x29, 0xa2, - 0x74, 0x2b, 0x8a, 0x28, 0xbf, 0x8b, 0x22, 0x2a, 0xf3, 0x8a, 0x48, 0xe1, 0xde, 0xc2, 0xe5, 0x68, - 0x49, 0xac, 0x43, 0xf1, 0x67, 0x89, 0x68, 0x4d, 0x68, 0xeb, 0xb6, 0x44, 0xf1, 0x70, 0x17, 0x0a, - 0xe2, 0x19, 0x80, 0x4a, 0x60, 0xe2, 0x9d, 0xe3, 0x7a, 0x0e, 0x55, 0xc0, 0xda, 0xfb, 0xe6, 0xf9, - 0xe1, 0xb3, 0xba, 0x21, 0xb0, 0xa3, 0xe7, 0x07, 0xf5, 0xbc, 0x58, 0x1c, 0x3c, 0x3d, 0xac, 0x9b, - 0x72, 0xb1, 0xf3, 0x43, 0xbd, 0x80, 0xaa, 0x50, 0x92, 0x5e, 0x5f, 0xe2, 0xba, 0xd5, 0xff, 0xd3, - 0x00, 0xeb, 0x48, 0xbc, 0xf4, 0xd0, 0xa7, 0x50, 0x54, 0x53, 0x0c, 0xad, 0x2d, 0x4e, 0x35, 0x2d, - 0xb6, 0xe6, 0xfa, 0x75, 0x58, 0x1d, 0xf3, 0x91, 0x81, 0xf6, 0x00, 0x66, 0x1d, 0x81, 0x36, 0x16, - 0xea, 0x3f, 0x3f, 0xab, 0x9a, 0xcd, 0x65, 0x94, 0xae, 0xd6, 0x13, 0xa8, 0xce, 0x15, 0x11, 0x2d, - 0xba, 0x2e, 0xc8, 0xbe, 0xf9, 0x60, 0x29, 0xa7, 0xe2, 0xf4, 0x0f, 0xa1, 0x26, 0xdf, 0x9b, 0x42, - 0xcf, 0xea, 0x64, 0x9f, 0x43, 0x15, 0xd3, 0x20, 0xe2, 0x54, 0xe2, 0x68, 0xaa, 0x8f, 0xf9, 0x67, - 0x69, 0x73, 0xed, 0x1a, 0xaa, 0x9f, 0xaf, 0xb9, 0xdd, 0x8f, 0x2e, 0xfe, 0x6d, 0xe5, 0x2e, 0x2e, - 0x5b, 0xc6, 0xab, 0xcb, 0x96, 0xf1, 0xcf, 0x65, 0xcb, 0xf8, 0xfd, 0xaa, 0x95, 0x7b, 0x75, 0xd5, - 0xca, 0xfd, 0x75, 0xd5, 0xca, 0xfd, 0x58, 0xd2, 0xcf, 0xe4, 0x41, 0x51, 0xde, 0xd0, 0xe3, 0xff, - 0x02, 0x00, 0x00, 0xff, 0xff, 0x84, 0xe1, 0x09, 0x34, 0x90, 0x0b, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// StoreClient is the client API for Store service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type StoreClient interface { - /// Series streams each Series (Labels and chunk/downsampling chunk) for given label matchers and time range. - /// - /// Series should strictly stream full series after series, optionally split by time. This means that a single frame can contain - /// partition of the single series, but once a new series is started to be streamed it means that no more data will - /// be sent for previous one. - /// Series has to be sorted. - /// - /// There is no requirements on chunk sorting, however it is recommended to have chunk sorted by chunk min time. - /// This heavily optimizes the resource usage on Querier / Federated Queries. - /// - /// Chunks can span a range larger than the requested min and max time and it is up to the query engine to discard samples - /// which fall outside of the query range. - Series(ctx context.Context, in *SeriesRequest, opts ...grpc.CallOption) (Store_SeriesClient, error) - /// LabelNames returns all label names constrained by the given matchers. - LabelNames(ctx context.Context, in *LabelNamesRequest, opts ...grpc.CallOption) (*LabelNamesResponse, error) - /// LabelValues returns all label values for given label name. - LabelValues(ctx context.Context, in *LabelValuesRequest, opts ...grpc.CallOption) (*LabelValuesResponse, error) -} - -type storeClient struct { - cc *grpc.ClientConn -} - -func NewStoreClient(cc *grpc.ClientConn) StoreClient { - return &storeClient{cc} -} - -func (c *storeClient) Series(ctx context.Context, in *SeriesRequest, opts ...grpc.CallOption) (Store_SeriesClient, error) { - stream, err := c.cc.NewStream(ctx, &_Store_serviceDesc.Streams[0], "/thanos.Store/Series", opts...) - if err != nil { - return nil, err - } - x := &storeSeriesClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Store_SeriesClient interface { - Recv() (*SeriesResponse, error) - grpc.ClientStream -} - -type storeSeriesClient struct { - grpc.ClientStream -} - -func (x *storeSeriesClient) Recv() (*SeriesResponse, error) { - m := new(SeriesResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *storeClient) LabelNames(ctx context.Context, in *LabelNamesRequest, opts ...grpc.CallOption) (*LabelNamesResponse, error) { - out := new(LabelNamesResponse) - err := c.cc.Invoke(ctx, "/thanos.Store/LabelNames", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storeClient) LabelValues(ctx context.Context, in *LabelValuesRequest, opts ...grpc.CallOption) (*LabelValuesResponse, error) { - out := new(LabelValuesResponse) - err := c.cc.Invoke(ctx, "/thanos.Store/LabelValues", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// StoreServer is the server API for Store service. -type StoreServer interface { - /// Series streams each Series (Labels and chunk/downsampling chunk) for given label matchers and time range. - /// - /// Series should strictly stream full series after series, optionally split by time. This means that a single frame can contain - /// partition of the single series, but once a new series is started to be streamed it means that no more data will - /// be sent for previous one. - /// Series has to be sorted. - /// - /// There is no requirements on chunk sorting, however it is recommended to have chunk sorted by chunk min time. - /// This heavily optimizes the resource usage on Querier / Federated Queries. - /// - /// Chunks can span a range larger than the requested min and max time and it is up to the query engine to discard samples - /// which fall outside of the query range. - Series(*SeriesRequest, Store_SeriesServer) error - /// LabelNames returns all label names constrained by the given matchers. - LabelNames(context.Context, *LabelNamesRequest) (*LabelNamesResponse, error) - /// LabelValues returns all label values for given label name. - LabelValues(context.Context, *LabelValuesRequest) (*LabelValuesResponse, error) -} - -// UnimplementedStoreServer can be embedded to have forward compatible implementations. -type UnimplementedStoreServer struct { -} - -func (*UnimplementedStoreServer) Series(req *SeriesRequest, srv Store_SeriesServer) error { - return status.Errorf(codes.Unimplemented, "method Series not implemented") -} -func (*UnimplementedStoreServer) LabelNames(ctx context.Context, req *LabelNamesRequest) (*LabelNamesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LabelNames not implemented") -} -func (*UnimplementedStoreServer) LabelValues(ctx context.Context, req *LabelValuesRequest) (*LabelValuesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LabelValues not implemented") -} - -func RegisterStoreServer(s *grpc.Server, srv StoreServer) { - s.RegisterService(&_Store_serviceDesc, srv) -} - -func _Store_Series_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SeriesRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(StoreServer).Series(m, &storeSeriesServer{stream}) -} - -type Store_SeriesServer interface { - Send(*SeriesResponse) error - grpc.ServerStream -} - -type storeSeriesServer struct { - grpc.ServerStream -} - -func (x *storeSeriesServer) Send(m *SeriesResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _Store_LabelNames_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LabelNamesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreServer).LabelNames(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/thanos.Store/LabelNames", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreServer).LabelNames(ctx, req.(*LabelNamesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Store_LabelValues_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LabelValuesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreServer).LabelValues(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/thanos.Store/LabelValues", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreServer).LabelValues(ctx, req.(*LabelValuesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Store_serviceDesc = grpc.ServiceDesc{ - ServiceName: "thanos.Store", - HandlerType: (*StoreServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "LabelNames", - Handler: _Store_LabelNames_Handler, - }, - { - MethodName: "LabelValues", - Handler: _Store_LabelValues_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Series", - Handler: _Store_Series_Handler, - ServerStreams: true, - }, - }, - Metadata: "store/storepb/rpc.proto", -} - -// WriteableStoreClient is the client API for WriteableStore service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type WriteableStoreClient interface { - // WriteRequest allows you to write metrics to this store via remote write - RemoteWrite(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error) -} - -type writeableStoreClient struct { - cc *grpc.ClientConn -} - -func NewWriteableStoreClient(cc *grpc.ClientConn) WriteableStoreClient { - return &writeableStoreClient{cc} -} - -func (c *writeableStoreClient) RemoteWrite(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error) { - out := new(WriteResponse) - err := c.cc.Invoke(ctx, "/thanos.WriteableStore/RemoteWrite", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// WriteableStoreServer is the server API for WriteableStore service. -type WriteableStoreServer interface { - // WriteRequest allows you to write metrics to this store via remote write - RemoteWrite(context.Context, *WriteRequest) (*WriteResponse, error) -} - -// UnimplementedWriteableStoreServer can be embedded to have forward compatible implementations. -type UnimplementedWriteableStoreServer struct { -} - -func (*UnimplementedWriteableStoreServer) RemoteWrite(ctx context.Context, req *WriteRequest) (*WriteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoteWrite not implemented") -} - -func RegisterWriteableStoreServer(s *grpc.Server, srv WriteableStoreServer) { - s.RegisterService(&_WriteableStore_serviceDesc, srv) -} - -func _WriteableStore_RemoteWrite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(WriteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WriteableStoreServer).RemoteWrite(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/thanos.WriteableStore/RemoteWrite", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WriteableStoreServer).RemoteWrite(ctx, req.(*WriteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _WriteableStore_serviceDesc = grpc.ServiceDesc{ - ServiceName: "thanos.WriteableStore", - HandlerType: (*WriteableStoreServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "RemoteWrite", - Handler: _WriteableStore_RemoteWrite_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "store/storepb/rpc.proto", -} - -func (m *WriteResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WriteResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WriteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *WriteRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WriteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Replica != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Replica)) - i-- - dAtA[i] = 0x18 - } - if len(m.Tenant) > 0 { - i -= len(m.Tenant) - copy(dAtA[i:], m.Tenant) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Tenant))) - i-- - dAtA[i] = 0x12 - } - if len(m.Timeseries) > 0 { - for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Timeseries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *SeriesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SeriesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Limit != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Limit)) - i-- - dAtA[i] = 0x78 - } - if len(m.WithoutReplicaLabels) > 0 { - for iNdEx := len(m.WithoutReplicaLabels) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.WithoutReplicaLabels[iNdEx]) - copy(dAtA[i:], m.WithoutReplicaLabels[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.WithoutReplicaLabels[iNdEx]))) - i-- - dAtA[i] = 0x72 - } - } - if m.ShardInfo != nil { - { - size, err := m.ShardInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a - } - if m.QueryHints != nil { - { - size, err := m.QueryHints.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - } - if m.Range != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Range)) - i-- - dAtA[i] = 0x58 - } - if m.Step != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Step)) - i-- - dAtA[i] = 0x50 - } - if m.Hints != nil { - { - size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - if m.SkipChunks { - i-- - if m.SkipChunks { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - if m.PartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) - i-- - dAtA[i] = 0x38 - } - if m.PartialResponseDisabled { - i-- - if m.PartialResponseDisabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if len(m.Aggregates) > 0 { - dAtA5 := make([]byte, len(m.Aggregates)*10) - var j4 int - for _, num := range m.Aggregates { - for num >= 1<<7 { - dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j4++ - } - dAtA5[j4] = uint8(num) - j4++ - } - i -= j4 - copy(dAtA[i:], dAtA5[:j4]) - i = encodeVarintRpc(dAtA, i, uint64(j4)) - i-- - dAtA[i] = 0x2a - } - if m.MaxResolutionWindow != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MaxResolutionWindow)) - i-- - dAtA[i] = 0x20 - } - if len(m.Matchers) > 0 { - for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Matchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.MaxTime != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MaxTime)) - i-- - dAtA[i] = 0x10 - } - if m.MinTime != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MinTime)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryHints) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryHints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryHints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Range != nil { - { - size, err := m.Range.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.Grouping != nil { - { - size, err := m.Grouping.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Func != nil { - { - size, err := m.Func.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.StepMillis != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.StepMillis)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ShardInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ShardInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ShardInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Labels[iNdEx]) - copy(dAtA[i:], m.Labels[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Labels[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if m.By { - i-- - if m.By { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if m.TotalShards != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.TotalShards)) - i-- - dAtA[i] = 0x10 - } - if m.ShardIndex != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.ShardIndex)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Func) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Func) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Func) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Grouping) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Grouping) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Grouping) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Labels[iNdEx]) - copy(dAtA[i:], m.Labels[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Labels[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if m.By { - i-- - if m.By { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil + // / hints is an opaque data structure that can be used to carry additional information from + // / the store. The content of this field and whether it's supported depends on the + // / implementation of a specific store. + Hints *anypb.Any `protobuf:"bytes,3,opt,name=hints,proto3" json:"hints,omitempty"` } -func (m *Range) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *LabelNamesResponse) Reset() { + *x = LabelNamesResponse{} + mi := &file_store_storepb_rpc_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Range) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *LabelNamesResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Range) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Millis != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Millis)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} +func (*LabelNamesResponse) ProtoMessage() {} -func (m *SeriesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SeriesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Result != nil { - { - size := m.Result.Size() - i -= size - if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } +func (x *LabelNamesResponse) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_rpc_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - return len(dAtA) - i, nil + return mi.MessageOf(x) } -func (m *SeriesResponse_Series) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use LabelNamesResponse.ProtoReflect.Descriptor instead. +func (*LabelNamesResponse) Descriptor() ([]byte, []int) { + return file_store_storepb_rpc_proto_rawDescGZIP(), []int{10} } -func (m *SeriesResponse_Series) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Series != nil { - { - size, err := m.Series.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *SeriesResponse_Warning) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesResponse_Warning) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.Warning) - copy(dAtA[i:], m.Warning) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Warning))) - i-- - dAtA[i] = 0x12 - return len(dAtA) - i, nil -} -func (m *SeriesResponse_Hints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesResponse_Hints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Hints != nil { - { - size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a +func (x *LabelNamesResponse) GetNames() []string { + if x != nil { + return x.Names } - return len(dAtA) - i, nil -} -func (m *LabelNamesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LabelNamesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return nil } -func (m *LabelNamesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Limit != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Limit)) - i-- - dAtA[i] = 0x40 - } - if len(m.WithoutReplicaLabels) > 0 { - for iNdEx := len(m.WithoutReplicaLabels) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.WithoutReplicaLabels[iNdEx]) - copy(dAtA[i:], m.WithoutReplicaLabels[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.WithoutReplicaLabels[iNdEx]))) - i-- - dAtA[i] = 0x3a - } - } - if len(m.Matchers) > 0 { - for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Matchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if m.Hints != nil { - { - size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.End != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.End)) - i-- - dAtA[i] = 0x20 - } - if m.Start != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Start)) - i-- - dAtA[i] = 0x18 - } - if m.PartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) - i-- - dAtA[i] = 0x10 - } - if m.PartialResponseDisabled { - i-- - if m.PartialResponseDisabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 +func (x *LabelNamesResponse) GetWarnings() []string { + if x != nil { + return x.Warnings } - return len(dAtA) - i, nil + return nil } -func (m *LabelNamesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LabelNamesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelNamesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Hints != nil { - { - size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Warnings) > 0 { - for iNdEx := len(m.Warnings) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Warnings[iNdEx]) - copy(dAtA[i:], m.Warnings[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Warnings[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Names) > 0 { - for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Names[iNdEx]) - copy(dAtA[i:], m.Names[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Names[iNdEx]))) - i-- - dAtA[i] = 0xa - } +func (x *LabelNamesResponse) GetHints() *anypb.Any { + if x != nil { + return x.Hints } - return len(dAtA) - i, nil + return nil } -func (m *LabelValuesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} +type LabelValuesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *LabelValuesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"` + PartialResponseDisabled bool `protobuf:"varint,2,opt,name=partial_response_disabled,json=partialResponseDisabled,proto3" json:"partial_response_disabled,omitempty"` + // TODO(bwplotka): Move Thanos components to use strategy instead. Including QueryAPI. + PartialResponseStrategy PartialResponseStrategy `protobuf:"varint,3,opt,name=partial_response_strategy,json=partialResponseStrategy,proto3,enum=thanos.PartialResponseStrategy" json:"partial_response_strategy,omitempty"` + Start int64 `protobuf:"varint,4,opt,name=start,proto3" json:"start,omitempty"` + End int64 `protobuf:"varint,5,opt,name=end,proto3" json:"end,omitempty"` + // hints is an opaque data structure that can be used to carry additional information. + // The content of this field and whether it's supported depends on the + // implementation of a specific store. + Hints *anypb.Any `protobuf:"bytes,6,opt,name=hints,proto3" json:"hints,omitempty"` + Matchers []*LabelMatcher `protobuf:"bytes,7,rep,name=matchers,proto3" json:"matchers"` + // same as in series request. + WithoutReplicaLabels []string `protobuf:"bytes,8,rep,name=without_replica_labels,json=withoutReplicaLabels,proto3" json:"without_replica_labels,omitempty"` + // limit is used to limit the number of results returned + Limit int64 `protobuf:"varint,9,opt,name=limit,proto3" json:"limit,omitempty"` } -func (m *LabelValuesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Limit != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Limit)) - i-- - dAtA[i] = 0x48 - } - if len(m.WithoutReplicaLabels) > 0 { - for iNdEx := len(m.WithoutReplicaLabels) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.WithoutReplicaLabels[iNdEx]) - copy(dAtA[i:], m.WithoutReplicaLabels[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.WithoutReplicaLabels[iNdEx]))) - i-- - dAtA[i] = 0x42 - } - } - if len(m.Matchers) > 0 { - for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Matchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if m.Hints != nil { - { - size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.End != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.End)) - i-- - dAtA[i] = 0x28 - } - if m.Start != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Start)) - i-- - dAtA[i] = 0x20 - } - if m.PartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) - i-- - dAtA[i] = 0x18 - } - if m.PartialResponseDisabled { - i-- - if m.PartialResponseDisabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.Label) > 0 { - i -= len(m.Label) - copy(dAtA[i:], m.Label) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Label))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +func (x *LabelValuesRequest) Reset() { + *x = LabelValuesRequest{} + mi := &file_store_storepb_rpc_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *LabelValuesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LabelValuesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelValuesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Hints != nil { - { - size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Warnings) > 0 { - for iNdEx := len(m.Warnings) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Warnings[iNdEx]) - copy(dAtA[i:], m.Warnings[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Warnings[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Values) > 0 { - for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Values[iNdEx]) - copy(dAtA[i:], m.Values[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Values[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil +func (x *LabelValuesRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func encodeVarintRpc(dAtA []byte, offset int, v uint64) int { - offset -= sovRpc(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *WriteResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} +func (*LabelValuesRequest) ProtoMessage() {} -func (m *WriteRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Timeseries) > 0 { - for _, e := range m.Timeseries { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) +func (x *LabelValuesRequest) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_rpc_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - l = len(m.Tenant) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.Replica != 0 { - n += 1 + sovRpc(uint64(m.Replica)) - } - return n + return mi.MessageOf(x) } -func (m *SeriesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MinTime != 0 { - n += 1 + sovRpc(uint64(m.MinTime)) - } - if m.MaxTime != 0 { - n += 1 + sovRpc(uint64(m.MaxTime)) - } - if len(m.Matchers) > 0 { - for _, e := range m.Matchers { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.MaxResolutionWindow != 0 { - n += 1 + sovRpc(uint64(m.MaxResolutionWindow)) - } - if len(m.Aggregates) > 0 { - l = 0 - for _, e := range m.Aggregates { - l += sovRpc(uint64(e)) - } - n += 1 + sovRpc(uint64(l)) + l - } - if m.PartialResponseDisabled { - n += 2 - } - if m.PartialResponseStrategy != 0 { - n += 1 + sovRpc(uint64(m.PartialResponseStrategy)) - } - if m.SkipChunks { - n += 2 - } - if m.Hints != nil { - l = m.Hints.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Step != 0 { - n += 1 + sovRpc(uint64(m.Step)) - } - if m.Range != 0 { - n += 1 + sovRpc(uint64(m.Range)) - } - if m.QueryHints != nil { - l = m.QueryHints.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.ShardInfo != nil { - l = m.ShardInfo.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.WithoutReplicaLabels) > 0 { - for _, s := range m.WithoutReplicaLabels { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.Limit != 0 { - n += 1 + sovRpc(uint64(m.Limit)) - } - return n +// Deprecated: Use LabelValuesRequest.ProtoReflect.Descriptor instead. +func (*LabelValuesRequest) Descriptor() ([]byte, []int) { + return file_store_storepb_rpc_proto_rawDescGZIP(), []int{11} } -func (m *QueryHints) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StepMillis != 0 { - n += 1 + sovRpc(uint64(m.StepMillis)) - } - if m.Func != nil { - l = m.Func.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Grouping != nil { - l = m.Grouping.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Range != nil { - l = m.Range.Size() - n += 1 + l + sovRpc(uint64(l)) +func (x *LabelValuesRequest) GetLabel() string { + if x != nil { + return x.Label } - return n + return "" } -func (m *ShardInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ShardIndex != 0 { - n += 1 + sovRpc(uint64(m.ShardIndex)) - } - if m.TotalShards != 0 { - n += 1 + sovRpc(uint64(m.TotalShards)) - } - if m.By { - n += 2 +func (x *LabelValuesRequest) GetPartialResponseDisabled() bool { + if x != nil { + return x.PartialResponseDisabled } - if len(m.Labels) > 0 { - for _, s := range m.Labels { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - return n + return false } -func (m *Func) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) +func (x *LabelValuesRequest) GetPartialResponseStrategy() PartialResponseStrategy { + if x != nil { + return x.PartialResponseStrategy } - return n + return PartialResponseStrategy_WARN } -func (m *Grouping) Size() (n int) { - if m == nil { - return 0 +func (x *LabelValuesRequest) GetStart() int64 { + if x != nil { + return x.Start } - var l int - _ = l - if m.By { - n += 2 - } - if len(m.Labels) > 0 { - for _, s := range m.Labels { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - return n + return 0 } -func (m *Range) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Millis != 0 { - n += 1 + sovRpc(uint64(m.Millis)) +func (x *LabelValuesRequest) GetEnd() int64 { + if x != nil { + return x.End } - return n + return 0 } -func (m *SeriesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Result != nil { - n += m.Result.Size() +func (x *LabelValuesRequest) GetHints() *anypb.Any { + if x != nil { + return x.Hints } - return n + return nil } -func (m *SeriesResponse_Series) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Series != nil { - l = m.Series.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *SeriesResponse_Warning) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Warning) - n += 1 + l + sovRpc(uint64(l)) - return n -} -func (m *SeriesResponse_Hints) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Hints != nil { - l = m.Hints.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *LabelNamesRequest) Size() (n int) { - if m == nil { - return 0 +func (x *LabelValuesRequest) GetMatchers() []*LabelMatcher { + if x != nil { + return x.Matchers } - var l int - _ = l - if m.PartialResponseDisabled { - n += 2 - } - if m.PartialResponseStrategy != 0 { - n += 1 + sovRpc(uint64(m.PartialResponseStrategy)) - } - if m.Start != 0 { - n += 1 + sovRpc(uint64(m.Start)) - } - if m.End != 0 { - n += 1 + sovRpc(uint64(m.End)) - } - if m.Hints != nil { - l = m.Hints.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Matchers) > 0 { - for _, e := range m.Matchers { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if len(m.WithoutReplicaLabels) > 0 { - for _, s := range m.WithoutReplicaLabels { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.Limit != 0 { - n += 1 + sovRpc(uint64(m.Limit)) - } - return n + return nil } -func (m *LabelNamesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if len(m.Warnings) > 0 { - for _, s := range m.Warnings { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.Hints != nil { - l = m.Hints.Size() - n += 1 + l + sovRpc(uint64(l)) +func (x *LabelValuesRequest) GetWithoutReplicaLabels() []string { + if x != nil { + return x.WithoutReplicaLabels } - return n + return nil } -func (m *LabelValuesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Label) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.PartialResponseDisabled { - n += 2 - } - if m.PartialResponseStrategy != 0 { - n += 1 + sovRpc(uint64(m.PartialResponseStrategy)) - } - if m.Start != 0 { - n += 1 + sovRpc(uint64(m.Start)) - } - if m.End != 0 { - n += 1 + sovRpc(uint64(m.End)) - } - if m.Hints != nil { - l = m.Hints.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Matchers) > 0 { - for _, e := range m.Matchers { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if len(m.WithoutReplicaLabels) > 0 { - for _, s := range m.WithoutReplicaLabels { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.Limit != 0 { - n += 1 + sovRpc(uint64(m.Limit)) +func (x *LabelValuesRequest) GetLimit() int64 { + if x != nil { + return x.Limit } - return n + return 0 } -func (m *LabelValuesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Values) > 0 { - for _, s := range m.Values { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if len(m.Warnings) > 0 { - for _, s := range m.Warnings { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.Hints != nil { - l = m.Hints.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func sovRpc(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRpc(x uint64) (n int) { - return sovRpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *WriteResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WriteResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WriteResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +type LabelValuesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil + Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` + Warnings []string `protobuf:"bytes,2,rep,name=warnings,proto3" json:"warnings,omitempty"` + // / hints is an opaque data structure that can be used to carry additional information from + // / the store. The content of this field and whether it's supported depends on the + // / implementation of a specific store. + Hints *anypb.Any `protobuf:"bytes,3,opt,name=hints,proto3" json:"hints,omitempty"` } -func (m *WriteRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WriteRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WriteRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Timeseries = append(m.Timeseries, prompb.TimeSeries{}) - if err := m.Timeseries[len(m.Timeseries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tenant", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tenant = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Replica", wireType) - } - m.Replica = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Replica |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +func (x *LabelValuesResponse) Reset() { + *x = LabelValuesResponse{} + mi := &file_store_storepb_rpc_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *SeriesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SeriesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SeriesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinTime", wireType) - } - m.MinTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxTime", wireType) - } - m.MaxTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Matchers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Matchers = append(m.Matchers, LabelMatcher{}) - if err := m.Matchers[len(m.Matchers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxResolutionWindow", wireType) - } - m.MaxResolutionWindow = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxResolutionWindow |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType == 0 { - var v Aggr - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= Aggr(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Aggregates = append(m.Aggregates, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - if elementCount != 0 && len(m.Aggregates) == 0 { - m.Aggregates = make([]Aggr, 0, elementCount) - } - for iNdEx < postIndex { - var v Aggr - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= Aggr(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Aggregates = append(m.Aggregates, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Aggregates", wireType) - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseDisabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.PartialResponseDisabled = bool(v != 0) - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) - } - m.PartialResponseStrategy = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PartialResponseStrategy |= PartialResponseStrategy(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SkipChunks", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.SkipChunks = bool(v != 0) - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Hints == nil { - m.Hints = &types.Any{} - } - if err := m.Hints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) - } - m.Step = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Step |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Range", wireType) - } - m.Range = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Range |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QueryHints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.QueryHints == nil { - m.QueryHints = &QueryHints{} - } - if err := m.QueryHints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShardInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ShardInfo == nil { - m.ShardInfo = &ShardInfo{} - } - if err := m.ShardInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WithoutReplicaLabels", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.WithoutReplicaLabels = append(m.WithoutReplicaLabels, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) - } - m.Limit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Limit |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +func (x *LabelValuesResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *QueryHints) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryHints: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryHints: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StepMillis", wireType) - } - m.StepMillis = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StepMillis |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Func", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Func == nil { - m.Func = &Func{} - } - if err := m.Func.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grouping", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Grouping == nil { - m.Grouping = &Grouping{} - } - if err := m.Grouping.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Range", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Range == nil { - m.Range = &Range{} - } - if err := m.Range.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ShardInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ShardInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ShardInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ShardIndex", wireType) - } - m.ShardIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ShardIndex |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalShards", wireType) - } - m.TotalShards = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalShards |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field By", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.By = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +func (*LabelValuesResponse) ProtoMessage() {} - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Func) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Func: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Func: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy +func (x *LabelValuesResponse) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_rpc_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil + return mi.MessageOf(x) } -func (m *Grouping) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Grouping: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Grouping: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field By", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.By = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +// Deprecated: Use LabelValuesResponse.ProtoReflect.Descriptor instead. +func (*LabelValuesResponse) Descriptor() ([]byte, []int) { + return file_store_storepb_rpc_proto_rawDescGZIP(), []int{12} } -func (m *Range) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Range: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Range: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Millis", wireType) - } - m.Millis = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Millis |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *LabelValuesResponse) GetValues() []string { + if x != nil { + return x.Values } return nil } -func (m *SeriesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SeriesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SeriesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Series", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Series{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Result = &SeriesResponse_Series{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Warning", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Result = &SeriesResponse_Warning{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.Any{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Result = &SeriesResponse_Hints{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *LabelValuesResponse) GetWarnings() []string { + if x != nil { + return x.Warnings } return nil } -func (m *LabelNamesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LabelNamesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelNamesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseDisabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.PartialResponseDisabled = bool(v != 0) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) - } - m.PartialResponseStrategy = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PartialResponseStrategy |= PartialResponseStrategy(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) - } - m.Start = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Start |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) - } - m.End = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.End |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Hints == nil { - m.Hints = &types.Any{} - } - if err := m.Hints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Matchers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Matchers = append(m.Matchers, LabelMatcher{}) - if err := m.Matchers[len(m.Matchers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WithoutReplicaLabels", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.WithoutReplicaLabels = append(m.WithoutReplicaLabels, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) - } - m.Limit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Limit |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *LabelValuesResponse) GetHints() *anypb.Any { + if x != nil { + return x.Hints } return nil } -func (m *LabelNamesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LabelNamesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelNamesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Warnings", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Warnings = append(m.Warnings, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Hints == nil { - m.Hints = &types.Any{} - } - if err := m.Hints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +var File_store_storepb_rpc_proto protoreflect.FileDescriptor + +var file_store_storepb_rpc_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2f, + 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x74, 0x68, 0x61, 0x6e, 0x6f, + 0x73, 0x1a, 0x19, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2f, 0x70, 0x72, 0x6f, 0x6d, + 0x70, 0x62, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x74, 0x61, 0x67, 0x67, 0x65, + 0x72, 0x2f, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x33, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x74, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x76, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x76, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x76, 0x74, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x0f, 0x0a, 0x0d, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x9f, 0x01, 0x0a, 0x0c, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x53, 0x0a, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x65, 0x72, 0x69, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, + 0x68, 0x65, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, + 0x72, 0x69, 0x65, 0x73, 0x42, 0x16, 0x9a, 0x84, 0x9e, 0x03, 0x11, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x22, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0x52, 0x0a, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x3a, 0x08, 0xa8, 0xa6, 0x1f, 0x01, + 0xc8, 0xac, 0x1f, 0x03, 0x22, 0xb2, 0x05, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x46, 0x0a, 0x08, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x65, 0x72, 0x42, 0x14, 0x9a, 0x84, 0x9e, 0x03, 0x0f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x22, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x22, 0x52, 0x08, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x72, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x65, 0x73, 0x6f, + 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x13, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x2c, 0x0a, 0x0a, 0x61, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x74, + 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x52, 0x0a, 0x61, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, + 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x70, 0x61, 0x72, 0x74, 0x69, + 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x12, 0x5b, 0x0a, 0x19, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x50, + 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, + 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x52, 0x17, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, + 0x1f, 0x0a, 0x0b, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, 0x6b, 0x69, 0x70, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, + 0x12, 0x2a, 0x0a, 0x05, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, + 0x73, 0x74, 0x65, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, + 0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x33, 0x0a, 0x0b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, + 0x68, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x68, + 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x69, 0x6e, 0x74, 0x73, 0x52, + 0x0a, 0x71, 0x75, 0x65, 0x72, 0x79, 0x48, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x30, 0x0a, 0x0a, 0x73, + 0x68, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x11, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x64, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x09, 0x73, 0x68, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x34, 0x0a, + 0x16, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x77, + 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0f, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0xa2, 0x01, 0x0a, 0x0a, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x48, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x65, 0x70, + 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x73, + 0x74, 0x65, 0x70, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x20, 0x0a, 0x04, 0x66, 0x75, 0x6e, + 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, + 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x52, 0x04, 0x66, 0x75, 0x6e, 0x63, 0x12, 0x2c, 0x0a, 0x08, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x6e, 0x67, 0x52, + 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x0a, 0x05, 0x72, 0x61, 0x6e, + 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, + 0x73, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x77, + 0x0a, 0x09, 0x53, 0x68, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x73, + 0x68, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0a, 0x73, 0x68, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x21, 0x0a, 0x0c, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x12, + 0x0e, 0x0a, 0x02, 0x62, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x62, 0x79, 0x12, + 0x16, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x1a, 0x0a, 0x04, 0x46, 0x75, 0x6e, 0x63, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0x32, 0x0a, 0x08, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x6e, 0x67, 0x12, + 0x0e, 0x0a, 0x02, 0x62, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x62, 0x79, 0x12, + 0x16, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x1f, 0x0a, 0x05, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x06, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x22, 0x8e, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x72, + 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x06, 0x73, + 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x74, 0x68, + 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x48, 0x00, 0x52, 0x06, 0x73, + 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x07, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, + 0x67, 0x12, 0x2c, 0x0a, 0x05, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x48, 0x00, 0x52, 0x05, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x42, + 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x94, 0x03, 0x0a, 0x11, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x3a, 0x0a, 0x19, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x5f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x17, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x5b, 0x0a, 0x19, 0x70, + 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, + 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, + 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x52, + 0x17, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, + 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, + 0x12, 0x2a, 0x0a, 0x05, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x46, 0x0a, 0x08, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x65, 0x72, 0x42, 0x14, 0x9a, 0x84, 0x9e, 0x03, 0x0f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x22, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x22, 0x52, 0x08, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x72, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x5f, + 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x07, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x22, 0x72, 0x0a, 0x12, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, + 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, + 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x68, 0x69, 0x6e, 0x74, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x68, + 0x69, 0x6e, 0x74, 0x73, 0x22, 0xab, 0x03, 0x0a, 0x12, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x12, 0x3a, 0x0a, 0x19, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x5b, 0x0a, + 0x19, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, + 0x79, 0x52, 0x17, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, + 0x6e, 0x64, 0x12, 0x2a, 0x0a, 0x05, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x46, + 0x0a, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, + 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x42, 0x14, 0x9a, 0x84, 0x9e, 0x03, 0x0f, 0x6a, 0x73, 0x6f, + 0x6e, 0x3a, 0x22, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x22, 0x52, 0x08, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, + 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x52, + 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x14, 0x0a, 0x05, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x22, 0x75, 0x0a, 0x13, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x08, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x2a, 0x0a, + 0x05, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, + 0x6e, 0x79, 0x52, 0x05, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x2a, 0x42, 0x0a, 0x04, 0x41, 0x67, 0x67, + 0x72, 0x12, 0x07, 0x0a, 0x03, 0x52, 0x41, 0x57, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4f, + 0x55, 0x4e, 0x54, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x55, 0x4d, 0x10, 0x02, 0x12, 0x07, + 0x0a, 0x03, 0x4d, 0x49, 0x4e, 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, 0x4d, 0x41, 0x58, 0x10, 0x04, + 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x10, 0x05, 0x32, 0xcf, 0x01, + 0x0a, 0x05, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x69, 0x65, + 0x73, 0x12, 0x15, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, + 0x73, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x30, 0x01, 0x12, 0x43, 0x0a, 0x0a, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, + 0x12, 0x19, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x74, 0x68, + 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1a, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, + 0x4e, 0x0a, 0x0e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x12, 0x3c, 0x0a, 0x0b, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, + 0x12, 0x14, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, + 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x68, + 0x61, 0x6e, 0x6f, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2f, 0x70, + 0x6b, 0x67, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -func (m *LabelValuesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LabelValuesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelValuesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Label = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseDisabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.PartialResponseDisabled = bool(v != 0) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) - } - m.PartialResponseStrategy = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PartialResponseStrategy |= PartialResponseStrategy(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) - } - m.Start = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Start |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) - } - m.End = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.End |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Hints == nil { - m.Hints = &types.Any{} - } - if err := m.Hints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Matchers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Matchers = append(m.Matchers, LabelMatcher{}) - if err := m.Matchers[len(m.Matchers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WithoutReplicaLabels", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.WithoutReplicaLabels = append(m.WithoutReplicaLabels, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) - } - m.Limit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Limit |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LabelValuesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LabelValuesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelValuesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Values = append(m.Values, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Warnings", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Warnings = append(m.Warnings, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Hints == nil { - m.Hints = &types.Any{} - } - if err := m.Hints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +var ( + file_store_storepb_rpc_proto_rawDescOnce sync.Once + file_store_storepb_rpc_proto_rawDescData = file_store_storepb_rpc_proto_rawDesc +) - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRpc(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthRpc - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRpc - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRpc - } - if depth == 0 { - return iNdEx, nil - } +func file_store_storepb_rpc_proto_rawDescGZIP() []byte { + file_store_storepb_rpc_proto_rawDescOnce.Do(func() { + file_store_storepb_rpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_storepb_rpc_proto_rawDescData) + }) + return file_store_storepb_rpc_proto_rawDescData +} + +var file_store_storepb_rpc_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_store_storepb_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_store_storepb_rpc_proto_goTypes = []any{ + (Aggr)(0), // 0: thanos.Aggr + (*WriteResponse)(nil), // 1: thanos.WriteResponse + (*WriteRequest)(nil), // 2: thanos.WriteRequest + (*SeriesRequest)(nil), // 3: thanos.SeriesRequest + (*QueryHints)(nil), // 4: thanos.QueryHints + (*ShardInfo)(nil), // 5: thanos.ShardInfo + (*Func)(nil), // 6: thanos.Func + (*Grouping)(nil), // 7: thanos.Grouping + (*Range)(nil), // 8: thanos.Range + (*SeriesResponse)(nil), // 9: thanos.SeriesResponse + (*LabelNamesRequest)(nil), // 10: thanos.LabelNamesRequest + (*LabelNamesResponse)(nil), // 11: thanos.LabelNamesResponse + (*LabelValuesRequest)(nil), // 12: thanos.LabelValuesRequest + (*LabelValuesResponse)(nil), // 13: thanos.LabelValuesResponse + (*prompb.TimeSeries)(nil), // 14: prometheus_copy.TimeSeries + (*LabelMatcher)(nil), // 15: thanos.LabelMatcher + (PartialResponseStrategy)(0), // 16: thanos.PartialResponseStrategy + (*anypb.Any)(nil), // 17: google.protobuf.Any + (*Series)(nil), // 18: thanos.Series +} +var file_store_storepb_rpc_proto_depIdxs = []int32{ + 14, // 0: thanos.WriteRequest.timeseries:type_name -> prometheus_copy.TimeSeries + 15, // 1: thanos.SeriesRequest.matchers:type_name -> thanos.LabelMatcher + 0, // 2: thanos.SeriesRequest.aggregates:type_name -> thanos.Aggr + 16, // 3: thanos.SeriesRequest.partial_response_strategy:type_name -> thanos.PartialResponseStrategy + 17, // 4: thanos.SeriesRequest.hints:type_name -> google.protobuf.Any + 4, // 5: thanos.SeriesRequest.query_hints:type_name -> thanos.QueryHints + 5, // 6: thanos.SeriesRequest.shard_info:type_name -> thanos.ShardInfo + 6, // 7: thanos.QueryHints.func:type_name -> thanos.Func + 7, // 8: thanos.QueryHints.grouping:type_name -> thanos.Grouping + 8, // 9: thanos.QueryHints.range:type_name -> thanos.Range + 18, // 10: thanos.SeriesResponse.series:type_name -> thanos.Series + 17, // 11: thanos.SeriesResponse.hints:type_name -> google.protobuf.Any + 16, // 12: thanos.LabelNamesRequest.partial_response_strategy:type_name -> thanos.PartialResponseStrategy + 17, // 13: thanos.LabelNamesRequest.hints:type_name -> google.protobuf.Any + 15, // 14: thanos.LabelNamesRequest.matchers:type_name -> thanos.LabelMatcher + 17, // 15: thanos.LabelNamesResponse.hints:type_name -> google.protobuf.Any + 16, // 16: thanos.LabelValuesRequest.partial_response_strategy:type_name -> thanos.PartialResponseStrategy + 17, // 17: thanos.LabelValuesRequest.hints:type_name -> google.protobuf.Any + 15, // 18: thanos.LabelValuesRequest.matchers:type_name -> thanos.LabelMatcher + 17, // 19: thanos.LabelValuesResponse.hints:type_name -> google.protobuf.Any + 3, // 20: thanos.Store.Series:input_type -> thanos.SeriesRequest + 10, // 21: thanos.Store.LabelNames:input_type -> thanos.LabelNamesRequest + 12, // 22: thanos.Store.LabelValues:input_type -> thanos.LabelValuesRequest + 2, // 23: thanos.WriteableStore.RemoteWrite:input_type -> thanos.WriteRequest + 9, // 24: thanos.Store.Series:output_type -> thanos.SeriesResponse + 11, // 25: thanos.Store.LabelNames:output_type -> thanos.LabelNamesResponse + 13, // 26: thanos.Store.LabelValues:output_type -> thanos.LabelValuesResponse + 1, // 27: thanos.WriteableStore.RemoteWrite:output_type -> thanos.WriteResponse + 24, // [24:28] is the sub-list for method output_type + 20, // [20:24] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name +} + +func init() { file_store_storepb_rpc_proto_init() } +func file_store_storepb_rpc_proto_init() { + if File_store_storepb_rpc_proto != nil { + return + } + file_store_storepb_types_proto_init() + file_store_storepb_rpc_proto_msgTypes[8].OneofWrappers = []any{ + (*SeriesResponse_Series)(nil), + (*SeriesResponse_Warning)(nil), + (*SeriesResponse_Hints)(nil), } - return 0, io.ErrUnexpectedEOF + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_store_storepb_rpc_proto_rawDesc, + NumEnums: 1, + NumMessages: 13, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_store_storepb_rpc_proto_goTypes, + DependencyIndexes: file_store_storepb_rpc_proto_depIdxs, + EnumInfos: file_store_storepb_rpc_proto_enumTypes, + MessageInfos: file_store_storepb_rpc_proto_msgTypes, + }.Build() + File_store_storepb_rpc_proto = out.File + file_store_storepb_rpc_proto_rawDesc = nil + file_store_storepb_rpc_proto_goTypes = nil + file_store_storepb_rpc_proto_depIdxs = nil } - -var ( - ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRpc = fmt.Errorf("proto: unexpected end of group") -) diff --git a/pkg/store/storepb/rpc.proto b/pkg/store/storepb/rpc.proto index 2de086bc12b..b1fa0d7bc31 100644 --- a/pkg/store/storepb/rpc.proto +++ b/pkg/store/storepb/rpc.proto @@ -5,22 +5,13 @@ syntax = "proto3"; package thanos; import "store/storepb/types.proto"; -import "gogoproto/gogo.proto"; import "store/storepb/prompb/types.proto"; import "google/protobuf/any.proto"; +import "tagger/tagger.proto"; +import "github.com/planetscale/vtprotobuf/vtproto/ext.proto"; +import "vtpool.proto"; -option go_package = "storepb"; - -option (gogoproto.sizer_all) = true; -option (gogoproto.marshaler_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; +option go_package = "github.com/thanos-io/thanos/pkg/store/storepb"; /// Store represents API against instance that stores XOR encoded values with label set metadata (e.g Prometheus metrics). service Store { @@ -55,7 +46,9 @@ message WriteResponse { } message WriteRequest { - repeated prometheus_copy.TimeSeries timeseries = 1 [(gogoproto.nullable) = false]; + option (vtproto.mempool) = true; + option (vtpool.pool_return) = POOL_RETURN_REFCOUNT; + repeated prometheus_copy.TimeSeries timeseries = 1 [(tagger.tags) = "json:\"timeseries\""]; string tenant = 2; int64 replica = 3; } @@ -63,7 +56,7 @@ message WriteRequest { message SeriesRequest { int64 min_time = 1; int64 max_time = 2; - repeated LabelMatcher matchers = 3 [(gogoproto.nullable) = false]; + repeated LabelMatcher matchers = 3 [(tagger.tags) = "json:\"matchers\""]; int64 max_resolution_window = 4; repeated Aggr aggregates = 5; @@ -205,13 +198,13 @@ message LabelNamesRequest { // implementation of a specific store. google.protobuf.Any hints = 5; - repeated LabelMatcher matchers = 6 [(gogoproto.nullable) = false]; + repeated LabelMatcher matchers = 6 [(tagger.tags) = "json:\"matchers\""]; // same as in series request. repeated string without_replica_labels = 7; - // limit is used to limit the number of results returned - int64 limit = 8; + // limit is used to limit the number of results returned + int64 limit = 8; } message LabelNamesResponse { @@ -241,13 +234,13 @@ message LabelValuesRequest { // implementation of a specific store. google.protobuf.Any hints = 6; - repeated LabelMatcher matchers = 7 [(gogoproto.nullable) = false]; + repeated LabelMatcher matchers = 7 [(tagger.tags) = "json:\"matchers\""]; // same as in series request. repeated string without_replica_labels = 8; - // limit is used to limit the number of results returned - int64 limit = 9; + // limit is used to limit the number of results returned + int64 limit = 9; } message LabelValuesResponse { diff --git a/pkg/store/storepb/rpc_grpc.pb.go b/pkg/store/storepb/rpc_grpc.pb.go new file mode 100644 index 00000000000..f1702b6e378 --- /dev/null +++ b/pkg/store/storepb/rpc_grpc.pb.go @@ -0,0 +1,345 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v3.20.1 +// source: store/storepb/rpc.proto + +package storepb + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Store_Series_FullMethodName = "/thanos.Store/Series" + Store_LabelNames_FullMethodName = "/thanos.Store/LabelNames" + Store_LabelValues_FullMethodName = "/thanos.Store/LabelValues" +) + +// StoreClient is the client API for Store service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// / Store represents API against instance that stores XOR encoded values with label set metadata (e.g Prometheus metrics). +type StoreClient interface { + // / Series streams each Series (Labels and chunk/downsampling chunk) for given label matchers and time range. + // / + // / Series should strictly stream full series after series, optionally split by time. This means that a single frame can contain + // / partition of the single series, but once a new series is started to be streamed it means that no more data will + // / be sent for previous one. + // / Series has to be sorted. + // / + // / There is no requirements on chunk sorting, however it is recommended to have chunk sorted by chunk min time. + // / This heavily optimizes the resource usage on Querier / Federated Queries. + // / + // / Chunks can span a range larger than the requested min and max time and it is up to the query engine to discard samples + // / which fall outside of the query range. + Series(ctx context.Context, in *SeriesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SeriesResponse], error) + // / LabelNames returns all label names constrained by the given matchers. + LabelNames(ctx context.Context, in *LabelNamesRequest, opts ...grpc.CallOption) (*LabelNamesResponse, error) + // / LabelValues returns all label values for given label name. + LabelValues(ctx context.Context, in *LabelValuesRequest, opts ...grpc.CallOption) (*LabelValuesResponse, error) +} + +type storeClient struct { + cc grpc.ClientConnInterface +} + +func NewStoreClient(cc grpc.ClientConnInterface) StoreClient { + return &storeClient{cc} +} + +func (c *storeClient) Series(ctx context.Context, in *SeriesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SeriesResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &Store_ServiceDesc.Streams[0], Store_Series_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[SeriesRequest, SeriesResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Store_SeriesClient = grpc.ServerStreamingClient[SeriesResponse] + +func (c *storeClient) LabelNames(ctx context.Context, in *LabelNamesRequest, opts ...grpc.CallOption) (*LabelNamesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(LabelNamesResponse) + err := c.cc.Invoke(ctx, Store_LabelNames_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storeClient) LabelValues(ctx context.Context, in *LabelValuesRequest, opts ...grpc.CallOption) (*LabelValuesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(LabelValuesResponse) + err := c.cc.Invoke(ctx, Store_LabelValues_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// StoreServer is the server API for Store service. +// All implementations must embed UnimplementedStoreServer +// for forward compatibility. +// +// / Store represents API against instance that stores XOR encoded values with label set metadata (e.g Prometheus metrics). +type StoreServer interface { + // / Series streams each Series (Labels and chunk/downsampling chunk) for given label matchers and time range. + // / + // / Series should strictly stream full series after series, optionally split by time. This means that a single frame can contain + // / partition of the single series, but once a new series is started to be streamed it means that no more data will + // / be sent for previous one. + // / Series has to be sorted. + // / + // / There is no requirements on chunk sorting, however it is recommended to have chunk sorted by chunk min time. + // / This heavily optimizes the resource usage on Querier / Federated Queries. + // / + // / Chunks can span a range larger than the requested min and max time and it is up to the query engine to discard samples + // / which fall outside of the query range. + Series(*SeriesRequest, grpc.ServerStreamingServer[SeriesResponse]) error + // / LabelNames returns all label names constrained by the given matchers. + LabelNames(context.Context, *LabelNamesRequest) (*LabelNamesResponse, error) + // / LabelValues returns all label values for given label name. + LabelValues(context.Context, *LabelValuesRequest) (*LabelValuesResponse, error) + mustEmbedUnimplementedStoreServer() +} + +// UnimplementedStoreServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedStoreServer struct{} + +func (UnimplementedStoreServer) Series(*SeriesRequest, grpc.ServerStreamingServer[SeriesResponse]) error { + return status.Errorf(codes.Unimplemented, "method Series not implemented") +} +func (UnimplementedStoreServer) LabelNames(context.Context, *LabelNamesRequest) (*LabelNamesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LabelNames not implemented") +} +func (UnimplementedStoreServer) LabelValues(context.Context, *LabelValuesRequest) (*LabelValuesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LabelValues not implemented") +} +func (UnimplementedStoreServer) mustEmbedUnimplementedStoreServer() {} +func (UnimplementedStoreServer) testEmbeddedByValue() {} + +// UnsafeStoreServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to StoreServer will +// result in compilation errors. +type UnsafeStoreServer interface { + mustEmbedUnimplementedStoreServer() +} + +func RegisterStoreServer(s grpc.ServiceRegistrar, srv StoreServer) { + // If the following call pancis, it indicates UnimplementedStoreServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Store_ServiceDesc, srv) +} + +func _Store_Series_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SeriesRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(StoreServer).Series(m, &grpc.GenericServerStream[SeriesRequest, SeriesResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Store_SeriesServer = grpc.ServerStreamingServer[SeriesResponse] + +func _Store_LabelNames_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LabelNamesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StoreServer).LabelNames(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Store_LabelNames_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreServer).LabelNames(ctx, req.(*LabelNamesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Store_LabelValues_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LabelValuesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StoreServer).LabelValues(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Store_LabelValues_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreServer).LabelValues(ctx, req.(*LabelValuesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Store_ServiceDesc is the grpc.ServiceDesc for Store service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Store_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "thanos.Store", + HandlerType: (*StoreServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "LabelNames", + Handler: _Store_LabelNames_Handler, + }, + { + MethodName: "LabelValues", + Handler: _Store_LabelValues_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Series", + Handler: _Store_Series_Handler, + ServerStreams: true, + }, + }, + Metadata: "store/storepb/rpc.proto", +} + +const ( + WriteableStore_RemoteWrite_FullMethodName = "/thanos.WriteableStore/RemoteWrite" +) + +// WriteableStoreClient is the client API for WriteableStore service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// / WriteableStore represents API against instance that stores XOR encoded values with label set metadata (e.g Prometheus metrics). +type WriteableStoreClient interface { + // WriteRequest allows you to write metrics to this store via remote write + RemoteWrite(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error) +} + +type writeableStoreClient struct { + cc grpc.ClientConnInterface +} + +func NewWriteableStoreClient(cc grpc.ClientConnInterface) WriteableStoreClient { + return &writeableStoreClient{cc} +} + +func (c *writeableStoreClient) RemoteWrite(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(WriteResponse) + err := c.cc.Invoke(ctx, WriteableStore_RemoteWrite_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// WriteableStoreServer is the server API for WriteableStore service. +// All implementations must embed UnimplementedWriteableStoreServer +// for forward compatibility. +// +// / WriteableStore represents API against instance that stores XOR encoded values with label set metadata (e.g Prometheus metrics). +type WriteableStoreServer interface { + // WriteRequest allows you to write metrics to this store via remote write + RemoteWrite(context.Context, *WriteRequest) (*WriteResponse, error) + mustEmbedUnimplementedWriteableStoreServer() +} + +// UnimplementedWriteableStoreServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedWriteableStoreServer struct{} + +func (UnimplementedWriteableStoreServer) RemoteWrite(context.Context, *WriteRequest) (*WriteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoteWrite not implemented") +} +func (UnimplementedWriteableStoreServer) mustEmbedUnimplementedWriteableStoreServer() {} +func (UnimplementedWriteableStoreServer) testEmbeddedByValue() {} + +// UnsafeWriteableStoreServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to WriteableStoreServer will +// result in compilation errors. +type UnsafeWriteableStoreServer interface { + mustEmbedUnimplementedWriteableStoreServer() +} + +func RegisterWriteableStoreServer(s grpc.ServiceRegistrar, srv WriteableStoreServer) { + // If the following call pancis, it indicates UnimplementedWriteableStoreServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&WriteableStore_ServiceDesc, srv) +} + +func _WriteableStore_RemoteWrite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WriteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WriteableStoreServer).RemoteWrite(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WriteableStore_RemoteWrite_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WriteableStoreServer).RemoteWrite(ctx, req.(*WriteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// WriteableStore_ServiceDesc is the grpc.ServiceDesc for WriteableStore service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var WriteableStore_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "thanos.WriteableStore", + HandlerType: (*WriteableStoreServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "RemoteWrite", + Handler: _WriteableStore_RemoteWrite_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "store/storepb/rpc.proto", +} diff --git a/pkg/store/storepb/rpc_grpc_vtpool.pb.go b/pkg/store/storepb/rpc_grpc_vtpool.pb.go new file mode 100644 index 00000000000..0abd65b4ec7 --- /dev/null +++ b/pkg/store/storepb/rpc_grpc_vtpool.pb.go @@ -0,0 +1,49 @@ +// Code generated by protoc-gen-go-grpc-vtpool. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc-vtpool v0.1.0 +// source: store/storepb/rpc.proto + +package storepb + +import ( + context "context" + sync "sync" + + vtproto "github.com/thanos-io/thanos/pkg/vtproto" + grpc "google.golang.org/grpc" +) + +func init() { + for i, m := range WriteableStore_ServiceDesc.Methods { + switch m.MethodName { + case "RemoteWrite": + WriteableStore_ServiceDesc.Methods[i].Handler = _WriteableStore_RemoteWrite_VTPoolHandler + } + } +} + +func _WriteableStore_RemoteWrite_VTPoolHandler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := WriteRequestFromVTPool() + wg := &sync.WaitGroup{} + wg.Add(1) + go func() { + wg.Wait() + in.ReturnToVTPool() + }() + defer wg.Done() + ctx = vtproto.WithReturnWG(ctx, wg) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WriteableStoreServer).RemoteWrite(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WriteableStore_RemoteWrite_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WriteableStoreServer).RemoteWrite(ctx, req.(*WriteRequest)) + } + return interceptor(ctx, in, info, handler) +} diff --git a/pkg/store/storepb/rpc_vtproto.pb.go b/pkg/store/storepb/rpc_vtproto.pb.go new file mode 100644 index 00000000000..03651df7276 --- /dev/null +++ b/pkg/store/storepb/rpc_vtproto.pb.go @@ -0,0 +1,4422 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.1-0.20250313105119-ba97887b0a25 +// source: store/storepb/rpc.proto + +package storepb + +import ( + fmt "fmt" + io "io" + sync "sync" + + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + anypb1 "github.com/planetscale/vtprotobuf/types/known/anypb" + prompb "github.com/thanos-io/thanos/pkg/store/storepb/prompb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *WriteResponse) CloneVT() *WriteResponse { + if m == nil { + return (*WriteResponse)(nil) + } + r := new(WriteResponse) + return r +} + +func (m *WriteResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *WriteRequest) CloneVT() *WriteRequest { + if m == nil { + return (*WriteRequest)(nil) + } + r := WriteRequestFromVTPool() + r.Tenant = m.Tenant + r.Replica = m.Replica + if rhs := m.Timeseries; rhs != nil { + tmpContainer := make([]*prompb.TimeSeries, len(rhs)) + for k, v := range rhs { + if vtpb, ok := interface{}(v).(interface{ CloneVT() *prompb.TimeSeries }); ok { + tmpContainer[k] = vtpb.CloneVT() + } else { + tmpContainer[k] = proto.Clone(v).(*prompb.TimeSeries) + } + } + r.Timeseries = tmpContainer + } + return r +} + +func (m *WriteRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *SeriesRequest) CloneVT() *SeriesRequest { + if m == nil { + return (*SeriesRequest)(nil) + } + r := new(SeriesRequest) + r.MinTime = m.MinTime + r.MaxTime = m.MaxTime + r.MaxResolutionWindow = m.MaxResolutionWindow + r.PartialResponseDisabled = m.PartialResponseDisabled + r.PartialResponseStrategy = m.PartialResponseStrategy + r.SkipChunks = m.SkipChunks + r.Hints = (*anypb.Any)((*anypb1.Any)(m.Hints).CloneVT()) + r.Step = m.Step + r.Range = m.Range + r.QueryHints = m.QueryHints.CloneVT() + r.ShardInfo = m.ShardInfo.CloneVT() + r.Limit = m.Limit + if rhs := m.Matchers; rhs != nil { + tmpContainer := make([]*LabelMatcher, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Matchers = tmpContainer + } + if rhs := m.Aggregates; rhs != nil { + tmpContainer := make([]Aggr, len(rhs)) + copy(tmpContainer, rhs) + r.Aggregates = tmpContainer + } + if rhs := m.WithoutReplicaLabels; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.WithoutReplicaLabels = tmpContainer + } + return r +} + +func (m *SeriesRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *QueryHints) CloneVT() *QueryHints { + if m == nil { + return (*QueryHints)(nil) + } + r := new(QueryHints) + r.StepMillis = m.StepMillis + r.Func = m.Func.CloneVT() + r.Grouping = m.Grouping.CloneVT() + r.Range = m.Range.CloneVT() + return r +} + +func (m *QueryHints) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ShardInfo) CloneVT() *ShardInfo { + if m == nil { + return (*ShardInfo)(nil) + } + r := new(ShardInfo) + r.ShardIndex = m.ShardIndex + r.TotalShards = m.TotalShards + r.By = m.By + if rhs := m.Labels; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Labels = tmpContainer + } + return r +} + +func (m *ShardInfo) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Func) CloneVT() *Func { + if m == nil { + return (*Func)(nil) + } + r := new(Func) + r.Name = m.Name + return r +} + +func (m *Func) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Grouping) CloneVT() *Grouping { + if m == nil { + return (*Grouping)(nil) + } + r := new(Grouping) + r.By = m.By + if rhs := m.Labels; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Labels = tmpContainer + } + return r +} + +func (m *Grouping) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Range) CloneVT() *Range { + if m == nil { + return (*Range)(nil) + } + r := new(Range) + r.Millis = m.Millis + return r +} + +func (m *Range) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *SeriesResponse) CloneVT() *SeriesResponse { + if m == nil { + return (*SeriesResponse)(nil) + } + r := new(SeriesResponse) + if m.Result != nil { + r.Result = m.Result.(interface { + CloneVT() isSeriesResponse_Result + }).CloneVT() + } + return r +} + +func (m *SeriesResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *SeriesResponse_Series) CloneVT() isSeriesResponse_Result { + if m == nil { + return (*SeriesResponse_Series)(nil) + } + r := new(SeriesResponse_Series) + r.Series = m.Series.CloneVT() + return r +} + +func (m *SeriesResponse_Warning) CloneVT() isSeriesResponse_Result { + if m == nil { + return (*SeriesResponse_Warning)(nil) + } + r := new(SeriesResponse_Warning) + r.Warning = m.Warning + return r +} + +func (m *SeriesResponse_Hints) CloneVT() isSeriesResponse_Result { + if m == nil { + return (*SeriesResponse_Hints)(nil) + } + r := new(SeriesResponse_Hints) + r.Hints = (*anypb.Any)((*anypb1.Any)(m.Hints).CloneVT()) + return r +} + +func (m *LabelNamesRequest) CloneVT() *LabelNamesRequest { + if m == nil { + return (*LabelNamesRequest)(nil) + } + r := new(LabelNamesRequest) + r.PartialResponseDisabled = m.PartialResponseDisabled + r.PartialResponseStrategy = m.PartialResponseStrategy + r.Start = m.Start + r.End = m.End + r.Hints = (*anypb.Any)((*anypb1.Any)(m.Hints).CloneVT()) + r.Limit = m.Limit + if rhs := m.Matchers; rhs != nil { + tmpContainer := make([]*LabelMatcher, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Matchers = tmpContainer + } + if rhs := m.WithoutReplicaLabels; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.WithoutReplicaLabels = tmpContainer + } + return r +} + +func (m *LabelNamesRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *LabelNamesResponse) CloneVT() *LabelNamesResponse { + if m == nil { + return (*LabelNamesResponse)(nil) + } + r := new(LabelNamesResponse) + r.Hints = (*anypb.Any)((*anypb1.Any)(m.Hints).CloneVT()) + if rhs := m.Names; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Names = tmpContainer + } + if rhs := m.Warnings; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Warnings = tmpContainer + } + return r +} + +func (m *LabelNamesResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *LabelValuesRequest) CloneVT() *LabelValuesRequest { + if m == nil { + return (*LabelValuesRequest)(nil) + } + r := new(LabelValuesRequest) + r.Label = m.Label + r.PartialResponseDisabled = m.PartialResponseDisabled + r.PartialResponseStrategy = m.PartialResponseStrategy + r.Start = m.Start + r.End = m.End + r.Hints = (*anypb.Any)((*anypb1.Any)(m.Hints).CloneVT()) + r.Limit = m.Limit + if rhs := m.Matchers; rhs != nil { + tmpContainer := make([]*LabelMatcher, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Matchers = tmpContainer + } + if rhs := m.WithoutReplicaLabels; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.WithoutReplicaLabels = tmpContainer + } + return r +} + +func (m *LabelValuesRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *LabelValuesResponse) CloneVT() *LabelValuesResponse { + if m == nil { + return (*LabelValuesResponse)(nil) + } + r := new(LabelValuesResponse) + r.Hints = (*anypb.Any)((*anypb1.Any)(m.Hints).CloneVT()) + if rhs := m.Values; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Values = tmpContainer + } + if rhs := m.Warnings; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Warnings = tmpContainer + } + return r +} + +func (m *LabelValuesResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *WriteResponse) EqualVT(that *WriteResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + return true +} + +func (this *WriteResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*WriteResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *WriteRequest) EqualVT(that *WriteRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Timeseries) != len(that.Timeseries) { + return false + } + for i, vx := range this.Timeseries { + vy := that.Timeseries[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &prompb.TimeSeries{} + } + if q == nil { + q = &prompb.TimeSeries{} + } + if equal, ok := interface{}(p).(interface{ EqualVT(*prompb.TimeSeries) bool }); ok { + if !equal.EqualVT(q) { + return false + } + } else if !proto.Equal(p, q) { + return false + } + } + } + if this.Tenant != that.Tenant { + return false + } + if this.Replica != that.Replica { + return false + } + return true +} + +func (this *WriteRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*WriteRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *SeriesRequest) EqualVT(that *SeriesRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.MinTime != that.MinTime { + return false + } + if this.MaxTime != that.MaxTime { + return false + } + if len(this.Matchers) != len(that.Matchers) { + return false + } + for i, vx := range this.Matchers { + vy := that.Matchers[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &LabelMatcher{} + } + if q == nil { + q = &LabelMatcher{} + } + if !p.EqualVT(q) { + return false + } + } + } + if this.MaxResolutionWindow != that.MaxResolutionWindow { + return false + } + if len(this.Aggregates) != len(that.Aggregates) { + return false + } + for i, vx := range this.Aggregates { + vy := that.Aggregates[i] + if vx != vy { + return false + } + } + if this.PartialResponseDisabled != that.PartialResponseDisabled { + return false + } + if this.PartialResponseStrategy != that.PartialResponseStrategy { + return false + } + if this.SkipChunks != that.SkipChunks { + return false + } + if !(*anypb1.Any)(this.Hints).EqualVT((*anypb1.Any)(that.Hints)) { + return false + } + if this.Step != that.Step { + return false + } + if this.Range != that.Range { + return false + } + if !this.QueryHints.EqualVT(that.QueryHints) { + return false + } + if !this.ShardInfo.EqualVT(that.ShardInfo) { + return false + } + if len(this.WithoutReplicaLabels) != len(that.WithoutReplicaLabels) { + return false + } + for i, vx := range this.WithoutReplicaLabels { + vy := that.WithoutReplicaLabels[i] + if vx != vy { + return false + } + } + if this.Limit != that.Limit { + return false + } + return true +} + +func (this *SeriesRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*SeriesRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *QueryHints) EqualVT(that *QueryHints) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.StepMillis != that.StepMillis { + return false + } + if !this.Func.EqualVT(that.Func) { + return false + } + if !this.Grouping.EqualVT(that.Grouping) { + return false + } + if !this.Range.EqualVT(that.Range) { + return false + } + return true +} + +func (this *QueryHints) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*QueryHints) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ShardInfo) EqualVT(that *ShardInfo) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.ShardIndex != that.ShardIndex { + return false + } + if this.TotalShards != that.TotalShards { + return false + } + if this.By != that.By { + return false + } + if len(this.Labels) != len(that.Labels) { + return false + } + for i, vx := range this.Labels { + vy := that.Labels[i] + if vx != vy { + return false + } + } + return true +} + +func (this *ShardInfo) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ShardInfo) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Func) EqualVT(that *Func) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Name != that.Name { + return false + } + return true +} + +func (this *Func) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Func) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Grouping) EqualVT(that *Grouping) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.By != that.By { + return false + } + if len(this.Labels) != len(that.Labels) { + return false + } + for i, vx := range this.Labels { + vy := that.Labels[i] + if vx != vy { + return false + } + } + return true +} + +func (this *Grouping) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Grouping) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Range) EqualVT(that *Range) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Millis != that.Millis { + return false + } + return true +} + +func (this *Range) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Range) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *SeriesResponse) EqualVT(that *SeriesResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Result == nil && that.Result != nil { + return false + } else if this.Result != nil { + if that.Result == nil { + return false + } + if !this.Result.(interface { + EqualVT(isSeriesResponse_Result) bool + }).EqualVT(that.Result) { + return false + } + } + return true +} + +func (this *SeriesResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*SeriesResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *SeriesResponse_Series) EqualVT(thatIface isSeriesResponse_Result) bool { + that, ok := thatIface.(*SeriesResponse_Series) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Series, that.Series; p != q { + if p == nil { + p = &Series{} + } + if q == nil { + q = &Series{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *SeriesResponse_Warning) EqualVT(thatIface isSeriesResponse_Result) bool { + that, ok := thatIface.(*SeriesResponse_Warning) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.Warning != that.Warning { + return false + } + return true +} + +func (this *SeriesResponse_Hints) EqualVT(thatIface isSeriesResponse_Result) bool { + that, ok := thatIface.(*SeriesResponse_Hints) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Hints, that.Hints; p != q { + if p == nil { + p = &anypb.Any{} + } + if q == nil { + q = &anypb.Any{} + } + if !(*anypb1.Any)(p).EqualVT((*anypb1.Any)(q)) { + return false + } + } + return true +} + +func (this *LabelNamesRequest) EqualVT(that *LabelNamesRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.PartialResponseDisabled != that.PartialResponseDisabled { + return false + } + if this.PartialResponseStrategy != that.PartialResponseStrategy { + return false + } + if this.Start != that.Start { + return false + } + if this.End != that.End { + return false + } + if !(*anypb1.Any)(this.Hints).EqualVT((*anypb1.Any)(that.Hints)) { + return false + } + if len(this.Matchers) != len(that.Matchers) { + return false + } + for i, vx := range this.Matchers { + vy := that.Matchers[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &LabelMatcher{} + } + if q == nil { + q = &LabelMatcher{} + } + if !p.EqualVT(q) { + return false + } + } + } + if len(this.WithoutReplicaLabels) != len(that.WithoutReplicaLabels) { + return false + } + for i, vx := range this.WithoutReplicaLabels { + vy := that.WithoutReplicaLabels[i] + if vx != vy { + return false + } + } + if this.Limit != that.Limit { + return false + } + return true +} + +func (this *LabelNamesRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*LabelNamesRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *LabelNamesResponse) EqualVT(that *LabelNamesResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Names) != len(that.Names) { + return false + } + for i, vx := range this.Names { + vy := that.Names[i] + if vx != vy { + return false + } + } + if len(this.Warnings) != len(that.Warnings) { + return false + } + for i, vx := range this.Warnings { + vy := that.Warnings[i] + if vx != vy { + return false + } + } + if !(*anypb1.Any)(this.Hints).EqualVT((*anypb1.Any)(that.Hints)) { + return false + } + return true +} + +func (this *LabelNamesResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*LabelNamesResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *LabelValuesRequest) EqualVT(that *LabelValuesRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Label != that.Label { + return false + } + if this.PartialResponseDisabled != that.PartialResponseDisabled { + return false + } + if this.PartialResponseStrategy != that.PartialResponseStrategy { + return false + } + if this.Start != that.Start { + return false + } + if this.End != that.End { + return false + } + if !(*anypb1.Any)(this.Hints).EqualVT((*anypb1.Any)(that.Hints)) { + return false + } + if len(this.Matchers) != len(that.Matchers) { + return false + } + for i, vx := range this.Matchers { + vy := that.Matchers[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &LabelMatcher{} + } + if q == nil { + q = &LabelMatcher{} + } + if !p.EqualVT(q) { + return false + } + } + } + if len(this.WithoutReplicaLabels) != len(that.WithoutReplicaLabels) { + return false + } + for i, vx := range this.WithoutReplicaLabels { + vy := that.WithoutReplicaLabels[i] + if vx != vy { + return false + } + } + if this.Limit != that.Limit { + return false + } + return true +} + +func (this *LabelValuesRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*LabelValuesRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *LabelValuesResponse) EqualVT(that *LabelValuesResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Values) != len(that.Values) { + return false + } + for i, vx := range this.Values { + vy := that.Values[i] + if vx != vy { + return false + } + } + if len(this.Warnings) != len(that.Warnings) { + return false + } + for i, vx := range this.Warnings { + vy := that.Warnings[i] + if vx != vy { + return false + } + } + if !(*anypb1.Any)(this.Hints).EqualVT((*anypb1.Any)(that.Hints)) { + return false + } + return true +} + +func (this *LabelValuesResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*LabelValuesResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *WriteResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WriteResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *WriteResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *WriteRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WriteRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *WriteRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.Replica != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Replica)) + i-- + dAtA[i] = 0x18 + } + if len(m.Tenant) > 0 { + i -= len(m.Tenant) + copy(dAtA[i:], m.Tenant) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Tenant))) + i-- + dAtA[i] = 0x12 + } + if len(m.Timeseries) > 0 { + for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.Timeseries[iNdEx]).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Timeseries[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *SeriesRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SeriesRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SeriesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.Limit != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x78 + } + if len(m.WithoutReplicaLabels) > 0 { + for iNdEx := len(m.WithoutReplicaLabels) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WithoutReplicaLabels[iNdEx]) + copy(dAtA[i:], m.WithoutReplicaLabels[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.WithoutReplicaLabels[iNdEx]))) + i-- + dAtA[i] = 0x72 + } + } + if m.ShardInfo != nil { + size, err := m.ShardInfo.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x6a + } + if m.QueryHints != nil { + size, err := m.QueryHints.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x62 + } + if m.Range != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Range)) + i-- + dAtA[i] = 0x58 + } + if m.Step != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Step)) + i-- + dAtA[i] = 0x50 + } + if m.Hints != nil { + size, err := (*anypb1.Any)(m.Hints).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x4a + } + if m.SkipChunks { + i-- + if m.SkipChunks { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.PartialResponseStrategy != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PartialResponseStrategy)) + i-- + dAtA[i] = 0x38 + } + if m.PartialResponseDisabled { + i-- + if m.PartialResponseDisabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if len(m.Aggregates) > 0 { + var pksize2 int + for _, num := range m.Aggregates { + pksize2 += protohelpers.SizeOfVarint(uint64(num)) + } + i -= pksize2 + j1 := i + for _, num1 := range m.Aggregates { + num := uint64(num1) + for num >= 1<<7 { + dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA[j1] = uint8(num) + j1++ + } + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) + i-- + dAtA[i] = 0x2a + } + if m.MaxResolutionWindow != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MaxResolutionWindow)) + i-- + dAtA[i] = 0x20 + } + if len(m.Matchers) > 0 { + for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Matchers[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + } + if m.MaxTime != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MaxTime)) + i-- + dAtA[i] = 0x10 + } + if m.MinTime != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MinTime)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryHints) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryHints) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *QueryHints) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.Range != nil { + size, err := m.Range.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + if m.Grouping != nil { + size, err := m.Grouping.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if m.Func != nil { + size, err := m.Func.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.StepMillis != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StepMillis)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ShardInfo) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ShardInfo) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ShardInfo) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Labels) > 0 { + for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Labels[iNdEx]) + copy(dAtA[i:], m.Labels[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Labels[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if m.By { + i-- + if m.By { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.TotalShards != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TotalShards)) + i-- + dAtA[i] = 0x10 + } + if m.ShardIndex != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ShardIndex)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Func) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Func) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Func) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Grouping) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Grouping) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Grouping) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Labels) > 0 { + for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Labels[iNdEx]) + copy(dAtA[i:], m.Labels[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Labels[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if m.By { + i-- + if m.By { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Range) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Range) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Range) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.Millis != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Millis)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SeriesResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SeriesResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SeriesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if vtmsg, ok := m.Result.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *SeriesResponse_Series) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SeriesResponse_Series) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Series != nil { + size, err := m.Series.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *SeriesResponse_Warning) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SeriesResponse_Warning) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Warning) + copy(dAtA[i:], m.Warning) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Warning))) + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil +} +func (m *SeriesResponse_Hints) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SeriesResponse_Hints) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Hints != nil { + size, err := (*anypb1.Any)(m.Hints).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *LabelNamesRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LabelNamesRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LabelNamesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.Limit != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x40 + } + if len(m.WithoutReplicaLabels) > 0 { + for iNdEx := len(m.WithoutReplicaLabels) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WithoutReplicaLabels[iNdEx]) + copy(dAtA[i:], m.WithoutReplicaLabels[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.WithoutReplicaLabels[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if len(m.Matchers) > 0 { + for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Matchers[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + } + if m.Hints != nil { + size, err := (*anypb1.Any)(m.Hints).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + if m.End != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.End)) + i-- + dAtA[i] = 0x20 + } + if m.Start != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) + i-- + dAtA[i] = 0x18 + } + if m.PartialResponseStrategy != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PartialResponseStrategy)) + i-- + dAtA[i] = 0x10 + } + if m.PartialResponseDisabled { + i-- + if m.PartialResponseDisabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *LabelNamesResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LabelNamesResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LabelNamesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.Hints != nil { + size, err := (*anypb1.Any)(m.Hints).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if len(m.Warnings) > 0 { + for iNdEx := len(m.Warnings) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Warnings[iNdEx]) + copy(dAtA[i:], m.Warnings[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Warnings[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *LabelValuesRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LabelValuesRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LabelValuesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.Limit != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x48 + } + if len(m.WithoutReplicaLabels) > 0 { + for iNdEx := len(m.WithoutReplicaLabels) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WithoutReplicaLabels[iNdEx]) + copy(dAtA[i:], m.WithoutReplicaLabels[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.WithoutReplicaLabels[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if len(m.Matchers) > 0 { + for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Matchers[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + } + if m.Hints != nil { + size, err := (*anypb1.Any)(m.Hints).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + if m.End != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.End)) + i-- + dAtA[i] = 0x28 + } + if m.Start != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) + i-- + dAtA[i] = 0x20 + } + if m.PartialResponseStrategy != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PartialResponseStrategy)) + i-- + dAtA[i] = 0x18 + } + if m.PartialResponseDisabled { + i-- + if m.PartialResponseDisabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Label) > 0 { + i -= len(m.Label) + copy(dAtA[i:], m.Label) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Label))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LabelValuesResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LabelValuesResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LabelValuesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.Hints != nil { + size, err := (*anypb1.Any)(m.Hints).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if len(m.Warnings) > 0 { + for iNdEx := len(m.Warnings) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Warnings[iNdEx]) + copy(dAtA[i:], m.Warnings[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Warnings[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Values) > 0 { + for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Values[iNdEx]) + copy(dAtA[i:], m.Values[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Values[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +var vtprotoPool_WriteRequest = sync.Pool{ + New: func() interface{} { + return &WriteRequest{} + }, +} + +func (m *WriteRequest) ResetVT() { + if m != nil { + for _, mm := range m.Timeseries { + mm.ResetVT() + } + f0 := m.Timeseries[:0] + m.Reset() + m.Timeseries = f0 + } +} +func (m *WriteRequest) ReturnToVTPool() { + if m != nil { + m.ResetVT() + vtprotoPool_WriteRequest.Put(m) + } +} +func WriteRequestFromVTPool() *WriteRequest { + return vtprotoPool_WriteRequest.Get().(*WriteRequest) +} +func (m *WriteResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *WriteRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Timeseries) > 0 { + for _, e := range m.Timeseries { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + l = len(m.Tenant) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Replica != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Replica)) + } + return n +} + +func (m *SeriesRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MinTime != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MinTime)) + } + if m.MaxTime != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MaxTime)) + } + if len(m.Matchers) > 0 { + for _, e := range m.Matchers { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.MaxResolutionWindow != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MaxResolutionWindow)) + } + if len(m.Aggregates) > 0 { + l = 0 + for _, e := range m.Aggregates { + l += protohelpers.SizeOfVarint(uint64(e)) + } + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l + } + if m.PartialResponseDisabled { + n += 2 + } + if m.PartialResponseStrategy != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PartialResponseStrategy)) + } + if m.SkipChunks { + n += 2 + } + if m.Hints != nil { + l = (*anypb1.Any)(m.Hints).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Step != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Step)) + } + if m.Range != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Range)) + } + if m.QueryHints != nil { + l = m.QueryHints.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ShardInfo != nil { + l = m.ShardInfo.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.WithoutReplicaLabels) > 0 { + for _, s := range m.WithoutReplicaLabels { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.Limit != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Limit)) + } + return n +} + +func (m *QueryHints) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StepMillis != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StepMillis)) + } + if m.Func != nil { + l = m.Func.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Grouping != nil { + l = m.Grouping.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Range != nil { + l = m.Range.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *ShardInfo) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ShardIndex != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ShardIndex)) + } + if m.TotalShards != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.TotalShards)) + } + if m.By { + n += 2 + } + if len(m.Labels) > 0 { + for _, s := range m.Labels { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *Func) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *Grouping) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.By { + n += 2 + } + if len(m.Labels) > 0 { + for _, s := range m.Labels { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *Range) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Millis != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Millis)) + } + return n +} + +func (m *SeriesResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Result.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + return n +} + +func (m *SeriesResponse_Series) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Series != nil { + l = m.Series.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *SeriesResponse_Warning) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Warning) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return n +} +func (m *SeriesResponse_Hints) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Hints != nil { + l = (*anypb1.Any)(m.Hints).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *LabelNamesRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PartialResponseDisabled { + n += 2 + } + if m.PartialResponseStrategy != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PartialResponseStrategy)) + } + if m.Start != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) + } + if m.End != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.End)) + } + if m.Hints != nil { + l = (*anypb1.Any)(m.Hints).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Matchers) > 0 { + for _, e := range m.Matchers { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.WithoutReplicaLabels) > 0 { + for _, s := range m.WithoutReplicaLabels { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.Limit != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Limit)) + } + return n +} + +func (m *LabelNamesResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Names) > 0 { + for _, s := range m.Names { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.Warnings) > 0 { + for _, s := range m.Warnings { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.Hints != nil { + l = (*anypb1.Any)(m.Hints).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *LabelValuesRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Label) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.PartialResponseDisabled { + n += 2 + } + if m.PartialResponseStrategy != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PartialResponseStrategy)) + } + if m.Start != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) + } + if m.End != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.End)) + } + if m.Hints != nil { + l = (*anypb1.Any)(m.Hints).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Matchers) > 0 { + for _, e := range m.Matchers { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.WithoutReplicaLabels) > 0 { + for _, s := range m.WithoutReplicaLabels { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.Limit != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Limit)) + } + return n +} + +func (m *LabelValuesResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Values) > 0 { + for _, s := range m.Values { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.Warnings) > 0 { + for _, s := range m.Warnings { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.Hints != nil { + l = (*anypb1.Any)(m.Hints).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *WriteResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WriteResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WriteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WriteRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WriteRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WriteRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if len(m.Timeseries) == cap(m.Timeseries) { + m.Timeseries = append(m.Timeseries, &prompb.TimeSeries{}) + } else { + m.Timeseries = m.Timeseries[:len(m.Timeseries)+1] + if m.Timeseries[len(m.Timeseries)-1] == nil { + m.Timeseries[len(m.Timeseries)-1] = &prompb.TimeSeries{} + } + } + if unmarshal, ok := interface{}(m.Timeseries[len(m.Timeseries)-1]).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Timeseries[len(m.Timeseries)-1]); err != nil { + return err + } + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tenant", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tenant = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Replica", wireType) + } + m.Replica = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Replica |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SeriesRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SeriesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SeriesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinTime", wireType) + } + m.MinTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxTime", wireType) + } + m.MaxTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Matchers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Matchers = append(m.Matchers, &LabelMatcher{}) + if err := m.Matchers[len(m.Matchers)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxResolutionWindow", wireType) + } + m.MaxResolutionWindow = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxResolutionWindow |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType == 0 { + var v Aggr + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= Aggr(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Aggregates = append(m.Aggregates, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + if elementCount != 0 && len(m.Aggregates) == 0 { + m.Aggregates = make([]Aggr, 0, elementCount) + } + for iNdEx < postIndex { + var v Aggr + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= Aggr(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Aggregates = append(m.Aggregates, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Aggregates", wireType) + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseDisabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PartialResponseDisabled = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) + } + m.PartialResponseStrategy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PartialResponseStrategy |= PartialResponseStrategy(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipChunks", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SkipChunks = bool(v != 0) + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Hints == nil { + m.Hints = &anypb.Any{} + } + if err := (*anypb1.Any)(m.Hints).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) + } + m.Step = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Step |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Range", wireType) + } + m.Range = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Range |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryHints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.QueryHints == nil { + m.QueryHints = &QueryHints{} + } + if err := m.QueryHints.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShardInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ShardInfo == nil { + m.ShardInfo = &ShardInfo{} + } + if err := m.ShardInfo.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WithoutReplicaLabels", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WithoutReplicaLabels = append(m.WithoutReplicaLabels, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryHints) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryHints: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryHints: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StepMillis", wireType) + } + m.StepMillis = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StepMillis |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Func", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Func == nil { + m.Func = &Func{} + } + if err := m.Func.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grouping", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Grouping == nil { + m.Grouping = &Grouping{} + } + if err := m.Grouping.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Range", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Range == nil { + m.Range = &Range{} + } + if err := m.Range.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ShardInfo) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ShardInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ShardInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ShardIndex", wireType) + } + m.ShardIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ShardIndex |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalShards", wireType) + } + m.TotalShards = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalShards |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field By", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.By = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Labels = append(m.Labels, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Func) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Func: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Func: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Grouping) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Grouping: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Grouping: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field By", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.By = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Labels = append(m.Labels, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Range) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Range: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Range: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Millis", wireType) + } + m.Millis = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Millis |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SeriesResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SeriesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SeriesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Series", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Result.(*SeriesResponse_Series); ok { + if err := oneof.Series.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Series{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Result = &SeriesResponse_Series{Series: v} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Warning", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Result = &SeriesResponse_Warning{Warning: string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Result.(*SeriesResponse_Hints); ok { + if err := (*anypb1.Any)(oneof.Hints).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &anypb.Any{} + if err := (*anypb1.Any)(v).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Result = &SeriesResponse_Hints{Hints: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LabelNamesRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LabelNamesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LabelNamesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseDisabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PartialResponseDisabled = bool(v != 0) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) + } + m.PartialResponseStrategy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PartialResponseStrategy |= PartialResponseStrategy(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) + } + m.Start = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Start |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) + } + m.End = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.End |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Hints == nil { + m.Hints = &anypb.Any{} + } + if err := (*anypb1.Any)(m.Hints).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Matchers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Matchers = append(m.Matchers, &LabelMatcher{}) + if err := m.Matchers[len(m.Matchers)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WithoutReplicaLabels", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WithoutReplicaLabels = append(m.WithoutReplicaLabels, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LabelNamesResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LabelNamesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LabelNamesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Warnings", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Warnings = append(m.Warnings, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Hints == nil { + m.Hints = &anypb.Any{} + } + if err := (*anypb1.Any)(m.Hints).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LabelValuesRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LabelValuesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LabelValuesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Label = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseDisabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PartialResponseDisabled = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) + } + m.PartialResponseStrategy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PartialResponseStrategy |= PartialResponseStrategy(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) + } + m.Start = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Start |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) + } + m.End = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.End |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Hints == nil { + m.Hints = &anypb.Any{} + } + if err := (*anypb1.Any)(m.Hints).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Matchers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Matchers = append(m.Matchers, &LabelMatcher{}) + if err := m.Matchers[len(m.Matchers)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WithoutReplicaLabels", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WithoutReplicaLabels = append(m.WithoutReplicaLabels, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LabelValuesResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LabelValuesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LabelValuesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Values = append(m.Values, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Warnings", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Warnings = append(m.Warnings, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Hints == nil { + m.Hints = &anypb.Any{} + } + if err := (*anypb1.Any)(m.Hints).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pkg/store/storepb/shard_info.go b/pkg/store/storepb/shard_info.go index 28d559b49a0..e24ebde3088 100644 --- a/pkg/store/storepb/shard_info.go +++ b/pkg/store/storepb/shard_info.go @@ -7,7 +7,6 @@ import ( "sync" "github.com/cespare/xxhash/v2" - "github.com/prometheus/prometheus/model/labels" "github.com/thanos-io/thanos/pkg/store/labelpb" ) @@ -37,14 +36,14 @@ func (s *ShardMatcher) Close() { } } -func (s *ShardMatcher) MatchesZLabels(zLabels []labelpb.ZLabel) bool { +func (s *ShardMatcher) MatchesLabels(lbls labelpb.Labels) bool { // Match all series when query is not sharded if s == nil || !s.isSharded { return true } *s.buf = (*s.buf)[:0] - for _, lbl := range zLabels { + for _, lbl := range lbls { if shardByLabel(s.shardingLabelset, lbl, s.by) { *s.buf = append(*s.buf, lbl.Name...) *s.buf = append(*s.buf, sep[0]) @@ -57,12 +56,8 @@ func (s *ShardMatcher) MatchesZLabels(zLabels []labelpb.ZLabel) bool { return hash%uint64(s.totalShards) == uint64(s.shardIndex) } -func (s *ShardMatcher) MatchesLabels(lbls labels.Labels) bool { - return s.MatchesZLabels(labelpb.ZLabelsFromPromLabels(lbls)) -} - -func shardByLabel(labelSet map[string]struct{}, zlabel labelpb.ZLabel, groupingBy bool) bool { - _, shardHasLabel := labelSet[zlabel.Name] +func shardByLabel(labelSet map[string]struct{}, lbl *labelpb.Label, groupingBy bool) bool { + _, shardHasLabel := labelSet[lbl.Name] if groupingBy && shardHasLabel { return true } diff --git a/pkg/store/storepb/shard_info_test.go b/pkg/store/storepb/shard_info_test.go index ff1ef0972a7..7b17b367d54 100644 --- a/pkg/store/storepb/shard_info_test.go +++ b/pkg/store/storepb/shard_info_test.go @@ -9,21 +9,20 @@ import ( "github.com/alecthomas/units" - "github.com/prometheus/prometheus/model/labels" "github.com/thanos-io/thanos/pkg/store/labelpb" ) func TestShardInfo_MatchesSeries(t *testing.T) { - series := labelpb.ZLabelsFromPromLabels(labels.FromStrings( - "pod", "nginx", - "node", "node-1", + series := labelpb.FromStrings( "container", "nginx", - )) + "node", "node-1", + "pod", "nginx", + ) tests := []struct { name string shardInfo *ShardInfo - series []labelpb.ZLabel + series labelpb.Labels matches bool }{ { @@ -118,7 +117,7 @@ func TestShardInfo_MatchesSeries(t *testing.T) { t.Run(test.name, func(t *testing.T) { matcher := test.shardInfo.Matcher(&buffers) defer matcher.Close() - isMatch := matcher.MatchesZLabels(test.series) + isMatch := matcher.MatchesLabels(test.series) if isMatch != test.matches { t.Fatalf("invalid result, got %t, want %t", isMatch, test.matches) } diff --git a/pkg/store/storepb/testutil/client.go b/pkg/store/storepb/testutil/client.go index 4587c42f375..eda9bd06513 100644 --- a/pkg/store/storepb/testutil/client.go +++ b/pkg/store/storepb/testutil/client.go @@ -7,6 +7,7 @@ import ( "github.com/prometheus/prometheus/model/labels" "github.com/thanos-io/thanos/pkg/info/infopb" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" ) @@ -15,26 +16,26 @@ type TestClient struct { Name string - ExtLset []labels.Labels + ExtLset []labelpb.Labels MinTime, MaxTime int64 Shardable bool WithoutReplicaLabelsEnabled bool IsLocalStore bool - StoreTSDBInfos []infopb.TSDBInfo + StoreTSDBInfos []*infopb.TSDBInfo StoreFilterNotMatches bool GroupKeyStr string ReplicaKeyStr string } -func (c TestClient) LabelSets() []labels.Labels { return c.ExtLset } -func (c TestClient) TimeRange() (mint, maxt int64) { return c.MinTime, c.MaxTime } -func (c TestClient) TSDBInfos() []infopb.TSDBInfo { return c.StoreTSDBInfos } -func (c TestClient) SupportsSharding() bool { return c.Shardable } -func (c TestClient) SupportsWithoutReplicaLabels() bool { return c.WithoutReplicaLabelsEnabled } -func (c TestClient) String() string { return c.Name } -func (c TestClient) Addr() (string, bool) { return c.Name, c.IsLocalStore } +func (c *TestClient) LabelSets() []labelpb.Labels { return c.ExtLset } +func (c *TestClient) TimeRange() (mint, maxt int64) { return c.MinTime, c.MaxTime } +func (c *TestClient) TSDBInfos() []*infopb.TSDBInfo { return c.StoreTSDBInfos } +func (c *TestClient) SupportsSharding() bool { return c.Shardable } +func (c *TestClient) SupportsWithoutReplicaLabels() bool { return c.WithoutReplicaLabelsEnabled } +func (c *TestClient) String() string { return c.Name } +func (c *TestClient) Addr() (string, bool) { return c.Name, c.IsLocalStore } -func (c TestClient) Matches(matches []*labels.Matcher) bool { return !c.StoreFilterNotMatches } +func (c *TestClient) Matches(matches []*labels.Matcher) bool { return !c.StoreFilterNotMatches } -func (c TestClient) GroupKey() string { return c.GroupKeyStr } -func (c TestClient) ReplicaKey() string { return c.ReplicaKeyStr } +func (c *TestClient) GroupKey() string { return c.GroupKeyStr } +func (c *TestClient) ReplicaKey() string { return c.ReplicaKeyStr } diff --git a/pkg/store/storepb/testutil/series.go b/pkg/store/storepb/testutil/series.go index bdb8a33fee6..a33626f316f 100644 --- a/pkg/store/storepb/testutil/series.go +++ b/pkg/store/storepb/testutil/series.go @@ -18,7 +18,6 @@ import ( "github.com/cespare/xxhash" "github.com/efficientgo/core/testutil" "github.com/go-kit/log" - "github.com/gogo/protobuf/types" "github.com/oklog/ulid" "github.com/prometheus/prometheus/model/histogram" "github.com/prometheus/prometheus/model/labels" @@ -28,7 +27,9 @@ import ( "github.com/prometheus/prometheus/tsdb/chunks" "github.com/prometheus/prometheus/tsdb/index" "github.com/prometheus/prometheus/tsdb/wlog" + thanostestutil "github.com/thanos-io/thanos/pkg/testutil" "go.uber.org/atomic" + anypb "google.golang.org/protobuf/types/known/anypb" "github.com/thanos-io/thanos/pkg/store/hintspb" "github.com/thanos-io/thanos/pkg/store/labelpb" @@ -53,7 +54,7 @@ type HeadGenOptions struct { ScrapeInterval time.Duration WithWAL bool - PrependLabels labels.Labels + PrependLabels labelpb.Labels SkipChunks bool // Skips chunks in returned slice (not in generated head!). SampleType chunkenc.ValueType @@ -130,7 +131,7 @@ func CreateHeadWithSeries(t testing.TB, j int, opts HeadGenOptions) (*tsdb.Head, return h, ReadSeriesFromBlock(t, h, opts.PrependLabels, opts.SkipChunks) } -func ReadSeriesFromBlock(t testing.TB, h tsdb.BlockReader, extLabels labels.Labels, skipChunks bool) []*storepb.Series { +func ReadSeriesFromBlock(t testing.TB, h tsdb.BlockReader, extLabels labelpb.Labels, skipChunks bool) []*storepb.Series { // Use TSDB and get all series for assertion. chks, err := h.Chunks() testutil.Ok(t, err) @@ -150,8 +151,8 @@ func ReadSeriesFromBlock(t testing.TB, h tsdb.BlockReader, extLabels labels.Labe all := allPostings(context.TODO(), t, ir) for all.Next() { testutil.Ok(t, ir.Series(all.At(), &builder, &chunkMetas)) - lset := labelpb.ExtendSortedLabels(builder.Labels(), extLabels) - expected = append(expected, &storepb.Series{Labels: labelpb.ZLabelsFromPromLabels(lset)}) + lset := labelpb.ExtendSortedLabels(labelpb.FromPromLabels(builder.Labels()), extLabels) + expected = append(expected, &storepb.Series{Labels: lset}) if skipChunks { continue @@ -167,7 +168,7 @@ func ReadSeriesFromBlock(t testing.TB, h tsdb.BlockReader, extLabels labels.Labe c.MaxTime = c.MinTime + int64(chEnc.NumSamples()) - 1 } - expected[len(expected)-1].Chunks = append(expected[len(expected)-1].Chunks, storepb.AggrChunk{ + expected[len(expected)-1].Chunks = append(expected[len(expected)-1].Chunks, &storepb.AggrChunk{ MinTime: c.MinTime, MaxTime: c.MaxTime, Raw: &storepb.Chunk{ @@ -268,7 +269,7 @@ type SeriesServer struct { SeriesSet []*storepb.Series Warnings []string - HintsSet []*types.Any + HintsSet []*anypb.Any Size int64 } @@ -278,7 +279,7 @@ func NewSeriesServer(ctx context.Context) *SeriesServer { } func (s *SeriesServer) Send(r *storepb.SeriesResponse) error { - s.Size += int64(r.Size()) + s.Size += int64(r.SizeVT()) if r.GetWarning() != "" { s.Warnings = append(s.Warnings, r.GetWarning()) @@ -337,8 +338,8 @@ type SeriesCase struct { // Exact expectations are checked only for tests. For benchmarks only length is assured. ExpectedSeries []*storepb.Series ExpectedWarnings []string - ExpectedHints []hintspb.SeriesResponseHints - HintsCompareFunc func(t testutil.TB, expected, actual hintspb.SeriesResponseHints) + ExpectedHints []*hintspb.SeriesResponseHints + HintsCompareFunc func(t testutil.TB, expected, actual *hintspb.SeriesResponseHints) } // TestServerSeries runs tests against given cases. @@ -364,7 +365,7 @@ func TestServerSeries(t testutil.TB, store storepb.StoreServer, cases ...*Series // Huge responses can produce unreadable diffs - make it more human readable. if len(c.ExpectedSeries) > 4 { for j := range c.ExpectedSeries { - testutil.Equals(t, c.ExpectedSeries[j].Labels, srv.SeriesSet[j].Labels) + thanostestutil.ProtoEquals(t, c.ExpectedSeries[j].Labels, srv.SeriesSet[j].Labels) // Check chunks when it is not a skip chunk query if !c.Req.SkipChunks { @@ -372,27 +373,27 @@ func TestServerSeries(t testutil.TB, store storepb.StoreServer, cases ...*Series testutil.Equals(t, len(c.ExpectedSeries[j].Chunks), len(srv.SeriesSet[j].Chunks), "%v series chunks number mismatch", j) } for ci := range c.ExpectedSeries[j].Chunks { - testutil.Equals(t, c.ExpectedSeries[j].Chunks[ci], srv.SeriesSet[j].Chunks[ci], "%v series chunks mismatch %v", j, ci) + thanostestutil.ProtoEquals(t, c.ExpectedSeries[j].Chunks[ci], srv.SeriesSet[j].Chunks[ci], "%v series chunks mismatch %v", j, ci) } } } } else { testutil.Equals(t, true, len(c.ExpectedSeries) == len(srv.SeriesSet)) for i := range c.ExpectedSeries { - testutil.Equals(t, c.ExpectedSeries[i], srv.SeriesSet[i]) + thanostestutil.ProtoEquals(t, c.ExpectedSeries[i], srv.SeriesSet[i]) } } - var actualHints []hintspb.SeriesResponseHints + var actualHints []*hintspb.SeriesResponseHints for _, anyHints := range srv.HintsSet { - hints := hintspb.SeriesResponseHints{} - testutil.Ok(t, types.UnmarshalAny(anyHints, &hints)) + hints := &hintspb.SeriesResponseHints{} + testutil.Ok(t, anyHints.UnmarshalTo(hints)) actualHints = append(actualHints, hints) } testutil.Equals(t, len(c.ExpectedHints), len(actualHints)) for i, hint := range actualHints { if c.HintsCompareFunc == nil { - testutil.Equals(t, c.ExpectedHints[i], hint) + thanostestutil.ProtoEquals(t, c.ExpectedHints[i], hint) } else { c.HintsCompareFunc(t, c.ExpectedHints[i], hint) } diff --git a/pkg/store/storepb/types.pb.go b/pkg/store/storepb/types.pb.go index 5d0a1f9867f..6016bc12809 100644 --- a/pkg/store/storepb/types.pb.go +++ b/pkg/store/storepb/types.pb.go @@ -1,70 +1,91 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.20.1 // source: store/storepb/types.proto package storepb import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/thanos-io/thanos/pkg/store/labelpb" - github_com_thanos_io_thanos_pkg_store_labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" -) + reflect "reflect" + sync "sync" -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf + _ "github.com/srikrsna/protoc-gen-gotag/tagger" + labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) // / PartialResponseStrategy controls partial response handling. type PartialResponseStrategy int32 const ( - /// WARN strategy tells server to treat any error that will related to single StoreAPI (e.g missing chunk series because of underlying - /// storeAPI is temporarily not available) as warning which will not fail the whole query (still OK response). - /// Server should produce those as a warnings field in response. + // / WARN strategy tells server to treat any error that will related to single StoreAPI (e.g missing chunk series because of underlying + // / storeAPI is temporarily not available) as warning which will not fail the whole query (still OK response). + // / Server should produce those as a warnings field in response. PartialResponseStrategy_WARN PartialResponseStrategy = 0 - /// ABORT strategy tells server to treat any error that will related to single StoreAPI (e.g missing chunk series because of underlying - /// storeAPI is temporarily not available) as the gRPC error that aborts the query. - /// - /// This is especially useful for any rule/alert evaluations on top of StoreAPI which usually does not tolerate partial - /// errors. + // / ABORT strategy tells server to treat any error that will related to single StoreAPI (e.g missing chunk series because of underlying + // / storeAPI is temporarily not available) as the gRPC error that aborts the query. + // / + // / This is especially useful for any rule/alert evaluations on top of StoreAPI which usually does not tolerate partial + // / errors. PartialResponseStrategy_ABORT PartialResponseStrategy = 1 - /// A group has one or more replicas. A replica has one or more endpoints. - /// If a group has one replica, the replica can only tolerate one endpoint failure. - /// If a group has more than one replicas, the group can tolerate any number of endpoint failures within one replica. It doesn't - /// tolerate endpoint failures across replicas. + // / A group has one or more replicas. A replica has one or more endpoints. + // / If a group has one replica, the replica can only tolerate one endpoint failure. + // / If a group has more than one replicas, the group can tolerate any number of endpoint failures within one replica. It doesn't + // / tolerate endpoint failures across replicas. PartialResponseStrategy_GROUP_REPLICA PartialResponseStrategy = 2 ) -var PartialResponseStrategy_name = map[int32]string{ - 0: "WARN", - 1: "ABORT", - 2: "GROUP_REPLICA", -} +// Enum value maps for PartialResponseStrategy. +var ( + PartialResponseStrategy_name = map[int32]string{ + 0: "WARN", + 1: "ABORT", + 2: "GROUP_REPLICA", + } + PartialResponseStrategy_value = map[string]int32{ + "WARN": 0, + "ABORT": 1, + "GROUP_REPLICA": 2, + } +) -var PartialResponseStrategy_value = map[string]int32{ - "WARN": 0, - "ABORT": 1, - "GROUP_REPLICA": 2, +func (x PartialResponseStrategy) Enum() *PartialResponseStrategy { + p := new(PartialResponseStrategy) + *p = x + return p } func (x PartialResponseStrategy) String() string { - return proto.EnumName(PartialResponseStrategy_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } +func (PartialResponseStrategy) Descriptor() protoreflect.EnumDescriptor { + return file_store_storepb_types_proto_enumTypes[0].Descriptor() +} + +func (PartialResponseStrategy) Type() protoreflect.EnumType { + return &file_store_storepb_types_proto_enumTypes[0] +} + +func (x PartialResponseStrategy) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PartialResponseStrategy.Descriptor instead. func (PartialResponseStrategy) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []int{0} + return file_store_storepb_types_proto_rawDescGZIP(), []int{0} } type Chunk_Encoding int32 @@ -75,135 +96,218 @@ const ( Chunk_FLOAT_HISTOGRAM Chunk_Encoding = 2 ) -var Chunk_Encoding_name = map[int32]string{ - 0: "XOR", - 1: "HISTOGRAM", - 2: "FLOAT_HISTOGRAM", -} +// Enum value maps for Chunk_Encoding. +var ( + Chunk_Encoding_name = map[int32]string{ + 0: "XOR", + 1: "HISTOGRAM", + 2: "FLOAT_HISTOGRAM", + } + Chunk_Encoding_value = map[string]int32{ + "XOR": 0, + "HISTOGRAM": 1, + "FLOAT_HISTOGRAM": 2, + } +) -var Chunk_Encoding_value = map[string]int32{ - "XOR": 0, - "HISTOGRAM": 1, - "FLOAT_HISTOGRAM": 2, +func (x Chunk_Encoding) Enum() *Chunk_Encoding { + p := new(Chunk_Encoding) + *p = x + return p } func (x Chunk_Encoding) String() string { - return proto.EnumName(Chunk_Encoding_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Chunk_Encoding) Descriptor() protoreflect.EnumDescriptor { + return file_store_storepb_types_proto_enumTypes[1].Descriptor() +} + +func (Chunk_Encoding) Type() protoreflect.EnumType { + return &file_store_storepb_types_proto_enumTypes[1] } +func (x Chunk_Encoding) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Chunk_Encoding.Descriptor instead. func (Chunk_Encoding) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []int{0, 0} + return file_store_storepb_types_proto_rawDescGZIP(), []int{0, 0} } type LabelMatcher_Type int32 const ( - LabelMatcher_EQ LabelMatcher_Type = 0 - LabelMatcher_NEQ LabelMatcher_Type = 1 - LabelMatcher_RE LabelMatcher_Type = 2 - LabelMatcher_NRE LabelMatcher_Type = 3 + LabelMatcher_EQ LabelMatcher_Type = 0 // = + LabelMatcher_NEQ LabelMatcher_Type = 1 // != + LabelMatcher_RE LabelMatcher_Type = 2 // =~ + LabelMatcher_NRE LabelMatcher_Type = 3 // !~ ) -var LabelMatcher_Type_name = map[int32]string{ - 0: "EQ", - 1: "NEQ", - 2: "RE", - 3: "NRE", -} +// Enum value maps for LabelMatcher_Type. +var ( + LabelMatcher_Type_name = map[int32]string{ + 0: "EQ", + 1: "NEQ", + 2: "RE", + 3: "NRE", + } + LabelMatcher_Type_value = map[string]int32{ + "EQ": 0, + "NEQ": 1, + "RE": 2, + "NRE": 3, + } +) -var LabelMatcher_Type_value = map[string]int32{ - "EQ": 0, - "NEQ": 1, - "RE": 2, - "NRE": 3, +func (x LabelMatcher_Type) Enum() *LabelMatcher_Type { + p := new(LabelMatcher_Type) + *p = x + return p } func (x LabelMatcher_Type) String() string { - return proto.EnumName(LabelMatcher_Type_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (LabelMatcher_Type) Descriptor() protoreflect.EnumDescriptor { + return file_store_storepb_types_proto_enumTypes[2].Descriptor() +} + +func (LabelMatcher_Type) Type() protoreflect.EnumType { + return &file_store_storepb_types_proto_enumTypes[2] +} + +func (x LabelMatcher_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } +// Deprecated: Use LabelMatcher_Type.Descriptor instead. func (LabelMatcher_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []int{3, 0} + return file_store_storepb_types_proto_rawDescGZIP(), []int{3, 0} } type Chunk struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Type Chunk_Encoding `protobuf:"varint,1,opt,name=type,proto3,enum=thanos.Chunk_Encoding" json:"type,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` Hash uint64 `protobuf:"varint,3,opt,name=hash,proto3" json:"hash,omitempty"` } -func (m *Chunk) Reset() { *m = Chunk{} } -func (m *Chunk) String() string { return proto.CompactTextString(m) } -func (*Chunk) ProtoMessage() {} -func (*Chunk) Descriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []int{0} +func (x *Chunk) Reset() { + *x = Chunk{} + mi := &file_store_storepb_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Chunk) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *Chunk) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Chunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Chunk.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*Chunk) ProtoMessage() {} + +func (x *Chunk) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *Chunk) XXX_Merge(src proto.Message) { - xxx_messageInfo_Chunk.Merge(m, src) + +// Deprecated: Use Chunk.ProtoReflect.Descriptor instead. +func (*Chunk) Descriptor() ([]byte, []int) { + return file_store_storepb_types_proto_rawDescGZIP(), []int{0} } -func (m *Chunk) XXX_Size() int { - return m.Size() + +func (x *Chunk) GetType() Chunk_Encoding { + if x != nil { + return x.Type + } + return Chunk_XOR } -func (m *Chunk) XXX_DiscardUnknown() { - xxx_messageInfo_Chunk.DiscardUnknown(m) + +func (x *Chunk) GetData() []byte { + if x != nil { + return x.Data + } + return nil } -var xxx_messageInfo_Chunk proto.InternalMessageInfo +func (x *Chunk) GetHash() uint64 { + if x != nil { + return x.Hash + } + return 0 +} type Series struct { - Labels []github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel" json:"labels"` - Chunks []AggrChunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Labels []*labelpb.Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` + Chunks []*AggrChunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks"` } -func (m *Series) Reset() { *m = Series{} } -func (m *Series) String() string { return proto.CompactTextString(m) } -func (*Series) ProtoMessage() {} -func (*Series) Descriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []int{1} +func (x *Series) Reset() { + *x = Series{} + mi := &file_store_storepb_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Series) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *Series) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Series) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Series.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*Series) ProtoMessage() {} + +func (x *Series) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *Series) XXX_Merge(src proto.Message) { - xxx_messageInfo_Series.Merge(m, src) -} -func (m *Series) XXX_Size() int { - return m.Size() + +// Deprecated: Use Series.ProtoReflect.Descriptor instead. +func (*Series) Descriptor() ([]byte, []int) { + return file_store_storepb_types_proto_rawDescGZIP(), []int{1} } -func (m *Series) XXX_DiscardUnknown() { - xxx_messageInfo_Series.DiscardUnknown(m) + +func (x *Series) GetLabels() []*labelpb.Label { + if x != nil { + return x.Labels + } + return nil } -var xxx_messageInfo_Series proto.InternalMessageInfo +func (x *Series) GetChunks() []*AggrChunk { + if x != nil { + return x.Chunks + } + return nil +} type AggrChunk struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + MinTime int64 `protobuf:"varint,1,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` MaxTime int64 `protobuf:"varint,2,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` Raw *Chunk `protobuf:"bytes,3,opt,name=raw,proto3" json:"raw,omitempty"` @@ -214,1244 +318,281 @@ type AggrChunk struct { Counter *Chunk `protobuf:"bytes,8,opt,name=counter,proto3" json:"counter,omitempty"` } -func (m *AggrChunk) Reset() { *m = AggrChunk{} } -func (m *AggrChunk) String() string { return proto.CompactTextString(m) } -func (*AggrChunk) ProtoMessage() {} -func (*AggrChunk) Descriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []int{2} -} -func (m *AggrChunk) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AggrChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AggrChunk.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AggrChunk) XXX_Merge(src proto.Message) { - xxx_messageInfo_AggrChunk.Merge(m, src) -} -func (m *AggrChunk) XXX_Size() int { - return m.Size() -} -func (m *AggrChunk) XXX_DiscardUnknown() { - xxx_messageInfo_AggrChunk.DiscardUnknown(m) +func (x *AggrChunk) Reset() { + *x = AggrChunk{} + mi := &file_store_storepb_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -var xxx_messageInfo_AggrChunk proto.InternalMessageInfo - -// Matcher specifies a rule, which can match or set of labels or not. -type LabelMatcher struct { - Type LabelMatcher_Type `protobuf:"varint,1,opt,name=type,proto3,enum=thanos.LabelMatcher_Type" json:"type,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *LabelMatcher) Reset() { *m = LabelMatcher{} } -func (m *LabelMatcher) String() string { return proto.CompactTextString(m) } -func (*LabelMatcher) ProtoMessage() {} -func (*LabelMatcher) Descriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []int{3} -} -func (m *LabelMatcher) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelMatcher) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelMatcher.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LabelMatcher) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelMatcher.Merge(m, src) -} -func (m *LabelMatcher) XXX_Size() int { - return m.Size() -} -func (m *LabelMatcher) XXX_DiscardUnknown() { - xxx_messageInfo_LabelMatcher.DiscardUnknown(m) -} - -var xxx_messageInfo_LabelMatcher proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("thanos.PartialResponseStrategy", PartialResponseStrategy_name, PartialResponseStrategy_value) - proto.RegisterEnum("thanos.Chunk_Encoding", Chunk_Encoding_name, Chunk_Encoding_value) - proto.RegisterEnum("thanos.LabelMatcher_Type", LabelMatcher_Type_name, LabelMatcher_Type_value) - proto.RegisterType((*Chunk)(nil), "thanos.Chunk") - proto.RegisterType((*Series)(nil), "thanos.Series") - proto.RegisterType((*AggrChunk)(nil), "thanos.AggrChunk") - proto.RegisterType((*LabelMatcher)(nil), "thanos.LabelMatcher") +func (x *AggrChunk) String() string { + return protoimpl.X.MessageStringOf(x) } -func init() { proto.RegisterFile("store/storepb/types.proto", fileDescriptor_121fba57de02d8e0) } - -var fileDescriptor_121fba57de02d8e0 = []byte{ - // 583 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x53, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0xf5, 0x3a, 0x8e, 0x93, 0x0c, 0x2d, 0xb8, 0x4b, 0x05, 0x6e, 0x0f, 0x4e, 0x64, 0x84, 0x88, - 0x2a, 0xd5, 0x96, 0x0a, 0x12, 0x17, 0x2e, 0x4e, 0x65, 0x4a, 0xa5, 0xb6, 0x69, 0xb7, 0x41, 0xa0, - 0x5e, 0xaa, 0x8d, 0xbb, 0xb2, 0xad, 0xc6, 0x1f, 0xb2, 0xd7, 0x90, 0xfe, 0x0b, 0x10, 0x37, 0x0e, - 0xfc, 0x9e, 0x1c, 0x7b, 0x44, 0x1c, 0x2a, 0x68, 0xff, 0x08, 0xf2, 0xda, 0xa1, 0x44, 0xca, 0xc5, - 0x1a, 0xbf, 0xf7, 0x66, 0x66, 0xe7, 0xed, 0x2c, 0x6c, 0xe4, 0x3c, 0xc9, 0x98, 0x2d, 0xbe, 0xe9, - 0xd8, 0xe6, 0x57, 0x29, 0xcb, 0xad, 0x34, 0x4b, 0x78, 0x82, 0x55, 0x1e, 0xd0, 0x38, 0xc9, 0x37, - 0xd7, 0xfd, 0xc4, 0x4f, 0x04, 0x64, 0x97, 0x51, 0xc5, 0x6e, 0xd6, 0x89, 0x13, 0x3a, 0x66, 0x93, - 0xc5, 0x44, 0xf3, 0x3b, 0x82, 0xe6, 0x6e, 0x50, 0xc4, 0x97, 0x78, 0x0b, 0x94, 0x92, 0xd0, 0x51, - 0x0f, 0xf5, 0x1f, 0xee, 0x3c, 0xb1, 0xaa, 0x8a, 0x96, 0x20, 0x2d, 0x37, 0xf6, 0x92, 0x8b, 0x30, - 0xf6, 0x89, 0xd0, 0x60, 0x0c, 0xca, 0x05, 0xe5, 0x54, 0x97, 0x7b, 0xa8, 0xbf, 0x42, 0x44, 0x8c, - 0x75, 0x50, 0x02, 0x9a, 0x07, 0x7a, 0xa3, 0x87, 0xfa, 0xca, 0x40, 0x99, 0xdd, 0x74, 0x11, 0x11, - 0x88, 0xf9, 0x1a, 0xda, 0xf3, 0x7c, 0xdc, 0x82, 0xc6, 0xc7, 0x21, 0xd1, 0x24, 0xbc, 0x0a, 0x9d, - 0x77, 0xfb, 0xa7, 0xa3, 0xe1, 0x1e, 0x71, 0x0e, 0x35, 0x84, 0x1f, 0xc3, 0xa3, 0xb7, 0x07, 0x43, - 0x67, 0x74, 0x7e, 0x0f, 0xca, 0xe6, 0x0f, 0x04, 0xea, 0x29, 0xcb, 0x42, 0x96, 0x63, 0x0f, 0x54, - 0x71, 0xfc, 0x5c, 0x47, 0xbd, 0x46, 0xff, 0xc1, 0xce, 0xea, 0xfc, 0x7c, 0x07, 0x25, 0x3a, 0x78, - 0x33, 0xbb, 0xe9, 0x4a, 0xbf, 0x6e, 0xba, 0xaf, 0xfc, 0x90, 0x07, 0xc5, 0xd8, 0xf2, 0x92, 0xc8, - 0xae, 0x04, 0xdb, 0x61, 0x52, 0x47, 0x76, 0x7a, 0xe9, 0xdb, 0x0b, 0x4e, 0x58, 0x67, 0x22, 0x9b, - 0xd4, 0xa5, 0xb1, 0x0d, 0xaa, 0x57, 0x8e, 0x9b, 0xeb, 0xb2, 0x68, 0xb2, 0x36, 0x6f, 0xe2, 0xf8, - 0x7e, 0x26, 0x8c, 0x10, 0x73, 0x49, 0xa4, 0x96, 0x99, 0xdf, 0x64, 0xe8, 0xfc, 0xe3, 0xf0, 0x06, - 0xb4, 0xa3, 0x30, 0x3e, 0xe7, 0x61, 0x54, 0xb9, 0xd8, 0x20, 0xad, 0x28, 0x8c, 0x47, 0x61, 0xc4, - 0x04, 0x45, 0xa7, 0x15, 0x25, 0xd7, 0x14, 0x9d, 0x0a, 0xaa, 0x0b, 0x8d, 0x8c, 0x7e, 0x16, 0xb6, - 0xfd, 0x37, 0x96, 0xa8, 0x48, 0x4a, 0x06, 0x3f, 0x83, 0xa6, 0x97, 0x14, 0x31, 0xd7, 0x95, 0x65, - 0x92, 0x8a, 0x2b, 0xab, 0xe4, 0x45, 0xa4, 0x37, 0x97, 0x56, 0xc9, 0x8b, 0xa8, 0x14, 0x44, 0x61, - 0xac, 0xab, 0x4b, 0x05, 0x51, 0x18, 0x0b, 0x01, 0x9d, 0xea, 0xad, 0xe5, 0x02, 0x3a, 0xc5, 0x2f, - 0xa0, 0x25, 0x7a, 0xb1, 0x4c, 0x6f, 0x2f, 0x13, 0xcd, 0x59, 0xf3, 0x2b, 0x82, 0x15, 0x61, 0xec, - 0x21, 0xe5, 0x5e, 0xc0, 0x32, 0xbc, 0xbd, 0xb0, 0x5a, 0x1b, 0x0b, 0x57, 0x57, 0x6b, 0xac, 0xd1, - 0x55, 0xca, 0xee, 0xb7, 0x2b, 0xa6, 0xb5, 0x51, 0x1d, 0x22, 0x62, 0xbc, 0x0e, 0xcd, 0x4f, 0x74, - 0x52, 0x30, 0xe1, 0x53, 0x87, 0x54, 0x3f, 0x66, 0x1f, 0x94, 0x32, 0x0f, 0xab, 0x20, 0xbb, 0x27, - 0x9a, 0x54, 0x6e, 0xd7, 0x91, 0x7b, 0xa2, 0xa1, 0x12, 0x20, 0xae, 0x26, 0x0b, 0x80, 0xb8, 0x5a, - 0x63, 0xcb, 0x81, 0xa7, 0xc7, 0x34, 0xe3, 0x21, 0x9d, 0x10, 0x96, 0xa7, 0x49, 0x9c, 0xb3, 0x53, - 0x9e, 0x51, 0xce, 0xfc, 0x2b, 0xdc, 0x06, 0xe5, 0x83, 0x43, 0x8e, 0x34, 0x09, 0x77, 0xa0, 0xe9, - 0x0c, 0x86, 0x64, 0xa4, 0x21, 0xbc, 0x06, 0xab, 0x7b, 0x64, 0xf8, 0xfe, 0xf8, 0x9c, 0xb8, 0xc7, - 0x07, 0xfb, 0xbb, 0x8e, 0x26, 0x0f, 0x9e, 0xcf, 0xfe, 0x18, 0xd2, 0xec, 0xd6, 0x40, 0xd7, 0xb7, - 0x06, 0xfa, 0x7d, 0x6b, 0xa0, 0x2f, 0x77, 0x86, 0x74, 0x7d, 0x67, 0x48, 0x3f, 0xef, 0x0c, 0xe9, - 0xac, 0x55, 0x3f, 0xcb, 0xb1, 0x2a, 0x1e, 0xd6, 0xcb, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xee, - 0x6c, 0xcf, 0x99, 0xae, 0x03, 0x00, 0x00, -} +func (*AggrChunk) ProtoMessage() {} -func (m *Chunk) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *AggrChunk) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_types_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *Chunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use AggrChunk.ProtoReflect.Descriptor instead. +func (*AggrChunk) Descriptor() ([]byte, []int) { + return file_store_storepb_types_proto_rawDescGZIP(), []int{2} } -func (m *Chunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Hash != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Hash)) - i-- - dAtA[i] = 0x18 - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 +func (x *AggrChunk) GetMinTime() int64 { + if x != nil { + return x.MinTime } - return len(dAtA) - i, nil + return 0 } -func (m *Series) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *AggrChunk) GetMaxTime() int64 { + if x != nil { + return x.MaxTime } - return dAtA[:n], nil + return 0 } -func (m *Series) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Series) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Chunks) > 0 { - for iNdEx := len(m.Chunks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Chunks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } +func (x *AggrChunk) GetRaw() *Chunk { + if x != nil { + return x.Raw } - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil + return nil } -func (m *AggrChunk) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *AggrChunk) GetCount() *Chunk { + if x != nil { + return x.Count } - return dAtA[:n], nil -} - -func (m *AggrChunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return nil } -func (m *AggrChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Counter != nil { - { - size, err := m.Counter.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 +func (x *AggrChunk) GetSum() *Chunk { + if x != nil { + return x.Sum } - if m.Max != nil { - { - size, err := m.Max.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if m.Min != nil { - { - size, err := m.Min.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.Sum != nil { - { - size, err := m.Sum.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.Count != nil { - { - size, err := m.Count.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Raw != nil { - { - size, err := m.Raw.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.MaxTime != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MaxTime)) - i-- - dAtA[i] = 0x10 - } - if m.MinTime != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MinTime)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil + return nil } -func (m *LabelMatcher) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *AggrChunk) GetMin() *Chunk { + if x != nil { + return x.Min } - return dAtA[:n], nil -} - -func (m *LabelMatcher) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return nil } -func (m *LabelMatcher) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x1a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 +func (x *AggrChunk) GetMax() *Chunk { + if x != nil { + return x.Max } - return len(dAtA) - i, nil + return nil } -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Chunk) Size() (n int) { - if m == nil { - return 0 +func (x *AggrChunk) GetCounter() *Chunk { + if x != nil { + return x.Counter } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Hash != 0 { - n += 1 + sovTypes(uint64(m.Hash)) - } - return n + return nil } -func (m *Series) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.Chunks) > 0 { - for _, e := range m.Chunks { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} +// Matcher specifies a rule, which can match or set of labels or not. +type LabelMatcher struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *AggrChunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MinTime != 0 { - n += 1 + sovTypes(uint64(m.MinTime)) - } - if m.MaxTime != 0 { - n += 1 + sovTypes(uint64(m.MaxTime)) - } - if m.Raw != nil { - l = m.Raw.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Count != nil { - l = m.Count.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Sum != nil { - l = m.Sum.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Min != nil { - l = m.Min.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Max != nil { - l = m.Max.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Counter != nil { - l = m.Counter.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n + Type LabelMatcher_Type `protobuf:"varint,1,opt,name=type,proto3,enum=thanos.LabelMatcher_Type" json:"type,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` } -func (m *LabelMatcher) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n +func (x *LabelMatcher) Reset() { + *x = LabelMatcher{} + mi := &file_store_storepb_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (x *LabelMatcher) String() string { + return protoimpl.X.MessageStringOf(x) } -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Chunk) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Chunk: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Chunk: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= Chunk_Encoding(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - m.Hash = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Hash |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Series) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Series: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Series: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Chunks = append(m.Chunks, AggrChunk{}) - if err := m.Chunks[len(m.Chunks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +func (*LabelMatcher) ProtoMessage() {} - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AggrChunk) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AggrChunk: wiretype end group for non-group") +func (x *LabelMatcher) ProtoReflect() protoreflect.Message { + mi := &file_store_storepb_types_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - if fieldNum <= 0 { - return fmt.Errorf("proto: AggrChunk: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinTime", wireType) - } - m.MinTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxTime", wireType) - } - m.MaxTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Raw", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Raw == nil { - m.Raw = &Chunk{} - } - if err := m.Raw.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Count == nil { - m.Count = &Chunk{} - } - if err := m.Count.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sum", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Sum == nil { - m.Sum = &Chunk{} - } - if err := m.Sum.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Min == nil { - m.Min = &Chunk{} - } - if err := m.Min.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Max == nil { - m.Max = &Chunk{} - } - if err := m.Max.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Counter", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Counter == nil { - m.Counter = &Chunk{} - } - if err := m.Counter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF + return ms } - return nil + return mi.MessageOf(x) } -func (m *LabelMatcher) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LabelMatcher: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelMatcher: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= LabelMatcher_Type(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF +// Deprecated: Use LabelMatcher.ProtoReflect.Descriptor instead. +func (*LabelMatcher) Descriptor() ([]byte, []int) { + return file_store_storepb_types_proto_rawDescGZIP(), []int{3} +} + +func (x *LabelMatcher) GetType() LabelMatcher_Type { + if x != nil { + return x.Type + } + return LabelMatcher_EQ +} + +func (x *LabelMatcher) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *LabelMatcher) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +var File_store_storepb_types_proto protoreflect.FileDescriptor + +var file_store_storepb_types_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x74, 0x68, 0x61, + 0x6e, 0x6f, 0x73, 0x1a, 0x19, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x70, 0x62, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, + 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2f, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x94, 0x01, 0x0a, 0x05, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x2a, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x74, 0x68, + 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x2e, 0x45, 0x6e, 0x63, 0x6f, 0x64, + 0x69, 0x6e, 0x67, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, + 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x68, 0x61, 0x73, + 0x68, 0x22, 0x37, 0x0a, 0x08, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x07, 0x0a, + 0x03, 0x58, 0x4f, 0x52, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, + 0x52, 0x41, 0x4d, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x5f, 0x48, + 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10, 0x02, 0x22, 0x82, 0x01, 0x0a, 0x06, 0x53, + 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x42, 0x12, 0x9a, 0x84, 0x9e, 0x03, 0x0d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x22, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x12, 0x3d, 0x0a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x43, 0x68, + 0x75, 0x6e, 0x6b, 0x42, 0x12, 0x9a, 0x84, 0x9e, 0x03, 0x0d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, + 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x22, 0x52, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x22, + 0x93, 0x02, 0x0a, 0x09, 0x41, 0x67, 0x67, 0x72, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x19, 0x0a, + 0x08, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x07, 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0d, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, + 0x03, 0x72, 0x61, 0x77, 0x12, 0x23, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x43, 0x68, 0x75, + 0x6e, 0x6b, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x03, 0x73, 0x75, 0x6d, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, + 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x03, 0x6d, 0x69, + 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, + 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x03, 0x6d, 0x69, 0x6e, 0x12, 0x1f, 0x0a, 0x03, 0x6d, + 0x61, 0x78, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, + 0x73, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x03, 0x6d, 0x61, 0x78, 0x12, 0x27, 0x0a, 0x07, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x07, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x65, 0x72, 0x22, 0x91, 0x01, 0x0a, 0x0c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, + 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x28, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x06, 0x0a, 0x02, 0x45, 0x51, 0x10, 0x00, 0x12, + 0x07, 0x0a, 0x03, 0x4e, 0x45, 0x51, 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x52, 0x45, 0x10, 0x02, + 0x12, 0x07, 0x0a, 0x03, 0x4e, 0x52, 0x45, 0x10, 0x03, 0x2a, 0x41, 0x0a, 0x17, 0x50, 0x61, 0x72, + 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x72, 0x61, + 0x74, 0x65, 0x67, 0x79, 0x12, 0x08, 0x0a, 0x04, 0x57, 0x41, 0x52, 0x4e, 0x10, 0x00, 0x12, 0x09, + 0x0a, 0x05, 0x41, 0x42, 0x4f, 0x52, 0x54, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x47, 0x52, 0x4f, + 0x55, 0x50, 0x5f, 0x52, 0x45, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x10, 0x02, 0x42, 0x2f, 0x5a, 0x2d, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, + 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") + file_store_storepb_types_proto_rawDescOnce sync.Once + file_store_storepb_types_proto_rawDescData = file_store_storepb_types_proto_rawDesc ) + +func file_store_storepb_types_proto_rawDescGZIP() []byte { + file_store_storepb_types_proto_rawDescOnce.Do(func() { + file_store_storepb_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_storepb_types_proto_rawDescData) + }) + return file_store_storepb_types_proto_rawDescData +} + +var file_store_storepb_types_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_store_storepb_types_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_store_storepb_types_proto_goTypes = []any{ + (PartialResponseStrategy)(0), // 0: thanos.PartialResponseStrategy + (Chunk_Encoding)(0), // 1: thanos.Chunk.Encoding + (LabelMatcher_Type)(0), // 2: thanos.LabelMatcher.Type + (*Chunk)(nil), // 3: thanos.Chunk + (*Series)(nil), // 4: thanos.Series + (*AggrChunk)(nil), // 5: thanos.AggrChunk + (*LabelMatcher)(nil), // 6: thanos.LabelMatcher + (*labelpb.Label)(nil), // 7: thanos.Label +} +var file_store_storepb_types_proto_depIdxs = []int32{ + 1, // 0: thanos.Chunk.type:type_name -> thanos.Chunk.Encoding + 7, // 1: thanos.Series.labels:type_name -> thanos.Label + 5, // 2: thanos.Series.chunks:type_name -> thanos.AggrChunk + 3, // 3: thanos.AggrChunk.raw:type_name -> thanos.Chunk + 3, // 4: thanos.AggrChunk.count:type_name -> thanos.Chunk + 3, // 5: thanos.AggrChunk.sum:type_name -> thanos.Chunk + 3, // 6: thanos.AggrChunk.min:type_name -> thanos.Chunk + 3, // 7: thanos.AggrChunk.max:type_name -> thanos.Chunk + 3, // 8: thanos.AggrChunk.counter:type_name -> thanos.Chunk + 2, // 9: thanos.LabelMatcher.type:type_name -> thanos.LabelMatcher.Type + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_store_storepb_types_proto_init() } +func file_store_storepb_types_proto_init() { + if File_store_storepb_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_store_storepb_types_proto_rawDesc, + NumEnums: 3, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_store_storepb_types_proto_goTypes, + DependencyIndexes: file_store_storepb_types_proto_depIdxs, + EnumInfos: file_store_storepb_types_proto_enumTypes, + MessageInfos: file_store_storepb_types_proto_msgTypes, + }.Build() + File_store_storepb_types_proto = out.File + file_store_storepb_types_proto_rawDesc = nil + file_store_storepb_types_proto_goTypes = nil + file_store_storepb_types_proto_depIdxs = nil +} diff --git a/pkg/store/storepb/types.proto b/pkg/store/storepb/types.proto index 42dfe883c65..46fbb41f6c2 100644 --- a/pkg/store/storepb/types.proto +++ b/pkg/store/storepb/types.proto @@ -4,21 +4,10 @@ syntax = "proto3"; package thanos; -option go_package = "storepb"; +option go_package = "github.com/thanos-io/thanos/pkg/store/storepb"; -import "gogoproto/gogo.proto"; import "store/labelpb/types.proto"; - -option (gogoproto.sizer_all) = true; -option (gogoproto.marshaler_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; +import "tagger/tagger.proto"; message Chunk { enum Encoding { @@ -28,12 +17,12 @@ message Chunk { } Encoding type = 1; bytes data = 2; - uint64 hash = 3 [(gogoproto.nullable) = true]; + uint64 hash = 3; } message Series { - repeated Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel"]; - repeated AggrChunk chunks = 2 [(gogoproto.nullable) = false]; + repeated Label labels = 1 [(tagger.tags) = "json:\"labels\""]; + repeated AggrChunk chunks = 2 [(tagger.tags) = "json:\"chunks\""]; } message AggrChunk { diff --git a/pkg/store/storepb/types_vtproto.pb.go b/pkg/store/storepb/types_vtproto.pb.go new file mode 100644 index 00000000000..53d07ef1d51 --- /dev/null +++ b/pkg/store/storepb/types_vtproto.pb.go @@ -0,0 +1,1265 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.1-0.20250313105119-ba97887b0a25 +// source: store/storepb/types.proto + +package storepb + +import ( + fmt "fmt" + io "io" + + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *Chunk) CloneVT() *Chunk { + if m == nil { + return (*Chunk)(nil) + } + r := new(Chunk) + r.Type = m.Type + r.Hash = m.Hash + if rhs := m.Data; rhs != nil { + tmpBytes := make([]byte, len(rhs)) + copy(tmpBytes, rhs) + r.Data = tmpBytes + } + return r +} + +func (m *Chunk) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Series) CloneVT() *Series { + if m == nil { + return (*Series)(nil) + } + r := new(Series) + if rhs := m.Labels; rhs != nil { + tmpContainer := make([]*labelpb.Label, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Labels = tmpContainer + } + if rhs := m.Chunks; rhs != nil { + tmpContainer := make([]*AggrChunk, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Chunks = tmpContainer + } + return r +} + +func (m *Series) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *AggrChunk) CloneVT() *AggrChunk { + if m == nil { + return (*AggrChunk)(nil) + } + r := new(AggrChunk) + r.MinTime = m.MinTime + r.MaxTime = m.MaxTime + r.Raw = m.Raw.CloneVT() + r.Count = m.Count.CloneVT() + r.Sum = m.Sum.CloneVT() + r.Min = m.Min.CloneVT() + r.Max = m.Max.CloneVT() + r.Counter = m.Counter.CloneVT() + return r +} + +func (m *AggrChunk) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *LabelMatcher) CloneVT() *LabelMatcher { + if m == nil { + return (*LabelMatcher)(nil) + } + r := new(LabelMatcher) + r.Type = m.Type + r.Name = m.Name + r.Value = m.Value + return r +} + +func (m *LabelMatcher) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *Chunk) EqualVT(that *Chunk) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Type != that.Type { + return false + } + if string(this.Data) != string(that.Data) { + return false + } + if this.Hash != that.Hash { + return false + } + return true +} + +func (this *Chunk) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Chunk) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Series) EqualVT(that *Series) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Labels) != len(that.Labels) { + return false + } + for i, vx := range this.Labels { + vy := that.Labels[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &labelpb.Label{} + } + if q == nil { + q = &labelpb.Label{} + } + if !p.EqualVT(q) { + return false + } + } + } + if len(this.Chunks) != len(that.Chunks) { + return false + } + for i, vx := range this.Chunks { + vy := that.Chunks[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &AggrChunk{} + } + if q == nil { + q = &AggrChunk{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *Series) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Series) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *AggrChunk) EqualVT(that *AggrChunk) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.MinTime != that.MinTime { + return false + } + if this.MaxTime != that.MaxTime { + return false + } + if !this.Raw.EqualVT(that.Raw) { + return false + } + if !this.Count.EqualVT(that.Count) { + return false + } + if !this.Sum.EqualVT(that.Sum) { + return false + } + if !this.Min.EqualVT(that.Min) { + return false + } + if !this.Max.EqualVT(that.Max) { + return false + } + if !this.Counter.EqualVT(that.Counter) { + return false + } + return true +} + +func (this *AggrChunk) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*AggrChunk) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *LabelMatcher) EqualVT(that *LabelMatcher) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Type != that.Type { + return false + } + if this.Name != that.Name { + return false + } + if this.Value != that.Value { + return false + } + return true +} + +func (this *LabelMatcher) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*LabelMatcher) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *Chunk) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Chunk) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Chunk) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.Hash != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Hash)) + i-- + dAtA[i] = 0x18 + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Series) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Series) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Series) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Chunks) > 0 { + for iNdEx := len(m.Chunks) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Chunks[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Labels) > 0 { + for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Labels[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *AggrChunk) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AggrChunk) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *AggrChunk) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.Counter != nil { + size, err := m.Counter.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } + if m.Max != nil { + size, err := m.Max.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + if m.Min != nil { + size, err := m.Min.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + if m.Sum != nil { + size, err := m.Sum.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + if m.Count != nil { + size, err := m.Count.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if m.Raw != nil { + size, err := m.Raw.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.MaxTime != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MaxTime)) + i-- + dAtA[i] = 0x10 + } + if m.MinTime != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MinTime)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *LabelMatcher) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LabelMatcher) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LabelMatcher) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Chunk) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Type)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Hash != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Hash)) + } + return n +} + +func (m *Series) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Labels) > 0 { + for _, e := range m.Labels { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.Chunks) > 0 { + for _, e := range m.Chunks { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *AggrChunk) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MinTime != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MinTime)) + } + if m.MaxTime != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MaxTime)) + } + if m.Raw != nil { + l = m.Raw.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Count != nil { + l = m.Count.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Sum != nil { + l = m.Sum.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Min != nil { + l = m.Min.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Max != nil { + l = m.Max.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Counter != nil { + l = m.Counter.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *LabelMatcher) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Type)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *Chunk) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Chunk: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Chunk: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= Chunk_Encoding(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + m.Hash = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Hash |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Series) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Series: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Series: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Labels = append(m.Labels, &labelpb.Label{}) + if err := m.Labels[len(m.Labels)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Chunks = append(m.Chunks, &AggrChunk{}) + if err := m.Chunks[len(m.Chunks)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AggrChunk) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AggrChunk: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AggrChunk: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinTime", wireType) + } + m.MinTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxTime", wireType) + } + m.MaxTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Raw", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Raw == nil { + m.Raw = &Chunk{} + } + if err := m.Raw.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Count == nil { + m.Count = &Chunk{} + } + if err := m.Count.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sum", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Sum == nil { + m.Sum = &Chunk{} + } + if err := m.Sum.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Min == nil { + m.Min = &Chunk{} + } + if err := m.Min.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Max == nil { + m.Max = &Chunk{} + } + if err := m.Max.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Counter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Counter == nil { + m.Counter = &Chunk{} + } + if err := m.Counter.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LabelMatcher) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LabelMatcher: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LabelMatcher: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= LabelMatcher_Type(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pkg/store/tsdb.go b/pkg/store/tsdb.go index a178f170d0f..b055b85c508 100644 --- a/pkg/store/tsdb.go +++ b/pkg/store/tsdb.go @@ -77,7 +77,7 @@ type TSDBStore struct { maxBytesPerFrame int matcherCache storecache.MatchersCache - extLset labels.Labels + extLset labelpb.Labels startStoreFilterUpdate bool storeFilter filter.StoreFilter disableSeriesResorting bool @@ -108,7 +108,7 @@ func NewTSDBStore( logger log.Logger, db TSDBReader, component component.StoreAPI, - extLset labels.Labels, + extLset labelpb.Labels, options ...TSDBStoreOption, ) *TSDBStore { if logger == nil { @@ -169,42 +169,38 @@ func NewTSDBStore( return st } -func (s *TSDBStore) SetExtLset(extLset labels.Labels) { +func (s *TSDBStore) SetExtLset(extLset labelpb.Labels) { s.mtx.Lock() defer s.mtx.Unlock() s.extLset = extLset } -func (s *TSDBStore) getExtLset() labels.Labels { +func (s *TSDBStore) getExtLset() labelpb.Labels { s.mtx.RLock() defer s.mtx.RUnlock() return s.extLset } -func (s *TSDBStore) LabelSet() []labelpb.ZLabelSet { - labels := labelpb.ZLabelSetsFromPromLabels(s.getExtLset()) - labelSets := []labelpb.ZLabelSet{} - if len(labels) > 0 { - labelSets = append(labelSets, labels...) +func (s *TSDBStore) LabelSet() []*labelpb.LabelSet { + extLset := s.getExtLset() + if extLset.IsEmpty() { + return nil } - - return labelSets + return []*labelpb.LabelSet{{Labels: extLset}} } -func (s *TSDBStore) TSDBInfos() []infopb.TSDBInfo { - labels := s.LabelSet() - if len(labels) == 0 { - return []infopb.TSDBInfo{} +func (s *TSDBStore) TSDBInfos() []*infopb.TSDBInfo { + labelSets := s.LabelSet() + if len(labelSets) == 0 { + return []*infopb.TSDBInfo{} } mint, maxt := s.TimeRange() - return []infopb.TSDBInfo{ + return []*infopb.TSDBInfo{ { - Labels: labelpb.ZLabelSet{ - Labels: labels[0].Labels, - }, + Labels: labelSets[0], MinTime: mint, MaxTime: maxt, }, @@ -308,13 +304,13 @@ func (s *TSDBStore) Series(r *storepb.SeriesRequest, seriesSrv storepb.Store_Ser for _, lbl := range r.WithoutReplicaLabels { extLsetToRemove[lbl] = struct{}{} } - finalExtLset := rmLabels(s.extLset.Copy(), extLsetToRemove) + finalExtLset := labelpb.RmLabels(s.extLset, extLsetToRemove) // Stream at most one series per frame; series may be split over multiple frames according to maxBytesInFrame. for set.Next() { series := set.At() - completeLabelset := labelpb.ExtendSortedLabels(rmLabels(series.Labels(), extLsetToRemove), finalExtLset) + completeLabelset := labelpb.ExtendSortedLabels(labelpb.RmLabelsInPlace(labelpb.FromPromLabels(series.Labels()), extLsetToRemove), finalExtLset) if !shardMatcher.MatchesLabels(completeLabelset) { continue } @@ -323,7 +319,7 @@ func (s *TSDBStore) Series(r *storepb.SeriesRequest, seriesSrv storepb.Store_Ser requestMatches(r.Matchers), completeLabelset.String()) } - storeSeries := storepb.Series{Labels: labelpb.ZLabelsFromPromLabels(completeLabelset)} + storeSeries := storepb.Series{Labels: completeLabelset} if r.SkipChunks { if err := srv.Send(storepb.NewSeriesResponse(&storeSeries)); err != nil { return status.Error(codes.Aborted, err.Error()) @@ -333,11 +329,11 @@ func (s *TSDBStore) Series(r *storepb.SeriesRequest, seriesSrv storepb.Store_Ser bytesLeftForChunks := s.maxBytesPerFrame for _, lbl := range storeSeries.Labels { - bytesLeftForChunks -= lbl.Size() + bytesLeftForChunks -= lbl.SizeVT() } frameBytesLeft := bytesLeftForChunks - seriesChunks := []storepb.AggrChunk{} + seriesChunks := []*storepb.AggrChunk{} chIter := series.Iterator(nil) isNext := chIter.Next() for isNext { @@ -348,7 +344,7 @@ func (s *TSDBStore) Series(r *storepb.SeriesRequest, seriesSrv storepb.Store_Ser chunkBytes := make([]byte, len(chk.Chunk.Bytes())) copy(chunkBytes, chk.Chunk.Bytes()) - c := storepb.AggrChunk{ + c := &storepb.AggrChunk{ MinTime: chk.MinTime, MaxTime: chk.MaxTime, Raw: &storepb.Chunk{ @@ -357,7 +353,7 @@ func (s *TSDBStore) Series(r *storepb.SeriesRequest, seriesSrv storepb.Store_Ser Hash: hashChunk(hasher, chunkBytes, enableChunkHashCalculation), }, } - frameBytesLeft -= c.Size() + frameBytesLeft -= c.SizeVT() seriesChunks = append(seriesChunks, c) // We are fine with minor inaccuracy of max bytes per frame. The inaccuracy will be max of full chunk size. @@ -371,7 +367,7 @@ func (s *TSDBStore) Series(r *storepb.SeriesRequest, seriesSrv storepb.Store_Ser if isNext { frameBytesLeft = bytesLeftForChunks - seriesChunks = make([]storepb.AggrChunk, 0, len(seriesChunks)) + seriesChunks = make([]*storepb.AggrChunk, 0, len(seriesChunks)) } } if err := chIter.Err(); err != nil { @@ -422,7 +418,7 @@ func (s *TSDBStore) LabelNames(ctx context.Context, r *storepb.LabelNamesRequest } if len(res) > 0 { - s.getExtLset().Range(func(l labels.Label) { + s.getExtLset().Range(func(l *labelpb.Label) { if _, ok := extLsetToRemove[l.Name]; !ok { res = append(res, l.Name) } diff --git a/pkg/store/tsdb_selector.go b/pkg/store/tsdb_selector.go index 463ab96b14a..96f4e4a70e8 100644 --- a/pkg/store/tsdb_selector.go +++ b/pkg/store/tsdb_selector.go @@ -7,10 +7,11 @@ import ( "sort" "strings" - "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/model/relabel" "golang.org/x/exp/maps" + thanosrelabel "github.com/thanos-io/thanos/pkg/relabel" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" ) @@ -35,7 +36,7 @@ func NewTSDBSelector(relabelConfig []*relabel.Config) *TSDBSelector { // MatchLabelSets returns true if the given label sets match the TSDBSelector. // As a second parameter, it returns the matched label sets if they are a subset of the given input. // Otherwise the second return value is nil. -func (sr *TSDBSelector) MatchLabelSets(labelSets ...labels.Labels) (bool, []labels.Labels) { +func (sr *TSDBSelector) MatchLabelSets(labelSets ...labelpb.Labels) (bool, []labelpb.Labels) { if sr.relabelConfig == nil || len(labelSets) == 0 { return true, nil } @@ -43,21 +44,20 @@ func (sr *TSDBSelector) MatchLabelSets(labelSets ...labels.Labels) (bool, []labe return len(matchedLabelSets) > 0, matchedLabelSets } -func (sr *TSDBSelector) runRelabelRules(labelSets []labels.Labels) []labels.Labels { - result := make([]labels.Labels, 0) +func (sr *TSDBSelector) runRelabelRules(labelSets []labelpb.Labels) []labelpb.Labels { + result := make([]labelpb.Labels, 0, len(labelSets)) for _, labelSet := range labelSets { - if _, keep := relabel.Process(labelSet, sr.relabelConfig...); !keep { + processed, keep := thanosrelabel.Process(labelSet, sr.relabelConfig...) + if !keep { continue } - - result = append(result, labelSet) + result = append(result, processed) } - return result } // MatchersForLabelSets generates a list of label matchers for the given label sets. -func MatchersForLabelSets(labelSets []labels.Labels) []storepb.LabelMatcher { +func MatchersForLabelSets(labelSets []labelpb.Labels) []*storepb.LabelMatcher { var ( // labelNameCounts tracks how many times a label name appears in the given label // sets. This is used to make sure that an explicit empty value matcher is @@ -69,7 +69,7 @@ func MatchersForLabelSets(labelSets []labels.Labels) []storepb.LabelMatcher { labelNameValues = make(map[string]map[string]struct{}) ) for _, labelSet := range labelSets { - labelSet.Range(func(l labels.Label) { + labelSet.Range(func(l *labelpb.Label) { if _, ok := labelNameValues[l.Name]; !ok { labelNameValues[l.Name] = make(map[string]struct{}) } @@ -86,11 +86,11 @@ func MatchersForLabelSets(labelSets []labels.Labels) []storepb.LabelMatcher { } } - matchers := make([]storepb.LabelMatcher, 0, len(labelNameValues)) + matchers := make([]*storepb.LabelMatcher, 0, len(labelNameValues)) for lblName, lblVals := range labelNameValues { values := maps.Keys(lblVals) sort.Strings(values) - matcher := storepb.LabelMatcher{ + matcher := &storepb.LabelMatcher{ Name: lblName, Value: strings.Join(values, "|"), Type: storepb.LabelMatcher_RE, diff --git a/pkg/store/tsdb_selector_test.go b/pkg/store/tsdb_selector_test.go index ea4d1e8c36d..49a0fa25570 100644 --- a/pkg/store/tsdb_selector_test.go +++ b/pkg/store/tsdb_selector_test.go @@ -8,8 +8,8 @@ import ( "testing" "github.com/efficientgo/core/testutil" - "github.com/prometheus/prometheus/model/labels" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" ) @@ -18,60 +18,60 @@ func TestMatchersForLabelSets(t *testing.T) { tests := []struct { name string - labelSets []labels.Labels - want []storepb.LabelMatcher + labelSets []labelpb.Labels + want []*storepb.LabelMatcher }{ { name: "empty label sets", labelSets: nil, - want: []storepb.LabelMatcher{}, + want: []*storepb.LabelMatcher{}, }, { name: "single label set with single label", - labelSets: []labels.Labels{ - labels.FromStrings("a", "1"), + labelSets: []labelpb.Labels{ + labelpb.FromStrings("a", "1"), }, - want: []storepb.LabelMatcher{ + want: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "a", Value: "1"}, }, }, { name: "multiple labels with same label name", - labelSets: []labels.Labels{ - labels.FromStrings("a", "1"), - labels.FromStrings("a", "2"), + labelSets: []labelpb.Labels{ + labelpb.FromStrings("a", "1"), + labelpb.FromStrings("a", "2"), }, - want: []storepb.LabelMatcher{ + want: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "a", Value: "1|2"}, }, }, { name: "multiple labels with different label name", - labelSets: []labels.Labels{ - labels.FromStrings("a", "1", "b", "2"), + labelSets: []labelpb.Labels{ + labelpb.FromStrings("a", "1", "b", "2"), }, - want: []storepb.LabelMatcher{ + want: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "a", Value: "1"}, {Type: storepb.LabelMatcher_RE, Name: "b", Value: "2"}, }, }, { name: "multiple label sets with same label name", - labelSets: []labels.Labels{ - labels.FromStrings("a", "1"), - labels.FromStrings("a", "2"), + labelSets: []labelpb.Labels{ + labelpb.FromStrings("a", "1"), + labelpb.FromStrings("a", "2"), }, - want: []storepb.LabelMatcher{ + want: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "a", Value: "1|2"}, }, }, { name: "multiple label sets with different label name", - labelSets: []labels.Labels{ - labels.FromStrings("a", "1"), - labels.FromStrings("b", "2"), + labelSets: []labelpb.Labels{ + labelpb.FromStrings("a", "1"), + labelpb.FromStrings("b", "2"), }, - want: []storepb.LabelMatcher{ + want: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_RE, Name: "a", Value: "1|^$"}, {Type: storepb.LabelMatcher_RE, Name: "b", Value: "2|^$"}, }, diff --git a/pkg/store/tsdb_test.go b/pkg/store/tsdb_test.go index 74b203a69fc..d9b74b8c8af 100644 --- a/pkg/store/tsdb_test.go +++ b/pkg/store/tsdb_test.go @@ -39,7 +39,7 @@ func TestTSDBStore_Series_ChunkChecksum(t *testing.T) { defer func() { testutil.Ok(t, db.Close()) }() testutil.Ok(t, err) - tsdbStore := NewTSDBStore(nil, db, component.Rule, labels.FromStrings("region", "eu-west")) + tsdbStore := NewTSDBStore(nil, db, component.Rule, labelpb.FromStrings("region", "eu-west")) appender := db.Appender(context.Background()) @@ -55,7 +55,7 @@ func TestTSDBStore_Series_ChunkChecksum(t *testing.T) { req := &storepb.SeriesRequest{ MinTime: 1, MaxTime: 3, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "1"}, }, } @@ -79,7 +79,7 @@ func TestTSDBStore_Series(t *testing.T) { defer func() { testutil.Ok(t, db.Close()) }() testutil.Ok(t, err) - tsdbStore := NewTSDBStore(nil, db, component.Rule, labels.FromStrings("region", "eu-west")) + tsdbStore := NewTSDBStore(nil, db, component.Rule, labelpb.FromStrings("region", "eu-west")) appender := db.Appender(context.Background()) @@ -101,13 +101,13 @@ func TestTSDBStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 3, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "1"}, }, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "1", "region", "eu-west"), + lset: labelpb.FromStrings("a", "1", "region", "eu-west"), chunks: [][]sample{{{1, 1}, {2, 2}, {3, 3}}}, }, }, @@ -117,13 +117,13 @@ func TestTSDBStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 2, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "1"}, }, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "1", "region", "eu-west"), + lset: labelpb.FromStrings("a", "1", "region", "eu-west"), chunks: [][]sample{{{1, 1}, {2, 2}, {3, 3}}}, }, }, @@ -133,7 +133,7 @@ func TestTSDBStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 4, MaxTime: 6, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "1"}, }, }, @@ -144,7 +144,7 @@ func TestTSDBStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 3, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "region", Value: "eu-west"}, }, }, @@ -155,7 +155,7 @@ func TestTSDBStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 3, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "b", Value: "1"}, }, }, @@ -166,14 +166,14 @@ func TestTSDBStore_Series(t *testing.T) { req: &storepb.SeriesRequest{ MinTime: 1, MaxTime: 3, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "a", Value: "1"}, }, SkipChunks: true, }, expectedSeries: []rawSeries{ { - lset: labels.FromStrings("a", "1", "region", "eu-west"), + lset: labelpb.FromStrings("a", "1", "region", "eu-west"), }, }, }, @@ -250,7 +250,7 @@ func TestTSDBStore_SeriesAccessWithDelegateClosing(t *testing.T) { } }) - extLabels := labels.FromStrings("ext", "1") + extLabels := labelpb.FromStrings("ext", "1") store := NewTSDBStore(logger, &mockedStartTimeDB{DBReadOnly: db, startTime: 0}, component.Receive, extLabels) srv := storetestutil.NewSeriesServer(context.Background()) @@ -259,7 +259,7 @@ func TestTSDBStore_SeriesAccessWithDelegateClosing(t *testing.T) { testutil.Ok(t, store.Series(&storepb.SeriesRequest{ MinTime: 0, MaxTime: math.MaxInt64, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "foo", Value: "bar"}, }, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT, @@ -413,7 +413,7 @@ func TestTSDBStore_SeriesAccessWithoutDelegateClosing(t *testing.T) { } }) - extLabels := labels.FromStrings("ext", "1") + extLabels := labelpb.FromStrings("ext", "1") store := NewTSDBStore(logger, &mockedStartTimeDB{DBReadOnly: db, startTime: 0}, component.Receive, extLabels) srv := storetestutil.NewSeriesServer(context.Background()) @@ -421,7 +421,7 @@ func TestTSDBStore_SeriesAccessWithoutDelegateClosing(t *testing.T) { testutil.Ok(t, store.Series(&storepb.SeriesRequest{ MinTime: 0, MaxTime: math.MaxInt64, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "foo", Value: "bar"}, }, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT, @@ -552,7 +552,7 @@ func benchTSDBStoreSeries(t testutil.TB, totalSamples, totalSeries int) { defer func() { testutil.Ok(t, db.Close()) }() - extLabels := labels.FromStrings("ext", "1") + extLabels := labelpb.FromStrings("ext", "1") store := NewTSDBStore(logger, &mockedStartTimeDB{DBReadOnly: db, startTime: 0}, component.Receive, extLabels) var expected []*storepb.Series @@ -561,20 +561,20 @@ func benchTSDBStoreSeries(t testutil.TB, totalSamples, totalSeries int) { // Add external labels & frame it. s := r.GetSeries() bytesLeftForChunks := store.maxBytesPerFrame - lbls := make([]labelpb.ZLabel, 0, len(s.Labels)+extLabels.Len()) + lbls := make(labelpb.Labels, 0, len(s.Labels)+len(extLabels)) for _, l := range s.Labels { - lbls = append(lbls, labelpb.ZLabel{ + lbls = append(lbls, &labelpb.Label{ Name: l.Name, Value: l.Value, }) - bytesLeftForChunks -= lbls[len(lbls)-1].Size() + bytesLeftForChunks -= lbls[len(lbls)-1].SizeVT() } - extLabels.Range(func(l labels.Label) { - lbls = append(lbls, labelpb.ZLabel{ + extLabels.Range(func(l *labelpb.Label) { + lbls = append(lbls, &labelpb.Label{ Name: l.Name, Value: l.Value, }) - bytesLeftForChunks -= lbls[len(lbls)-1].Size() + bytesLeftForChunks -= lbls[len(lbls)-1].SizeVT() }) sort.Slice(lbls, func(i, j int) bool { return lbls[i].Name < lbls[j].Name @@ -584,7 +584,7 @@ func benchTSDBStoreSeries(t testutil.TB, totalSamples, totalSeries int) { frame := &storepb.Series{Labels: lbls} for i, c := range s.Chunks { frame.Chunks = append(frame.Chunks, c) - frameBytesLeft -= c.Size() + frameBytesLeft -= c.SizeVT() if i == len(s.Chunks)-1 { break @@ -607,7 +607,7 @@ func benchTSDBStoreSeries(t testutil.TB, totalSamples, totalSeries int) { Req: &storepb.SeriesRequest{ MinTime: 0, MaxTime: math.MaxInt64, - Matchers: []storepb.LabelMatcher{ + Matchers: []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "foo", Value: "bar"}, }, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT, diff --git a/pkg/targets/prometheus.go b/pkg/targets/prometheus.go index 5fc38c16485..be6d242f11d 100644 --- a/pkg/targets/prometheus.go +++ b/pkg/targets/prometheus.go @@ -7,8 +7,6 @@ import ( "net/url" "strings" - "github.com/prometheus/prometheus/model/labels" - "github.com/thanos-io/thanos/pkg/promclient" "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/targets/targetspb" @@ -16,14 +14,16 @@ import ( // Prometheus implements targetspb.Targets gRPC that allows to fetch targets from Prometheus HTTP api/v1/targets endpoint. type Prometheus struct { + targetspb.UnimplementedTargetsServer + base *url.URL client *promclient.Client - extLabels func() labels.Labels + extLabels func() labelpb.Labels } // NewPrometheus creates new targets.Prometheus. -func NewPrometheus(base *url.URL, client *promclient.Client, extLabels func() labels.Labels) *Prometheus { +func NewPrometheus(base *url.URL, client *promclient.Client, extLabels func() labelpb.Labels) *Prometheus { return &Prometheus{ base: base, client: client, @@ -52,17 +52,15 @@ func (p *Prometheus) Targets(r *targetspb.TargetsRequest, s targetspb.Targets_Ta return nil } -func enrichTargetsWithExtLabels(targets *targetspb.TargetDiscovery, extLset labels.Labels) { +func enrichTargetsWithExtLabels(targets *targetspb.TargetDiscovery, ext labelpb.Labels) { for i, target := range targets.ActiveTargets { - target.SetDiscoveredLabels(labelpb.ExtendSortedLabels(target.DiscoveredLabels.PromLabels(), extLset)) - target.SetLabels(labelpb.ExtendSortedLabels(target.Labels.PromLabels(), extLset)) - + target.DiscoveredLabels = &labelpb.LabelSet{Labels: labelpb.ExtendSortedLabels(target.DiscoveredLabels.GetLabels(), ext)} + target.Labels = &labelpb.LabelSet{Labels: labelpb.ExtendSortedLabels(target.Labels.GetLabels(), ext)} targets.ActiveTargets[i] = target } for i, target := range targets.DroppedTargets { - target.SetDiscoveredLabels(labelpb.ExtendSortedLabels(target.DiscoveredLabels.PromLabels(), extLset)) - + target.DiscoveredLabels = &labelpb.LabelSet{Labels: labelpb.ExtendSortedLabels(target.DiscoveredLabels.GetLabels(), ext)} targets.DroppedTargets[i] = target } } diff --git a/pkg/targets/prometheus_test.go b/pkg/targets/prometheus_test.go index 6121ecc7914..ca50f9d37c6 100644 --- a/pkg/targets/prometheus_test.go +++ b/pkg/targets/prometheus_test.go @@ -13,15 +13,15 @@ import ( "github.com/efficientgo/core/testutil" "github.com/go-kit/log" - "github.com/gogo/protobuf/proto" "github.com/pkg/errors" - "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/util/annotations" "github.com/thanos-io/thanos/pkg/promclient" "github.com/thanos-io/thanos/pkg/runutil" "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/targets/targetspb" + thanostestutil "github.com/thanos-io/thanos/pkg/testutil" "github.com/thanos-io/thanos/pkg/testutil/e2eutil" + "google.golang.org/protobuf/types/known/timestamppb" ) func TestPrometheus_Targets_e2e(t *testing.T) { @@ -66,46 +66,46 @@ scrape_configs: return errors.New("empty targets response from Prometheus") })) - promTargets := NewPrometheus(u, promclient.NewDefaultClient(), func() labels.Labels { - return labels.FromStrings("replica", "test1") + promTargets := NewPrometheus(u, promclient.NewDefaultClient(), func() labelpb.Labels { + return labelpb.FromStrings("replica", "test1") }) expected := &targetspb.TargetDiscovery{ ActiveTargets: []*targetspb.ActiveTarget{ { - DiscoveredLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__address__", Value: p.Addr()}, - {Name: "__metrics_path__", Value: "/metrics"}, - {Name: "__scheme__", Value: "http"}, - {Name: "__scrape_interval__", Value: "1s"}, - {Name: "__scrape_timeout__", Value: "1s"}, - {Name: "job", Value: "myself"}, - {Name: "replica", Value: "test1"}, - }}, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "instance", Value: p.Addr()}, - {Name: "job", Value: "myself"}, - {Name: "replica", Value: "test1"}, - }}, + DiscoveredLabels: labelpb.LabelSetFromStrings( + "__address__", p.Addr(), + "__metrics_path__", "/metrics", + "__scheme__", "http", + "__scrape_interval__", "1s", + "__scrape_timeout__", "1s", + "job", "myself", + "replica", "test1", + ), + Labels: labelpb.LabelSetFromStrings( + "instance", p.Addr(), + "job", "myself", + "replica", "test1", + ), ScrapePool: "myself", ScrapeUrl: fmt.Sprintf("http://%s/metrics", p.Addr()), GlobalUrl: "", Health: targetspb.TargetHealth_UP, - LastScrape: time.Time{}, + LastScrape: timestamppb.New(time.Time{}), LastScrapeDuration: 0, }, }, DroppedTargets: []*targetspb.DroppedTarget{ { - DiscoveredLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__address__", Value: "localhost:80"}, - {Name: "__metrics_path__", Value: "/metrics"}, - {Name: "__scheme__", Value: "http"}, - {Name: "__scrape_interval__", Value: "1s"}, - {Name: "__scrape_timeout__", Value: "1s"}, - {Name: "job", Value: "myself"}, - {Name: "replica", Value: "test1"}, - }}, + DiscoveredLabels: labelpb.LabelSetFromStrings( + "__address__", "localhost:80", + "__metrics_path__", "/metrics", + "__scheme__", "http", + "__scrape_interval__", "1s", + "__scrape_timeout__", "1s", + "job", "myself", + "replica", "test1", + ), }, }, } @@ -137,7 +137,7 @@ scrape_configs: } testutil.Ok(t, err) - expectedTargets := proto.Clone(expected).(*targetspb.TargetDiscovery) + expectedTargets := expected.CloneVT() switch tcase.requestedState { case targetspb.TargetsRequest_ACTIVE: @@ -148,13 +148,13 @@ scrape_configs: for i := range targets.ActiveTargets { targets.ActiveTargets[i].LastScrapeDuration = 0 - targets.ActiveTargets[i].LastScrape = time.Time{} + targets.ActiveTargets[i].LastScrape = timestamppb.New(time.Time{}) targets.ActiveTargets[i].LastError = "" targets.ActiveTargets[i].GlobalUrl = "" } - testutil.Equals(t, expectedTargets.ActiveTargets, targets.ActiveTargets) - testutil.Equals(t, expectedTargets.DroppedTargets, targets.DroppedTargets) + thanostestutil.ProtoEquals(t, expectedTargets.ActiveTargets, targets.ActiveTargets) + thanostestutil.ProtoEquals(t, expectedTargets.DroppedTargets, targets.DroppedTargets) }) } } diff --git a/pkg/targets/proxy.go b/pkg/targets/proxy.go index 360e0ef4b0f..56dc44097ad 100644 --- a/pkg/targets/proxy.go +++ b/pkg/targets/proxy.go @@ -21,6 +21,8 @@ import ( // Proxy implements targetspb.Targets gRPC that fans out requests to given targetspb.Targets. type Proxy struct { + targetspb.UnimplementedTargetsServer + logger log.Logger targets func() []targetspb.TargetsClient } diff --git a/pkg/targets/targets.go b/pkg/targets/targets.go index 8dfe9431f77..df35ce6532e 100644 --- a/pkg/targets/targets.go +++ b/pkg/targets/targets.go @@ -11,7 +11,7 @@ import ( "github.com/pkg/errors" "github.com/prometheus/prometheus/util/annotations" - "github.com/thanos-io/thanos/pkg/store/storepb" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/targets/targetspb" ) @@ -169,8 +169,8 @@ func dedupActiveTargets(activeTargets []*targetspb.ActiveTarget, replicaLabels m return activeTargets[:i+1] } -func removeReplicaLabels(labels []storepb.Label, replicaLabels map[string]struct{}) []storepb.Label { - newLabels := make([]storepb.Label, 0, len(labels)) +func removeReplicaLabels(labels []*labelpb.Label, replicaLabels map[string]struct{}) []*labelpb.Label { + newLabels := make([]*labelpb.Label, 0, len(labels)) for _, l := range labels { if _, ok := replicaLabels[l.Name]; !ok { newLabels = append(newLabels, l) diff --git a/pkg/targets/targets_test.go b/pkg/targets/targets_test.go index c98d38a4168..57292b5236d 100644 --- a/pkg/targets/targets_test.go +++ b/pkg/targets/targets_test.go @@ -8,6 +8,8 @@ import ( "time" "github.com/efficientgo/core/testutil" + "google.golang.org/protobuf/types/known/timestamppb" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/targets/targetspb" ) @@ -29,37 +31,37 @@ func TestDedupTargets(t *testing.T) { targets: &targetspb.TargetDiscovery{ DroppedTargets: []*targetspb.DroppedTarget{ { - DiscoveredLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__address__", Value: "localhost:80"}, - {Name: "__metrics_path__", Value: "/metrics"}, - {Name: "__scheme__", Value: "http"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - {Name: "replica", Value: "0"}, - }}, + DiscoveredLabels: labelpb.LabelSetFromStrings( + "__address__", "localhost:80", + "__metrics_path__", "/metrics", + "__scheme__", "http", + "job", "myself", + "prometheus", "ha", + "replica", "0", + ), }, { - DiscoveredLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__address__", Value: "localhost:80"}, - {Name: "__metrics_path__", Value: "/metrics"}, - {Name: "__scheme__", Value: "http"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - {Name: "replica", Value: "1"}, - }}, + DiscoveredLabels: labelpb.LabelSetFromStrings( + "__address__", "localhost:80", + "__metrics_path__", "/metrics", + "__scheme__", "http", + "job", "myself", + "prometheus", "ha", + "replica", "1", + ), }, }, }, want: &targetspb.TargetDiscovery{ DroppedTargets: []*targetspb.DroppedTarget{ { - DiscoveredLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__address__", Value: "localhost:80"}, - {Name: "__metrics_path__", Value: "/metrics"}, - {Name: "__scheme__", Value: "http"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - }}, + DiscoveredLabels: labelpb.LabelSetFromStrings( + "__address__", "localhost:80", + "__metrics_path__", "/metrics", + "__scheme__", "http", + "job", "myself", + "prometheus", "ha", + ), }, }, }, @@ -70,39 +72,39 @@ func TestDedupTargets(t *testing.T) { targets: &targetspb.TargetDiscovery{ ActiveTargets: []*targetspb.ActiveTarget{ { - DiscoveredLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__address__", Value: "localhost:9090"}, - {Name: "__metrics_path__", Value: "/metrics"}, - {Name: "__scheme__", Value: "http"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - {Name: "replica", Value: "0"}, - }}, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "instance", Value: "localhost:9090"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - {Name: "replica", Value: "0"}, - }}, + DiscoveredLabels: labelpb.LabelSetFromStrings( + "__address__", "localhost:9090", + "__metrics_path__", "/metrics", + "__scheme__", "http", + "job", "myself", + "prometheus", "ha", + "replica", "0", + ), + Labels: labelpb.LabelSetFromStrings( + "instance", "localhost:9090", + "job", "myself", + "prometheus", "ha", + "replica", "0", + ), ScrapePool: "myself", ScrapeUrl: "http://localhost:9090/metrics", Health: targetspb.TargetHealth_UP, }, { - DiscoveredLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__address__", Value: "localhost:9090"}, - {Name: "__metrics_path__", Value: "/metrics"}, - {Name: "__scheme__", Value: "http"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - {Name: "replica", Value: "1"}, - }}, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "instance", Value: "localhost:9090"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - {Name: "replica", Value: "1"}, - }}, + DiscoveredLabels: labelpb.LabelSetFromStrings( + "__address__", "localhost:9090", + "__metrics_path__", "/metrics", + "__scheme__", "http", + "job", "myself", + "prometheus", "ha", + "replica", "1", + ), + Labels: labelpb.LabelSetFromStrings( + "instance", "localhost:9090", + "job", "myself", + "prometheus", "ha", + "replica", "1", + ), ScrapePool: "myself", ScrapeUrl: "http://localhost:9090/metrics", Health: targetspb.TargetHealth_UP, @@ -112,18 +114,18 @@ func TestDedupTargets(t *testing.T) { want: &targetspb.TargetDiscovery{ ActiveTargets: []*targetspb.ActiveTarget{ { - DiscoveredLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__address__", Value: "localhost:9090"}, - {Name: "__metrics_path__", Value: "/metrics"}, - {Name: "__scheme__", Value: "http"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - }}, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "instance", Value: "localhost:9090"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - }}, + DiscoveredLabels: labelpb.LabelSetFromStrings( + "__address__", "localhost:9090", + "__metrics_path__", "/metrics", + "__scheme__", "http", + "job", "myself", + "prometheus", "ha", + ), + Labels: labelpb.LabelSetFromStrings( + "instance", "localhost:9090", + "job", "myself", + "prometheus", "ha", + ), ScrapePool: "myself", ScrapeUrl: "http://localhost:9090/metrics", Health: targetspb.TargetHealth_UP, @@ -137,39 +139,39 @@ func TestDedupTargets(t *testing.T) { targets: &targetspb.TargetDiscovery{ ActiveTargets: []*targetspb.ActiveTarget{ { - DiscoveredLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__address__", Value: "localhost:9090"}, - {Name: "__metrics_path__", Value: "/metrics"}, - {Name: "__scheme__", Value: "http"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - {Name: "replica", Value: "0"}, - }}, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "instance", Value: "localhost:9090"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - {Name: "replica", Value: "0"}, - }}, + DiscoveredLabels: labelpb.LabelSetFromStrings( + "__address__", "localhost:9090", + "__metrics_path__", "/metrics", + "__scheme__", "http", + "job", "myself", + "prometheus", "ha", + "replica", "0", + ), + Labels: labelpb.LabelSetFromStrings( + "instance", "localhost:9090", + "job", "myself", + "prometheus", "ha", + "replica", "0", + ), ScrapePool: "myself", ScrapeUrl: "http://localhost:9090/metrics", Health: targetspb.TargetHealth_UP, }, { - DiscoveredLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__address__", Value: "localhost:9090"}, - {Name: "__metrics_path__", Value: "/metrics"}, - {Name: "__scheme__", Value: "http"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - {Name: "replica", Value: "1"}, - }}, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "instance", Value: "localhost:9090"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - {Name: "replica", Value: "1"}, - }}, + DiscoveredLabels: labelpb.LabelSetFromStrings( + "__address__", "localhost:9090", + "__metrics_path__", "/metrics", + "__scheme__", "http", + "job", "myself", + "prometheus", "ha", + "replica", "1", + ), + Labels: labelpb.LabelSetFromStrings( + "instance", "localhost:9090", + "job", "myself", + "prometheus", "ha", + "replica", "1", + ), ScrapePool: "myself", ScrapeUrl: "http://localhost:9090/metrics", Health: targetspb.TargetHealth_DOWN, @@ -179,18 +181,18 @@ func TestDedupTargets(t *testing.T) { want: &targetspb.TargetDiscovery{ ActiveTargets: []*targetspb.ActiveTarget{ { - DiscoveredLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__address__", Value: "localhost:9090"}, - {Name: "__metrics_path__", Value: "/metrics"}, - {Name: "__scheme__", Value: "http"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - }}, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "instance", Value: "localhost:9090"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - }}, + DiscoveredLabels: labelpb.LabelSetFromStrings( + "__address__", "localhost:9090", + "__metrics_path__", "/metrics", + "__scheme__", "http", + "job", "myself", + "prometheus", "ha", + ), + Labels: labelpb.LabelSetFromStrings( + "instance", "localhost:9090", + "job", "myself", + "prometheus", "ha", + ), ScrapePool: "myself", ScrapeUrl: "http://localhost:9090/metrics", Health: targetspb.TargetHealth_DOWN, @@ -204,66 +206,66 @@ func TestDedupTargets(t *testing.T) { targets: &targetspb.TargetDiscovery{ ActiveTargets: []*targetspb.ActiveTarget{ { - DiscoveredLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__address__", Value: "localhost:9090"}, - {Name: "__metrics_path__", Value: "/metrics"}, - {Name: "__scheme__", Value: "http"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - {Name: "replica", Value: "0"}, - }}, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "instance", Value: "localhost:9090"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - {Name: "replica", Value: "0"}, - }}, + DiscoveredLabels: labelpb.LabelSetFromStrings( + "__address__", "localhost:9090", + "__metrics_path__", "/metrics", + "__scheme__", "http", + "job", "myself", + "prometheus", "ha", + "replica", "0", + ), + Labels: labelpb.LabelSetFromStrings( + "instance", "localhost:9090", + "job", "myself", + "prometheus", "ha", + "replica", "0", + ), ScrapePool: "myself", ScrapeUrl: "http://localhost:9090/metrics", Health: targetspb.TargetHealth_UP, - LastScrape: time.Unix(1, 0), + LastScrape: timestamppb.New(time.Unix(1, 0)), }, { - DiscoveredLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__address__", Value: "localhost:9090"}, - {Name: "__metrics_path__", Value: "/metrics"}, - {Name: "__scheme__", Value: "http"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - {Name: "replica", Value: "1"}, - }}, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "instance", Value: "localhost:9090"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - {Name: "replica", Value: "1"}, - }}, + DiscoveredLabels: labelpb.LabelSetFromStrings( + "__address__", "localhost:9090", + "__metrics_path__", "/metrics", + "__scheme__", "http", + "job", "myself", + "prometheus", "ha", + "replica", "1", + ), + Labels: labelpb.LabelSetFromStrings( + "instance", "localhost:9090", + "job", "myself", + "prometheus", "ha", + "replica", "1", + ), ScrapePool: "myself", ScrapeUrl: "http://localhost:9090/metrics", Health: targetspb.TargetHealth_UP, - LastScrape: time.Unix(2, 0), + LastScrape: timestamppb.New(time.Unix(2, 0)), }, }, }, want: &targetspb.TargetDiscovery{ ActiveTargets: []*targetspb.ActiveTarget{ { - DiscoveredLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__address__", Value: "localhost:9090"}, - {Name: "__metrics_path__", Value: "/metrics"}, - {Name: "__scheme__", Value: "http"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - }}, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "instance", Value: "localhost:9090"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - }}, + DiscoveredLabels: labelpb.LabelSetFromStrings( + "__address__", "localhost:9090", + "__metrics_path__", "/metrics", + "__scheme__", "http", + "job", "myself", + "prometheus", "ha", + ), + Labels: labelpb.LabelSetFromStrings( + "instance", "localhost:9090", + "job", "myself", + "prometheus", "ha", + ), ScrapePool: "myself", ScrapeUrl: "http://localhost:9090/metrics", Health: targetspb.TargetHealth_UP, - LastScrape: time.Unix(2, 0), + LastScrape: timestamppb.New(time.Unix(2, 0)), }, }, }, diff --git a/pkg/targets/targetspb/custom.go b/pkg/targets/targetspb/custom.go index 9fb1d93620c..39c845a8300 100644 --- a/pkg/targets/targetspb/custom.go +++ b/pkg/targets/targetspb/custom.go @@ -4,11 +4,13 @@ package targetspb import ( + "encoding/json" "strconv" "strings" + "time" "github.com/pkg/errors" - "github.com/prometheus/prometheus/model/labels" + "google.golang.org/protobuf/types/known/timestamppb" "github.com/thanos-io/thanos/pkg/store/labelpb" ) @@ -64,11 +66,11 @@ func (t1 *ActiveTarget) Compare(t2 *ActiveTarget) int { return d } - if d := labels.Compare(t1.DiscoveredLabels.PromLabels(), t2.DiscoveredLabels.PromLabels()); d != 0 { + if d := labelpb.Compare(t1.DiscoveredLabels.GetLabels(), t2.DiscoveredLabels.GetLabels()); d != 0 { return d } - if d := labels.Compare(t1.Labels.PromLabels(), t2.Labels.PromLabels()); d != 0 { + if d := labelpb.Compare(t1.Labels.GetLabels(), t2.Labels.GetLabels()); d != 0 { return d } @@ -80,11 +82,11 @@ func (t1 *ActiveTarget) CompareState(t2 *ActiveTarget) int { return d } - if t1.LastScrape.Before(t2.LastScrape) { + s1, s2 := t1.LastScrape.AsTime(), t2.LastScrape.AsTime() + if s1.Before(s2) { return 1 } - - if t1.LastScrape.After(t2.LastScrape) { + if s1.After(s2) { return -1 } @@ -92,39 +94,65 @@ func (t1 *ActiveTarget) CompareState(t2 *ActiveTarget) int { } func (t1 *DroppedTarget) Compare(t2 *DroppedTarget) int { - if d := labels.Compare(t1.DiscoveredLabels.PromLabels(), t2.DiscoveredLabels.PromLabels()); d != 0 { + if d := labelpb.Compare(t1.DiscoveredLabels.GetLabels(), t2.DiscoveredLabels.GetLabels()); d != 0 { return d } return 0 } -func (t *ActiveTarget) SetLabels(ls labels.Labels) { - var result labelpb.ZLabelSet +// MarshalJSON preserves backward compatibility with the previous gogo-proto +// generated code where LastScrape was time.Time (RFC3339 string). +func (t *ActiveTarget) MarshalJSON() ([]byte, error) { + type Alias ActiveTarget + return json.Marshal(&struct { + *Alias + LastScrape time.Time `json:"lastScrape"` + }{ + Alias: (*Alias)(t), + LastScrape: t.LastScrape.AsTime(), + }) +} - if !ls.IsEmpty() { - result = labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(ls)} +// UnmarshalJSON preserves backward compatibility with the previous gogo-proto +// generated code where LastScrape was time.Time (RFC3339 string). +func (t *ActiveTarget) UnmarshalJSON(data []byte) error { + type Alias ActiveTarget + aux := &struct { + *Alias + LastScrape time.Time `json:"lastScrape"` + }{ + Alias: (*Alias)(t), } - - t.Labels = result + if err := json.Unmarshal(data, aux); err != nil { + return err + } + if !aux.LastScrape.IsZero() { + t.LastScrape = timestamppb.New(aux.LastScrape) + } + return nil } -func (t *ActiveTarget) SetDiscoveredLabels(ls labels.Labels) { - var result labelpb.ZLabelSet - - if !ls.IsEmpty() { - result = labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(ls)} +func (t *ActiveTarget) SetLabels(ls labelpb.Labels) { + if len(ls) == 0 { + t.Labels = nil + return } - - t.DiscoveredLabels = result + t.Labels = &labelpb.LabelSet{Labels: ls} } -func (t *DroppedTarget) SetDiscoveredLabels(ls labels.Labels) { - var result labelpb.ZLabelSet - - if !ls.IsEmpty() { - result = labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(ls)} +func (t *ActiveTarget) SetDiscoveredLabels(ls labelpb.Labels) { + if len(ls) == 0 { + t.DiscoveredLabels = nil + return } + t.DiscoveredLabels = &labelpb.LabelSet{Labels: ls} +} - t.DiscoveredLabels = result +func (t *DroppedTarget) SetDiscoveredLabels(ls labelpb.Labels) { + if len(ls) == 0 { + t.DiscoveredLabels = nil + return + } + t.DiscoveredLabels = &labelpb.LabelSet{Labels: ls} } diff --git a/pkg/targets/targetspb/rpc.pb.go b/pkg/targets/targetspb/rpc.pb.go index 5344c1905ec..d8aa41a9c4e 100644 --- a/pkg/targets/targetspb/rpc.pb.go +++ b/pkg/targets/targetspb/rpc.pb.go @@ -1,40 +1,32 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.20.1 // source: targets/targetspb/rpc.proto package targetspb import ( - context "context" - encoding_binary "encoding/binary" - fmt "fmt" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - - io "io" - math "math" - math_bits "math/bits" - time "time" + reflect "reflect" + sync "sync" + _ "github.com/srikrsna/protoc-gen-gotag/tagger" labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" storepb "github.com/thanos-io/thanos/pkg/store/storepb" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type TargetHealth int32 @@ -44,150 +36,193 @@ const ( TargetHealth_UNKNOWN TargetHealth = 2 ) -var TargetHealth_name = map[int32]string{ - 0: "DOWN", - 1: "UP", - 2: "UNKNOWN", -} +// Enum value maps for TargetHealth. +var ( + TargetHealth_name = map[int32]string{ + 0: "DOWN", + 1: "UP", + 2: "UNKNOWN", + } + TargetHealth_value = map[string]int32{ + "DOWN": 0, + "UP": 1, + "UNKNOWN": 2, + } +) -var TargetHealth_value = map[string]int32{ - "DOWN": 0, - "UP": 1, - "UNKNOWN": 2, +func (x TargetHealth) Enum() *TargetHealth { + p := new(TargetHealth) + *p = x + return p } func (x TargetHealth) String() string { - return proto.EnumName(TargetHealth_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TargetHealth) Descriptor() protoreflect.EnumDescriptor { + return file_targets_targetspb_rpc_proto_enumTypes[0].Descriptor() +} + +func (TargetHealth) Type() protoreflect.EnumType { + return &file_targets_targetspb_rpc_proto_enumTypes[0] +} + +func (x TargetHealth) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } +// Deprecated: Use TargetHealth.Descriptor instead. func (TargetHealth) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b5cdaee03579e907, []int{0} + return file_targets_targetspb_rpc_proto_rawDescGZIP(), []int{0} } type TargetsRequest_State int32 const ( TargetsRequest_ANY TargetsRequest_State = 0 - /// This will make sure strings.ToLower(.String()) will match 'active' and 'dropped' values for - /// Prometheus HTTP API. + // / This will make sure strings.ToLower(.String()) will match 'active' and 'dropped' values for + // / Prometheus HTTP API. TargetsRequest_ACTIVE TargetsRequest_State = 1 TargetsRequest_DROPPED TargetsRequest_State = 2 ) -var TargetsRequest_State_name = map[int32]string{ - 0: "ANY", - 1: "ACTIVE", - 2: "DROPPED", -} +// Enum value maps for TargetsRequest_State. +var ( + TargetsRequest_State_name = map[int32]string{ + 0: "ANY", + 1: "ACTIVE", + 2: "DROPPED", + } + TargetsRequest_State_value = map[string]int32{ + "ANY": 0, + "ACTIVE": 1, + "DROPPED": 2, + } +) -var TargetsRequest_State_value = map[string]int32{ - "ANY": 0, - "ACTIVE": 1, - "DROPPED": 2, +func (x TargetsRequest_State) Enum() *TargetsRequest_State { + p := new(TargetsRequest_State) + *p = x + return p } func (x TargetsRequest_State) String() string { - return proto.EnumName(TargetsRequest_State_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TargetsRequest_State) Descriptor() protoreflect.EnumDescriptor { + return file_targets_targetspb_rpc_proto_enumTypes[1].Descriptor() +} + +func (TargetsRequest_State) Type() protoreflect.EnumType { + return &file_targets_targetspb_rpc_proto_enumTypes[1] } +func (x TargetsRequest_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TargetsRequest_State.Descriptor instead. func (TargetsRequest_State) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b5cdaee03579e907, []int{0, 0} + return file_targets_targetspb_rpc_proto_rawDescGZIP(), []int{0, 0} } type TargetsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + State TargetsRequest_State `protobuf:"varint,1,opt,name=state,proto3,enum=thanos.TargetsRequest_State" json:"state,omitempty"` PartialResponseStrategy storepb.PartialResponseStrategy `protobuf:"varint,2,opt,name=partial_response_strategy,json=partialResponseStrategy,proto3,enum=thanos.PartialResponseStrategy" json:"partial_response_strategy,omitempty"` } -func (m *TargetsRequest) Reset() { *m = TargetsRequest{} } -func (m *TargetsRequest) String() string { return proto.CompactTextString(m) } -func (*TargetsRequest) ProtoMessage() {} -func (*TargetsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b5cdaee03579e907, []int{0} +func (x *TargetsRequest) Reset() { + *x = TargetsRequest{} + mi := &file_targets_targetspb_rpc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *TargetsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *TargetsRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TargetsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TargetsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*TargetsRequest) ProtoMessage() {} + +func (x *TargetsRequest) ProtoReflect() protoreflect.Message { + mi := &file_targets_targetspb_rpc_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *TargetsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TargetsRequest.Merge(m, src) -} -func (m *TargetsRequest) XXX_Size() int { - return m.Size() + +// Deprecated: Use TargetsRequest.ProtoReflect.Descriptor instead. +func (*TargetsRequest) Descriptor() ([]byte, []int) { + return file_targets_targetspb_rpc_proto_rawDescGZIP(), []int{0} } -func (m *TargetsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TargetsRequest.DiscardUnknown(m) + +func (x *TargetsRequest) GetState() TargetsRequest_State { + if x != nil { + return x.State + } + return TargetsRequest_ANY } -var xxx_messageInfo_TargetsRequest proto.InternalMessageInfo +func (x *TargetsRequest) GetPartialResponseStrategy() storepb.PartialResponseStrategy { + if x != nil { + return x.PartialResponseStrategy + } + return storepb.PartialResponseStrategy(0) +} type TargetsResponse struct { - // Types that are valid to be assigned to Result: + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Result: + // // *TargetsResponse_Targets // *TargetsResponse_Warning Result isTargetsResponse_Result `protobuf_oneof:"result"` } -func (m *TargetsResponse) Reset() { *m = TargetsResponse{} } -func (m *TargetsResponse) String() string { return proto.CompactTextString(m) } -func (*TargetsResponse) ProtoMessage() {} -func (*TargetsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b5cdaee03579e907, []int{1} -} -func (m *TargetsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TargetsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TargetsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TargetsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TargetsResponse.Merge(m, src) +func (x *TargetsResponse) Reset() { + *x = TargetsResponse{} + mi := &file_targets_targetspb_rpc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *TargetsResponse) XXX_Size() int { - return m.Size() -} -func (m *TargetsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TargetsResponse.DiscardUnknown(m) + +func (x *TargetsResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_TargetsResponse proto.InternalMessageInfo +func (*TargetsResponse) ProtoMessage() {} -type isTargetsResponse_Result interface { - isTargetsResponse_Result() - MarshalTo([]byte) (int, error) - Size() int +func (x *TargetsResponse) ProtoReflect() protoreflect.Message { + mi := &file_targets_targetspb_rpc_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -type TargetsResponse_Targets struct { - Targets *TargetDiscovery `protobuf:"bytes,1,opt,name=targets,proto3,oneof" json:"targets,omitempty"` -} -type TargetsResponse_Warning struct { - Warning string `protobuf:"bytes,2,opt,name=warning,proto3,oneof" json:"warning,omitempty"` +// Deprecated: Use TargetsResponse.ProtoReflect.Descriptor instead. +func (*TargetsResponse) Descriptor() ([]byte, []int) { + return file_targets_targetspb_rpc_proto_rawDescGZIP(), []int{1} } -func (*TargetsResponse_Targets) isTargetsResponse_Result() {} -func (*TargetsResponse_Warning) isTargetsResponse_Result() {} - func (m *TargetsResponse) GetResult() isTargetsResponse_Result { if m != nil { return m.Result @@ -195,1522 +230,421 @@ func (m *TargetsResponse) GetResult() isTargetsResponse_Result { return nil } -func (m *TargetsResponse) GetTargets() *TargetDiscovery { - if x, ok := m.GetResult().(*TargetsResponse_Targets); ok { +func (x *TargetsResponse) GetTargets() *TargetDiscovery { + if x, ok := x.GetResult().(*TargetsResponse_Targets); ok { return x.Targets } return nil } -func (m *TargetsResponse) GetWarning() string { - if x, ok := m.GetResult().(*TargetsResponse_Warning); ok { +func (x *TargetsResponse) GetWarning() string { + if x, ok := x.GetResult().(*TargetsResponse_Warning); ok { return x.Warning } return "" } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*TargetsResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*TargetsResponse_Targets)(nil), - (*TargetsResponse_Warning)(nil), - } -} - -type TargetDiscovery struct { - ActiveTargets []*ActiveTarget `protobuf:"bytes,1,rep,name=activeTargets,proto3" json:"activeTargets"` - DroppedTargets []*DroppedTarget `protobuf:"bytes,2,rep,name=droppedTargets,proto3" json:"droppedTargets"` -} - -func (m *TargetDiscovery) Reset() { *m = TargetDiscovery{} } -func (m *TargetDiscovery) String() string { return proto.CompactTextString(m) } -func (*TargetDiscovery) ProtoMessage() {} -func (*TargetDiscovery) Descriptor() ([]byte, []int) { - return fileDescriptor_b5cdaee03579e907, []int{2} -} -func (m *TargetDiscovery) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TargetDiscovery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TargetDiscovery.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TargetDiscovery) XXX_Merge(src proto.Message) { - xxx_messageInfo_TargetDiscovery.Merge(m, src) -} -func (m *TargetDiscovery) XXX_Size() int { - return m.Size() -} -func (m *TargetDiscovery) XXX_DiscardUnknown() { - xxx_messageInfo_TargetDiscovery.DiscardUnknown(m) -} - -var xxx_messageInfo_TargetDiscovery proto.InternalMessageInfo - -type ActiveTarget struct { - DiscoveredLabels labelpb.ZLabelSet `protobuf:"bytes,1,opt,name=discoveredLabels,proto3" json:"discoveredLabels"` - Labels labelpb.ZLabelSet `protobuf:"bytes,2,opt,name=labels,proto3" json:"labels"` - ScrapePool string `protobuf:"bytes,3,opt,name=scrapePool,proto3" json:"scrapePool"` - ScrapeUrl string `protobuf:"bytes,4,opt,name=scrapeUrl,proto3" json:"scrapeUrl"` - GlobalUrl string `protobuf:"bytes,5,opt,name=globalUrl,proto3" json:"globalUrl"` - LastError string `protobuf:"bytes,6,opt,name=lastError,proto3" json:"lastError"` - LastScrape time.Time `protobuf:"bytes,7,opt,name=lastScrape,proto3,stdtime" json:"lastScrape"` - LastScrapeDuration float64 `protobuf:"fixed64,8,opt,name=lastScrapeDuration,proto3" json:"lastScrapeDuration"` - Health TargetHealth `protobuf:"varint,9,opt,name=health,proto3,enum=thanos.TargetHealth" json:"health"` +type isTargetsResponse_Result interface { + isTargetsResponse_Result() } -func (m *ActiveTarget) Reset() { *m = ActiveTarget{} } -func (m *ActiveTarget) String() string { return proto.CompactTextString(m) } -func (*ActiveTarget) ProtoMessage() {} -func (*ActiveTarget) Descriptor() ([]byte, []int) { - return fileDescriptor_b5cdaee03579e907, []int{3} -} -func (m *ActiveTarget) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ActiveTarget) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActiveTarget.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ActiveTarget) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActiveTarget.Merge(m, src) -} -func (m *ActiveTarget) XXX_Size() int { - return m.Size() -} -func (m *ActiveTarget) XXX_DiscardUnknown() { - xxx_messageInfo_ActiveTarget.DiscardUnknown(m) +type TargetsResponse_Targets struct { + // / structure with targets. It is up to server implementation to decide how many of those to put here within single frame. + Targets *TargetDiscovery `protobuf:"bytes,1,opt,name=targets,proto3,oneof"` } -var xxx_messageInfo_ActiveTarget proto.InternalMessageInfo - -type DroppedTarget struct { - DiscoveredLabels labelpb.ZLabelSet `protobuf:"bytes,1,opt,name=discoveredLabels,proto3" json:"discoveredLabels"` +type TargetsResponse_Warning struct { + // / warning is considered an information piece in place of series for warning purposes. + // / It is used to warn rule API users about suspicious cases or partial response (if enabled). + Warning string `protobuf:"bytes,2,opt,name=warning,proto3,oneof"` } -func (m *DroppedTarget) Reset() { *m = DroppedTarget{} } -func (m *DroppedTarget) String() string { return proto.CompactTextString(m) } -func (*DroppedTarget) ProtoMessage() {} -func (*DroppedTarget) Descriptor() ([]byte, []int) { - return fileDescriptor_b5cdaee03579e907, []int{4} -} -func (m *DroppedTarget) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DroppedTarget) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DroppedTarget.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DroppedTarget) XXX_Merge(src proto.Message) { - xxx_messageInfo_DroppedTarget.Merge(m, src) -} -func (m *DroppedTarget) XXX_Size() int { - return m.Size() -} -func (m *DroppedTarget) XXX_DiscardUnknown() { - xxx_messageInfo_DroppedTarget.DiscardUnknown(m) -} +func (*TargetsResponse_Targets) isTargetsResponse_Result() {} -var xxx_messageInfo_DroppedTarget proto.InternalMessageInfo +func (*TargetsResponse_Warning) isTargetsResponse_Result() {} -func init() { - proto.RegisterEnum("thanos.TargetHealth", TargetHealth_name, TargetHealth_value) - proto.RegisterEnum("thanos.TargetsRequest_State", TargetsRequest_State_name, TargetsRequest_State_value) - proto.RegisterType((*TargetsRequest)(nil), "thanos.TargetsRequest") - proto.RegisterType((*TargetsResponse)(nil), "thanos.TargetsResponse") - proto.RegisterType((*TargetDiscovery)(nil), "thanos.TargetDiscovery") - proto.RegisterType((*ActiveTarget)(nil), "thanos.ActiveTarget") - proto.RegisterType((*DroppedTarget)(nil), "thanos.DroppedTarget") -} +type TargetDiscovery struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func init() { proto.RegisterFile("targets/targetspb/rpc.proto", fileDescriptor_b5cdaee03579e907) } - -var fileDescriptor_b5cdaee03579e907 = []byte{ - // 702 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x41, 0x53, 0xdb, 0x3a, - 0x10, 0xb6, 0x03, 0x38, 0x64, 0x81, 0xbc, 0xa0, 0xe1, 0x81, 0xc9, 0x7b, 0x13, 0x33, 0xb9, 0x3c, - 0x5e, 0x3b, 0x75, 0x3a, 0xe1, 0xd2, 0xce, 0xf4, 0x82, 0x1b, 0x5a, 0x3a, 0x6d, 0x43, 0xaa, 0x84, - 0x32, 0xa5, 0x07, 0x46, 0x49, 0x54, 0x27, 0x33, 0x26, 0x72, 0x25, 0x85, 0x0e, 0xff, 0x82, 0x7f, - 0xd2, 0x43, 0xff, 0x04, 0x87, 0x1e, 0x38, 0xf6, 0x94, 0xb6, 0x70, 0xcb, 0xaf, 0xe8, 0x58, 0xb6, - 0x63, 0x07, 0xd2, 0x63, 0x2f, 0xd6, 0xee, 0xb7, 0xdf, 0x7e, 0xbb, 0xb2, 0xb4, 0x82, 0x7f, 0x24, - 0xe1, 0x2e, 0x95, 0xa2, 0x12, 0xad, 0x7e, 0xbb, 0xc2, 0xfd, 0x8e, 0xed, 0x73, 0x26, 0x19, 0x32, - 0x64, 0x8f, 0x0c, 0x98, 0x28, 0x6e, 0x0a, 0xc9, 0x38, 0xad, 0xa8, 0xaf, 0xdf, 0xae, 0xc8, 0x73, - 0x9f, 0x8a, 0x90, 0x52, 0x5c, 0x73, 0x99, 0xcb, 0x94, 0x59, 0x09, 0xac, 0x08, 0x8d, 0x12, 0x3c, - 0xd2, 0xa6, 0xde, 0xad, 0x04, 0xcb, 0x65, 0xcc, 0xf5, 0x68, 0x45, 0x79, 0xed, 0xe1, 0x87, 0x8a, - 0xec, 0x9f, 0x52, 0x21, 0xc9, 0xa9, 0x1f, 0x12, 0xca, 0x5f, 0x75, 0xc8, 0xb7, 0xc2, 0x66, 0x30, - 0xfd, 0x38, 0xa4, 0x42, 0xa2, 0x2a, 0x2c, 0x08, 0x49, 0x24, 0x35, 0xf5, 0x2d, 0x7d, 0x3b, 0x5f, - 0xfd, 0xd7, 0x0e, 0xfb, 0xb2, 0xa7, 0x69, 0x76, 0x33, 0xe0, 0xe0, 0x90, 0x8a, 0xde, 0xc3, 0xa6, - 0x4f, 0xb8, 0xec, 0x13, 0xef, 0x84, 0x53, 0xe1, 0xb3, 0x81, 0xa0, 0x27, 0x42, 0x72, 0x22, 0xa9, - 0x7b, 0x6e, 0x66, 0x94, 0x8e, 0x15, 0xeb, 0x34, 0x42, 0x22, 0x8e, 0x78, 0xcd, 0x88, 0x86, 0x37, - 0xfc, 0xd9, 0x81, 0xf2, 0xff, 0xb0, 0xa0, 0x8a, 0xa1, 0x2c, 0xcc, 0xed, 0xd6, 0xdf, 0x15, 0x34, - 0x04, 0x60, 0xec, 0x3e, 0x6d, 0xbd, 0x78, 0xbb, 0x57, 0xd0, 0xd1, 0x12, 0x64, 0x6b, 0xf8, 0xa0, - 0xd1, 0xd8, 0xab, 0x15, 0x32, 0x65, 0x0f, 0xfe, 0x9a, 0xb4, 0x19, 0xaa, 0xa0, 0x1d, 0xc8, 0x46, - 0x7f, 0x5b, 0x6d, 0x68, 0xa9, 0xba, 0x31, 0xbd, 0xa1, 0x5a, 0x5f, 0x74, 0xd8, 0x19, 0xe5, 0xe7, - 0xfb, 0x1a, 0x8e, 0x99, 0xa8, 0x08, 0xd9, 0x4f, 0x84, 0x0f, 0xfa, 0x03, 0x57, 0x75, 0x9f, 0x0b, - 0x62, 0x11, 0xe0, 0x2c, 0x82, 0xc1, 0xa9, 0x18, 0x7a, 0xb2, 0xfc, 0x45, 0x8f, 0xcb, 0x4d, 0x44, - 0xd0, 0x6b, 0x58, 0x21, 0x1d, 0xd9, 0x3f, 0xa3, 0xad, 0x49, 0xd1, 0xb9, 0xed, 0xa5, 0xea, 0x5a, - 0x5c, 0x74, 0x37, 0x15, 0x74, 0x56, 0xc7, 0x23, 0x6b, 0x9a, 0x8e, 0xa7, 0x5d, 0xf4, 0x06, 0xf2, - 0x5d, 0xce, 0x7c, 0x9f, 0x76, 0x63, 0xbd, 0x8c, 0xd2, 0xfb, 0x3b, 0xd6, 0xab, 0xa5, 0xa3, 0x0e, - 0x1a, 0x8f, 0xac, 0x5b, 0x09, 0xf8, 0x96, 0x5f, 0xfe, 0x3c, 0x0f, 0xcb, 0xe9, 0x2e, 0xd0, 0x11, - 0x14, 0xba, 0x51, 0xff, 0xb4, 0xfb, 0x2a, 0xb8, 0x45, 0xf1, 0xaf, 0x5a, 0x8d, 0xab, 0x1c, 0x2b, - 0xb8, 0x49, 0xa5, 0x63, 0x5e, 0x8e, 0x2c, 0x6d, 0x3c, 0xb2, 0xee, 0xa4, 0xe0, 0x3b, 0x08, 0x7a, - 0x0c, 0x86, 0x17, 0xca, 0x65, 0x7e, 0x27, 0x97, 0x8f, 0xe4, 0x22, 0x22, 0x8e, 0x56, 0x64, 0x03, - 0x88, 0x0e, 0x27, 0x3e, 0x6d, 0x30, 0xe6, 0x99, 0x73, 0xc1, 0x19, 0x38, 0xf9, 0xf1, 0xc8, 0x4a, - 0xa1, 0x38, 0x65, 0xa3, 0xfb, 0x90, 0x0b, 0xbd, 0x43, 0xee, 0x99, 0xf3, 0x8a, 0xbe, 0x32, 0x1e, - 0x59, 0x09, 0x88, 0x13, 0x33, 0x20, 0xbb, 0x1e, 0x6b, 0x13, 0x2f, 0x20, 0x2f, 0x24, 0xe4, 0x09, - 0x88, 0x13, 0x33, 0x20, 0x7b, 0x44, 0xc8, 0x3d, 0xce, 0x19, 0x37, 0x8d, 0x84, 0x3c, 0x01, 0x71, - 0x62, 0x22, 0x0c, 0x10, 0x38, 0x4d, 0x55, 0xca, 0xcc, 0xaa, 0x5d, 0x17, 0xed, 0x70, 0x08, 0xed, - 0x78, 0x08, 0xed, 0x56, 0x3c, 0x84, 0xce, 0x7a, 0xb4, 0xfd, 0x54, 0xd6, 0xc5, 0x77, 0x4b, 0xc7, - 0x29, 0x1f, 0x3d, 0x03, 0x94, 0x78, 0xb5, 0x21, 0x27, 0xb2, 0xcf, 0x06, 0xe6, 0xe2, 0x96, 0xbe, - 0xad, 0x3b, 0xeb, 0xe3, 0x91, 0x35, 0x23, 0x8a, 0x67, 0x60, 0xe8, 0x11, 0x18, 0x3d, 0x4a, 0x3c, - 0xd9, 0x33, 0x73, 0x6a, 0x20, 0xd7, 0xa6, 0xe7, 0x60, 0x5f, 0xc5, 0x1c, 0x08, 0x0e, 0x23, 0xe4, - 0xe1, 0x68, 0x2d, 0xf7, 0x60, 0x65, 0xea, 0x9a, 0xfd, 0xb1, 0x1b, 0x73, 0xef, 0x01, 0x2c, 0xa7, - 0xbb, 0x41, 0x8b, 0x30, 0x5f, 0x3b, 0x38, 0xaa, 0x17, 0x34, 0x64, 0x40, 0xe6, 0xb0, 0x11, 0x8e, - 0xfb, 0x61, 0xfd, 0x65, 0x3d, 0x00, 0x33, 0xd5, 0xe7, 0x90, 0x8d, 0x07, 0xe5, 0x49, 0x62, 0xae, - 0xcf, 0x7e, 0xb1, 0x8a, 0x1b, 0x77, 0xf0, 0xf0, 0x89, 0x78, 0xa8, 0x3b, 0xff, 0x5d, 0xfe, 0x2c, - 0x69, 0x97, 0xd7, 0x25, 0xfd, 0xea, 0xba, 0xa4, 0xff, 0xb8, 0x2e, 0xe9, 0x17, 0x37, 0x25, 0xed, - 0xea, 0xa6, 0xa4, 0x7d, 0xbb, 0x29, 0x69, 0xc7, 0xb9, 0xc9, 0x73, 0xdd, 0x36, 0xd4, 0x21, 0xee, - 0xfc, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x2a, 0x5c, 0x84, 0x60, 0xca, 0x05, 0x00, 0x00, + ActiveTargets []*ActiveTarget `protobuf:"bytes,1,rep,name=activeTargets,proto3" json:"activeTargets"` + DroppedTargets []*DroppedTarget `protobuf:"bytes,2,rep,name=droppedTargets,proto3" json:"droppedTargets"` } -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// TargetsClient is the client API for Targets service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type TargetsClient interface { - /// Targets has info for all targets. - /// Returned targets are expected to include external labels. - Targets(ctx context.Context, in *TargetsRequest, opts ...grpc.CallOption) (Targets_TargetsClient, error) +func (x *TargetDiscovery) Reset() { + *x = TargetDiscovery{} + mi := &file_targets_targetspb_rpc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -type targetsClient struct { - cc *grpc.ClientConn +func (x *TargetDiscovery) String() string { + return protoimpl.X.MessageStringOf(x) } -func NewTargetsClient(cc *grpc.ClientConn) TargetsClient { - return &targetsClient{cc} -} +func (*TargetDiscovery) ProtoMessage() {} -func (c *targetsClient) Targets(ctx context.Context, in *TargetsRequest, opts ...grpc.CallOption) (Targets_TargetsClient, error) { - stream, err := c.cc.NewStream(ctx, &_Targets_serviceDesc.Streams[0], "/thanos.Targets/Targets", opts...) - if err != nil { - return nil, err - } - x := &targetsTargetsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err +func (x *TargetDiscovery) ProtoReflect() protoreflect.Message { + mi := &file_targets_targetspb_rpc_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return x, nil -} - -type Targets_TargetsClient interface { - Recv() (*TargetsResponse, error) - grpc.ClientStream + return mi.MessageOf(x) } -type targetsTargetsClient struct { - grpc.ClientStream +// Deprecated: Use TargetDiscovery.ProtoReflect.Descriptor instead. +func (*TargetDiscovery) Descriptor() ([]byte, []int) { + return file_targets_targetspb_rpc_proto_rawDescGZIP(), []int{2} } -func (x *targetsTargetsClient) Recv() (*TargetsResponse, error) { - m := new(TargetsResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err +func (x *TargetDiscovery) GetActiveTargets() []*ActiveTarget { + if x != nil { + return x.ActiveTargets } - return m, nil -} - -// TargetsServer is the server API for Targets service. -type TargetsServer interface { - /// Targets has info for all targets. - /// Returned targets are expected to include external labels. - Targets(*TargetsRequest, Targets_TargetsServer) error -} - -// UnimplementedTargetsServer can be embedded to have forward compatible implementations. -type UnimplementedTargetsServer struct { -} - -func (*UnimplementedTargetsServer) Targets(req *TargetsRequest, srv Targets_TargetsServer) error { - return status.Errorf(codes.Unimplemented, "method Targets not implemented") -} - -func RegisterTargetsServer(s *grpc.Server, srv TargetsServer) { - s.RegisterService(&_Targets_serviceDesc, srv) + return nil } -func _Targets_Targets_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(TargetsRequest) - if err := stream.RecvMsg(m); err != nil { - return err +func (x *TargetDiscovery) GetDroppedTargets() []*DroppedTarget { + if x != nil { + return x.DroppedTargets } - return srv.(TargetsServer).Targets(m, &targetsTargetsServer{stream}) -} - -type Targets_TargetsServer interface { - Send(*TargetsResponse) error - grpc.ServerStream -} - -type targetsTargetsServer struct { - grpc.ServerStream + return nil } -func (x *targetsTargetsServer) Send(m *TargetsResponse) error { - return x.ServerStream.SendMsg(m) -} +type ActiveTarget struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -var _Targets_serviceDesc = grpc.ServiceDesc{ - ServiceName: "thanos.Targets", - HandlerType: (*TargetsServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Targets", - Handler: _Targets_Targets_Handler, - ServerStreams: true, - }, - }, - Metadata: "targets/targetspb/rpc.proto", + DiscoveredLabels *labelpb.LabelSet `protobuf:"bytes,1,opt,name=discoveredLabels,proto3" json:"discoveredLabels"` + Labels *labelpb.LabelSet `protobuf:"bytes,2,opt,name=labels,proto3" json:"labels"` + ScrapePool string `protobuf:"bytes,3,opt,name=scrapePool,proto3" json:"scrapePool"` + ScrapeUrl string `protobuf:"bytes,4,opt,name=scrapeUrl,proto3" json:"scrapeUrl"` + GlobalUrl string `protobuf:"bytes,5,opt,name=globalUrl,proto3" json:"globalUrl"` + LastError string `protobuf:"bytes,6,opt,name=lastError,proto3" json:"lastError"` + LastScrape *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=lastScrape,proto3" json:"lastScrape"` + LastScrapeDuration float64 `protobuf:"fixed64,8,opt,name=lastScrapeDuration,proto3" json:"lastScrapeDuration"` + Health TargetHealth `protobuf:"varint,9,opt,name=health,proto3,enum=thanos.TargetHealth" json:"health"` } -func (m *TargetsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *ActiveTarget) Reset() { + *x = ActiveTarget{} + mi := &file_targets_targetspb_rpc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *TargetsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *ActiveTarget) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TargetsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) - i-- - dAtA[i] = 0x10 - } - if m.State != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.State)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} +func (*ActiveTarget) ProtoMessage() {} -func (m *TargetsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TargetsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TargetsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Result != nil { - { - size := m.Result.Size() - i -= size - if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } +func (x *ActiveTarget) ProtoReflect() protoreflect.Message { + mi := &file_targets_targetspb_rpc_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - return len(dAtA) - i, nil + return mi.MessageOf(x) } -func (m *TargetsResponse_Targets) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use ActiveTarget.ProtoReflect.Descriptor instead. +func (*ActiveTarget) Descriptor() ([]byte, []int) { + return file_targets_targetspb_rpc_proto_rawDescGZIP(), []int{3} } -func (m *TargetsResponse_Targets) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Targets != nil { - { - size, err := m.Targets.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa +func (x *ActiveTarget) GetDiscoveredLabels() *labelpb.LabelSet { + if x != nil { + return x.DiscoveredLabels } - return len(dAtA) - i, nil -} -func (m *TargetsResponse_Warning) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return nil } -func (m *TargetsResponse_Warning) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.Warning) - copy(dAtA[i:], m.Warning) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Warning))) - i-- - dAtA[i] = 0x12 - return len(dAtA) - i, nil -} -func (m *TargetDiscovery) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ActiveTarget) GetLabels() *labelpb.LabelSet { + if x != nil { + return x.Labels } - return dAtA[:n], nil -} - -func (m *TargetDiscovery) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return nil } -func (m *TargetDiscovery) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.DroppedTargets) > 0 { - for iNdEx := len(m.DroppedTargets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DroppedTargets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } +func (x *ActiveTarget) GetScrapePool() string { + if x != nil { + return x.ScrapePool } - if len(m.ActiveTargets) > 0 { - for iNdEx := len(m.ActiveTargets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ActiveTargets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil + return "" } -func (m *ActiveTarget) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ActiveTarget) GetScrapeUrl() string { + if x != nil { + return x.ScrapeUrl } - return dAtA[:n], nil -} - -func (m *ActiveTarget) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return "" } -func (m *ActiveTarget) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Health != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Health)) - i-- - dAtA[i] = 0x48 - } - if m.LastScrapeDuration != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.LastScrapeDuration)))) - i-- - dAtA[i] = 0x41 - } - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastScrape, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastScrape):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintRpc(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x3a - if len(m.LastError) > 0 { - i -= len(m.LastError) - copy(dAtA[i:], m.LastError) - i = encodeVarintRpc(dAtA, i, uint64(len(m.LastError))) - i-- - dAtA[i] = 0x32 - } - if len(m.GlobalUrl) > 0 { - i -= len(m.GlobalUrl) - copy(dAtA[i:], m.GlobalUrl) - i = encodeVarintRpc(dAtA, i, uint64(len(m.GlobalUrl))) - i-- - dAtA[i] = 0x2a - } - if len(m.ScrapeUrl) > 0 { - i -= len(m.ScrapeUrl) - copy(dAtA[i:], m.ScrapeUrl) - i = encodeVarintRpc(dAtA, i, uint64(len(m.ScrapeUrl))) - i-- - dAtA[i] = 0x22 +func (x *ActiveTarget) GetGlobalUrl() string { + if x != nil { + return x.GlobalUrl } - if len(m.ScrapePool) > 0 { - i -= len(m.ScrapePool) - copy(dAtA[i:], m.ScrapePool) - i = encodeVarintRpc(dAtA, i, uint64(len(m.ScrapePool))) - i-- - dAtA[i] = 0x1a - } - { - size, err := m.Labels.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.DiscoveredLabels.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + return "" } -func (m *DroppedTarget) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *ActiveTarget) GetLastError() string { + if x != nil { + return x.LastError } - return dAtA[:n], nil -} - -func (m *DroppedTarget) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return "" } -func (m *DroppedTarget) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.DiscoveredLabels.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) +func (x *ActiveTarget) GetLastScrape() *timestamppb.Timestamp { + if x != nil { + return x.LastScrape } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + return nil } -func encodeVarintRpc(dAtA []byte, offset int, v uint64) int { - offset -= sovRpc(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *TargetsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.State != 0 { - n += 1 + sovRpc(uint64(m.State)) +func (x *ActiveTarget) GetLastScrapeDuration() float64 { + if x != nil { + return x.LastScrapeDuration } - if m.PartialResponseStrategy != 0 { - n += 1 + sovRpc(uint64(m.PartialResponseStrategy)) - } - return n + return 0 } -func (m *TargetsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Result != nil { - n += m.Result.Size() +func (x *ActiveTarget) GetHealth() TargetHealth { + if x != nil { + return x.Health } - return n + return TargetHealth_DOWN } -func (m *TargetsResponse_Targets) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Targets != nil { - l = m.Targets.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *TargetsResponse_Warning) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Warning) - n += 1 + l + sovRpc(uint64(l)) - return n -} -func (m *TargetDiscovery) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ActiveTargets) > 0 { - for _, e := range m.ActiveTargets { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if len(m.DroppedTargets) > 0 { - for _, e := range m.DroppedTargets { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} +type DroppedTarget struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ActiveTarget) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.DiscoveredLabels.Size() - n += 1 + l + sovRpc(uint64(l)) - l = m.Labels.Size() - n += 1 + l + sovRpc(uint64(l)) - l = len(m.ScrapePool) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.ScrapeUrl) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.GlobalUrl) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.LastError) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LastScrape) - n += 1 + l + sovRpc(uint64(l)) - if m.LastScrapeDuration != 0 { - n += 9 - } - if m.Health != 0 { - n += 1 + sovRpc(uint64(m.Health)) - } - return n + DiscoveredLabels *labelpb.LabelSet `protobuf:"bytes,1,opt,name=discoveredLabels,proto3" json:"discoveredLabels"` } -func (m *DroppedTarget) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.DiscoveredLabels.Size() - n += 1 + l + sovRpc(uint64(l)) - return n +func (x *DroppedTarget) Reset() { + *x = DroppedTarget{} + mi := &file_targets_targetspb_rpc_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func sovRpc(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRpc(x uint64) (n int) { - return sovRpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +func (x *DroppedTarget) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TargetsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TargetsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TargetsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - m.State = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.State |= TargetsRequest_State(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) - } - m.PartialResponseStrategy = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PartialResponseStrategy |= storepb.PartialResponseStrategy(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TargetsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TargetsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TargetsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Targets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &TargetDiscovery{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Result = &TargetsResponse_Targets{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Warning", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Result = &TargetsResponse_Warning{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +func (*DroppedTarget) ProtoMessage() {} - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TargetDiscovery) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TargetDiscovery: wiretype end group for non-group") +func (x *DroppedTarget) ProtoReflect() protoreflect.Message { + mi := &file_targets_targetspb_rpc_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - if fieldNum <= 0 { - return fmt.Errorf("proto: TargetDiscovery: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActiveTargets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ActiveTargets = append(m.ActiveTargets, &ActiveTarget{}) - if err := m.ActiveTargets[len(m.ActiveTargets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DroppedTargets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DroppedTargets = append(m.DroppedTargets, &DroppedTarget{}) - if err := m.DroppedTargets[len(m.DroppedTargets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF + return ms } - return nil + return mi.MessageOf(x) } -func (m *ActiveTarget) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActiveTarget: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActiveTarget: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DiscoveredLabels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DiscoveredLabels.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Labels.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ScrapePool", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ScrapePool = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ScrapeUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ScrapeUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GlobalUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GlobalUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastError", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LastError = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastScrape", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.LastScrape, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field LastScrapeDuration", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.LastScrapeDuration = float64(math.Float64frombits(v)) - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Health", wireType) - } - m.Health = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Health |= TargetHealth(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +// Deprecated: Use DroppedTarget.ProtoReflect.Descriptor instead. +func (*DroppedTarget) Descriptor() ([]byte, []int) { + return file_targets_targetspb_rpc_proto_rawDescGZIP(), []int{4} } -func (m *DroppedTarget) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DroppedTarget: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DroppedTarget: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DiscoveredLabels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DiscoveredLabels.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *DroppedTarget) GetDiscoveredLabels() *labelpb.LabelSet { + if x != nil { + return x.DiscoveredLabels } return nil } -func skipRpc(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthRpc - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRpc - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRpc - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF + +var File_targets_targetspb_rpc_proto protoreflect.FileDescriptor + +var file_targets_targetspb_rpc_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x2f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x73, 0x70, 0x62, 0x2f, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x74, + 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x1a, 0x19, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x70, 0x62, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x19, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x70, 0x62, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x74, 0x61, + 0x67, 0x67, 0x65, 0x72, 0x2f, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xcc, 0x01, 0x0a, 0x0e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x5b, 0x0a, 0x19, 0x70, 0x61, 0x72, 0x74, + 0x69, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x73, 0x74, 0x72, + 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, 0x68, + 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x52, 0x17, 0x70, 0x61, + 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x72, + 0x61, 0x74, 0x65, 0x67, 0x79, 0x22, 0x29, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x07, + 0x0a, 0x03, 0x41, 0x4e, 0x59, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, + 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x52, 0x4f, 0x50, 0x50, 0x45, 0x44, 0x10, 0x02, + 0x22, 0x6c, 0x0a, 0x0f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, + 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x07, 0x77, 0x61, 0x72, 0x6e, + 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x77, 0x61, 0x72, + 0x6e, 0x69, 0x6e, 0x67, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xc3, + 0x01, 0x0a, 0x0f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x79, 0x12, 0x55, 0x0a, 0x0d, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x74, 0x68, 0x61, 0x6e, + 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x42, + 0x19, 0x9a, 0x84, 0x9e, 0x03, 0x14, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x22, 0x52, 0x0d, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x59, 0x0a, 0x0e, 0x64, 0x72, 0x6f, + 0x70, 0x70, 0x65, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x70, + 0x65, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x42, 0x1a, 0x9a, 0x84, 0x9e, 0x03, 0x15, 0x6a, + 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x73, 0x22, 0x52, 0x0e, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x73, 0x22, 0xe5, 0x04, 0x0a, 0x0c, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x5a, 0x0a, 0x10, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x65, 0x64, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, + 0x74, 0x42, 0x1c, 0x9a, 0x84, 0x9e, 0x03, 0x17, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x64, 0x69, + 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x52, + 0x10, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x12, 0x3c, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x53, 0x65, 0x74, 0x42, 0x12, 0x9a, 0x84, 0x9e, 0x03, 0x0d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, + 0x36, 0x0a, 0x0a, 0x73, 0x63, 0x72, 0x61, 0x70, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x16, 0x9a, 0x84, 0x9e, 0x03, 0x11, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, + 0x73, 0x63, 0x72, 0x61, 0x70, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x22, 0x52, 0x0a, 0x73, 0x63, 0x72, + 0x61, 0x70, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x33, 0x0a, 0x09, 0x73, 0x63, 0x72, 0x61, 0x70, + 0x65, 0x55, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x15, 0x9a, 0x84, 0x9e, 0x03, + 0x10, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x73, 0x63, 0x72, 0x61, 0x70, 0x65, 0x55, 0x72, 0x6c, + 0x22, 0x52, 0x09, 0x73, 0x63, 0x72, 0x61, 0x70, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x33, 0x0a, 0x09, + 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x55, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x15, 0x9a, 0x84, 0x9e, 0x03, 0x10, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x67, 0x6c, 0x6f, 0x62, + 0x61, 0x6c, 0x55, 0x72, 0x6c, 0x22, 0x52, 0x09, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x55, 0x72, + 0x6c, 0x12, 0x33, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x15, 0x9a, 0x84, 0x9e, 0x03, 0x10, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x22, 0x6c, 0x61, 0x73, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x52, 0x09, 0x6c, 0x61, 0x73, + 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x52, 0x0a, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x63, + 0x72, 0x61, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x16, 0x9a, 0x84, 0x9e, 0x03, 0x11, 0x6a, 0x73, 0x6f, + 0x6e, 0x3a, 0x22, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x63, 0x72, 0x61, 0x70, 0x65, 0x22, 0x52, 0x0a, + 0x6c, 0x61, 0x73, 0x74, 0x53, 0x63, 0x72, 0x61, 0x70, 0x65, 0x12, 0x4e, 0x0a, 0x12, 0x6c, 0x61, + 0x73, 0x74, 0x53, 0x63, 0x72, 0x61, 0x70, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x42, 0x1e, 0x9a, 0x84, 0x9e, 0x03, 0x19, 0x6a, 0x73, 0x6f, + 0x6e, 0x3a, 0x22, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x63, 0x72, 0x61, 0x70, 0x65, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x52, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x63, 0x72, 0x61, + 0x70, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x06, 0x68, 0x65, + 0x61, 0x6c, 0x74, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x74, 0x68, 0x61, + 0x6e, 0x6f, 0x73, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, + 0x42, 0x12, 0x9a, 0x84, 0x9e, 0x03, 0x0d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x68, 0x65, 0x61, + 0x6c, 0x74, 0x68, 0x22, 0x52, 0x06, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x22, 0x6b, 0x0a, 0x0d, + 0x44, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x5a, 0x0a, + 0x10, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, + 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x74, 0x42, 0x1c, 0x9a, 0x84, 0x9e, 0x03, 0x17, + 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x52, 0x10, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x65, 0x64, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x2a, 0x2d, 0x0a, 0x0c, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x55, 0x50, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, + 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x02, 0x32, 0x47, 0x0a, 0x07, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x73, 0x12, 0x3c, 0x0a, 0x07, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x16, + 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2e, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, + 0x01, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, + 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x2f, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x73, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRpc = fmt.Errorf("proto: unexpected end of group") + file_targets_targetspb_rpc_proto_rawDescOnce sync.Once + file_targets_targetspb_rpc_proto_rawDescData = file_targets_targetspb_rpc_proto_rawDesc ) + +func file_targets_targetspb_rpc_proto_rawDescGZIP() []byte { + file_targets_targetspb_rpc_proto_rawDescOnce.Do(func() { + file_targets_targetspb_rpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_targets_targetspb_rpc_proto_rawDescData) + }) + return file_targets_targetspb_rpc_proto_rawDescData +} + +var file_targets_targetspb_rpc_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_targets_targetspb_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_targets_targetspb_rpc_proto_goTypes = []any{ + (TargetHealth)(0), // 0: thanos.TargetHealth + (TargetsRequest_State)(0), // 1: thanos.TargetsRequest.State + (*TargetsRequest)(nil), // 2: thanos.TargetsRequest + (*TargetsResponse)(nil), // 3: thanos.TargetsResponse + (*TargetDiscovery)(nil), // 4: thanos.TargetDiscovery + (*ActiveTarget)(nil), // 5: thanos.ActiveTarget + (*DroppedTarget)(nil), // 6: thanos.DroppedTarget + (storepb.PartialResponseStrategy)(0), // 7: thanos.PartialResponseStrategy + (*labelpb.LabelSet)(nil), // 8: thanos.LabelSet + (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp +} +var file_targets_targetspb_rpc_proto_depIdxs = []int32{ + 1, // 0: thanos.TargetsRequest.state:type_name -> thanos.TargetsRequest.State + 7, // 1: thanos.TargetsRequest.partial_response_strategy:type_name -> thanos.PartialResponseStrategy + 4, // 2: thanos.TargetsResponse.targets:type_name -> thanos.TargetDiscovery + 5, // 3: thanos.TargetDiscovery.activeTargets:type_name -> thanos.ActiveTarget + 6, // 4: thanos.TargetDiscovery.droppedTargets:type_name -> thanos.DroppedTarget + 8, // 5: thanos.ActiveTarget.discoveredLabels:type_name -> thanos.LabelSet + 8, // 6: thanos.ActiveTarget.labels:type_name -> thanos.LabelSet + 9, // 7: thanos.ActiveTarget.lastScrape:type_name -> google.protobuf.Timestamp + 0, // 8: thanos.ActiveTarget.health:type_name -> thanos.TargetHealth + 8, // 9: thanos.DroppedTarget.discoveredLabels:type_name -> thanos.LabelSet + 2, // 10: thanos.Targets.Targets:input_type -> thanos.TargetsRequest + 3, // 11: thanos.Targets.Targets:output_type -> thanos.TargetsResponse + 11, // [11:12] is the sub-list for method output_type + 10, // [10:11] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_targets_targetspb_rpc_proto_init() } +func file_targets_targetspb_rpc_proto_init() { + if File_targets_targetspb_rpc_proto != nil { + return + } + file_targets_targetspb_rpc_proto_msgTypes[1].OneofWrappers = []any{ + (*TargetsResponse_Targets)(nil), + (*TargetsResponse_Warning)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_targets_targetspb_rpc_proto_rawDesc, + NumEnums: 2, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_targets_targetspb_rpc_proto_goTypes, + DependencyIndexes: file_targets_targetspb_rpc_proto_depIdxs, + EnumInfos: file_targets_targetspb_rpc_proto_enumTypes, + MessageInfos: file_targets_targetspb_rpc_proto_msgTypes, + }.Build() + File_targets_targetspb_rpc_proto = out.File + file_targets_targetspb_rpc_proto_rawDesc = nil + file_targets_targetspb_rpc_proto_goTypes = nil + file_targets_targetspb_rpc_proto_depIdxs = nil +} diff --git a/pkg/targets/targetspb/rpc.proto b/pkg/targets/targetspb/rpc.proto index 6515dc00702..e9709f6d7fc 100644 --- a/pkg/targets/targetspb/rpc.proto +++ b/pkg/targets/targetspb/rpc.proto @@ -5,22 +5,11 @@ syntax = "proto3"; package thanos; import "store/storepb/types.proto"; -import "gogoproto/gogo.proto"; import "store/labelpb/types.proto"; import "google/protobuf/timestamp.proto"; +import "tagger/tagger.proto"; -option go_package = "targetspb"; - -option (gogoproto.sizer_all) = true; -option (gogoproto.marshaler_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; +option go_package = "github.com/thanos-io/thanos/pkg/targets/targetspb"; /// Targets represents API that is responsible for gathering targets and their states. service Targets { @@ -53,8 +42,8 @@ message TargetsResponse { } message TargetDiscovery { - repeated ActiveTarget activeTargets = 1 [(gogoproto.jsontag) = "activeTargets"]; - repeated DroppedTarget droppedTargets = 2 [(gogoproto.jsontag) = "droppedTargets"]; + repeated ActiveTarget activeTargets = 1 [(tagger.tags) = "json:\"activeTargets\""]; + repeated DroppedTarget droppedTargets = 2 [(tagger.tags) = "json:\"droppedTargets\""]; } enum TargetHealth { @@ -64,17 +53,17 @@ enum TargetHealth { } message ActiveTarget { - ZLabelSet discoveredLabels = 1 [(gogoproto.jsontag) = "discoveredLabels", (gogoproto.nullable) = false]; - ZLabelSet labels = 2 [(gogoproto.jsontag) = "labels", (gogoproto.nullable) = false]; - string scrapePool = 3 [(gogoproto.jsontag) = "scrapePool"]; - string scrapeUrl = 4 [(gogoproto.jsontag) = "scrapeUrl"]; - string globalUrl = 5 [(gogoproto.jsontag) = "globalUrl"]; - string lastError = 6 [(gogoproto.jsontag) = "lastError"]; - google.protobuf.Timestamp lastScrape = 7 [(gogoproto.jsontag) = "lastScrape", (gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - double lastScrapeDuration = 8 [(gogoproto.jsontag) = "lastScrapeDuration"]; - TargetHealth health = 9 [(gogoproto.jsontag) = "health"]; + LabelSet discoveredLabels = 1 [(tagger.tags) = "json:\"discoveredLabels\""]; + LabelSet labels = 2 [(tagger.tags) = "json:\"labels\""]; + string scrapePool = 3 [(tagger.tags) = "json:\"scrapePool\""]; + string scrapeUrl = 4 [(tagger.tags) = "json:\"scrapeUrl\""]; + string globalUrl = 5 [(tagger.tags) = "json:\"globalUrl\""]; + string lastError = 6 [(tagger.tags) = "json:\"lastError\""]; + google.protobuf.Timestamp lastScrape = 7 [(tagger.tags) = "json:\"lastScrape\""]; + double lastScrapeDuration = 8 [(tagger.tags) = "json:\"lastScrapeDuration\""]; + TargetHealth health = 9 [(tagger.tags) = "json:\"health\""]; } message DroppedTarget { - ZLabelSet discoveredLabels = 1 [(gogoproto.jsontag) = "discoveredLabels", (gogoproto.nullable) = false]; + LabelSet discoveredLabels = 1 [(tagger.tags) = "json:\"discoveredLabels\""]; } diff --git a/pkg/targets/targetspb/rpc_grpc.pb.go b/pkg/targets/targetspb/rpc_grpc.pb.go new file mode 100644 index 00000000000..66adbb8d090 --- /dev/null +++ b/pkg/targets/targetspb/rpc_grpc.pb.go @@ -0,0 +1,136 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v3.20.1 +// source: targets/targetspb/rpc.proto + +package targetspb + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Targets_Targets_FullMethodName = "/thanos.Targets/Targets" +) + +// TargetsClient is the client API for Targets service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// / Targets represents API that is responsible for gathering targets and their states. +type TargetsClient interface { + // / Targets has info for all targets. + // / Returned targets are expected to include external labels. + Targets(ctx context.Context, in *TargetsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TargetsResponse], error) +} + +type targetsClient struct { + cc grpc.ClientConnInterface +} + +func NewTargetsClient(cc grpc.ClientConnInterface) TargetsClient { + return &targetsClient{cc} +} + +func (c *targetsClient) Targets(ctx context.Context, in *TargetsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TargetsResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &Targets_ServiceDesc.Streams[0], Targets_Targets_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[TargetsRequest, TargetsResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Targets_TargetsClient = grpc.ServerStreamingClient[TargetsResponse] + +// TargetsServer is the server API for Targets service. +// All implementations must embed UnimplementedTargetsServer +// for forward compatibility. +// +// / Targets represents API that is responsible for gathering targets and their states. +type TargetsServer interface { + // / Targets has info for all targets. + // / Returned targets are expected to include external labels. + Targets(*TargetsRequest, grpc.ServerStreamingServer[TargetsResponse]) error + mustEmbedUnimplementedTargetsServer() +} + +// UnimplementedTargetsServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedTargetsServer struct{} + +func (UnimplementedTargetsServer) Targets(*TargetsRequest, grpc.ServerStreamingServer[TargetsResponse]) error { + return status.Errorf(codes.Unimplemented, "method Targets not implemented") +} +func (UnimplementedTargetsServer) mustEmbedUnimplementedTargetsServer() {} +func (UnimplementedTargetsServer) testEmbeddedByValue() {} + +// UnsafeTargetsServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TargetsServer will +// result in compilation errors. +type UnsafeTargetsServer interface { + mustEmbedUnimplementedTargetsServer() +} + +func RegisterTargetsServer(s grpc.ServiceRegistrar, srv TargetsServer) { + // If the following call pancis, it indicates UnimplementedTargetsServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Targets_ServiceDesc, srv) +} + +func _Targets_Targets_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(TargetsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(TargetsServer).Targets(m, &grpc.GenericServerStream[TargetsRequest, TargetsResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Targets_TargetsServer = grpc.ServerStreamingServer[TargetsResponse] + +// Targets_ServiceDesc is the grpc.ServiceDesc for Targets service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Targets_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "thanos.Targets", + HandlerType: (*TargetsServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Targets", + Handler: _Targets_Targets_Handler, + ServerStreams: true, + }, + }, + Metadata: "targets/targetspb/rpc.proto", +} diff --git a/pkg/targets/targetspb/rpc_vtproto.pb.go b/pkg/targets/targetspb/rpc_vtproto.pb.go new file mode 100644 index 00000000000..8aaa5be83bc --- /dev/null +++ b/pkg/targets/targetspb/rpc_vtproto.pb.go @@ -0,0 +1,1504 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.1-0.20250313105119-ba97887b0a25 +// source: targets/targetspb/rpc.proto + +package targetspb + +import ( + binary "encoding/binary" + fmt "fmt" + io "io" + math "math" + + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + timestamppb1 "github.com/planetscale/vtprotobuf/types/known/timestamppb" + labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" + storepb "github.com/thanos-io/thanos/pkg/store/storepb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *TargetsRequest) CloneVT() *TargetsRequest { + if m == nil { + return (*TargetsRequest)(nil) + } + r := new(TargetsRequest) + r.State = m.State + r.PartialResponseStrategy = m.PartialResponseStrategy + return r +} + +func (m *TargetsRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *TargetsResponse) CloneVT() *TargetsResponse { + if m == nil { + return (*TargetsResponse)(nil) + } + r := new(TargetsResponse) + if m.Result != nil { + r.Result = m.Result.(interface { + CloneVT() isTargetsResponse_Result + }).CloneVT() + } + return r +} + +func (m *TargetsResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *TargetsResponse_Targets) CloneVT() isTargetsResponse_Result { + if m == nil { + return (*TargetsResponse_Targets)(nil) + } + r := new(TargetsResponse_Targets) + r.Targets = m.Targets.CloneVT() + return r +} + +func (m *TargetsResponse_Warning) CloneVT() isTargetsResponse_Result { + if m == nil { + return (*TargetsResponse_Warning)(nil) + } + r := new(TargetsResponse_Warning) + r.Warning = m.Warning + return r +} + +func (m *TargetDiscovery) CloneVT() *TargetDiscovery { + if m == nil { + return (*TargetDiscovery)(nil) + } + r := new(TargetDiscovery) + if rhs := m.ActiveTargets; rhs != nil { + tmpContainer := make([]*ActiveTarget, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.ActiveTargets = tmpContainer + } + if rhs := m.DroppedTargets; rhs != nil { + tmpContainer := make([]*DroppedTarget, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.DroppedTargets = tmpContainer + } + return r +} + +func (m *TargetDiscovery) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ActiveTarget) CloneVT() *ActiveTarget { + if m == nil { + return (*ActiveTarget)(nil) + } + r := new(ActiveTarget) + r.DiscoveredLabels = m.DiscoveredLabels.CloneVT() + r.Labels = m.Labels.CloneVT() + r.ScrapePool = m.ScrapePool + r.ScrapeUrl = m.ScrapeUrl + r.GlobalUrl = m.GlobalUrl + r.LastError = m.LastError + r.LastScrape = (*timestamppb.Timestamp)((*timestamppb1.Timestamp)(m.LastScrape).CloneVT()) + r.LastScrapeDuration = m.LastScrapeDuration + r.Health = m.Health + return r +} + +func (m *ActiveTarget) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *DroppedTarget) CloneVT() *DroppedTarget { + if m == nil { + return (*DroppedTarget)(nil) + } + r := new(DroppedTarget) + r.DiscoveredLabels = m.DiscoveredLabels.CloneVT() + return r +} + +func (m *DroppedTarget) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *TargetsRequest) EqualVT(that *TargetsRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.State != that.State { + return false + } + if this.PartialResponseStrategy != that.PartialResponseStrategy { + return false + } + return true +} + +func (this *TargetsRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*TargetsRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *TargetsResponse) EqualVT(that *TargetsResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Result == nil && that.Result != nil { + return false + } else if this.Result != nil { + if that.Result == nil { + return false + } + if !this.Result.(interface { + EqualVT(isTargetsResponse_Result) bool + }).EqualVT(that.Result) { + return false + } + } + return true +} + +func (this *TargetsResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*TargetsResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *TargetsResponse_Targets) EqualVT(thatIface isTargetsResponse_Result) bool { + that, ok := thatIface.(*TargetsResponse_Targets) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Targets, that.Targets; p != q { + if p == nil { + p = &TargetDiscovery{} + } + if q == nil { + q = &TargetDiscovery{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *TargetsResponse_Warning) EqualVT(thatIface isTargetsResponse_Result) bool { + that, ok := thatIface.(*TargetsResponse_Warning) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.Warning != that.Warning { + return false + } + return true +} + +func (this *TargetDiscovery) EqualVT(that *TargetDiscovery) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.ActiveTargets) != len(that.ActiveTargets) { + return false + } + for i, vx := range this.ActiveTargets { + vy := that.ActiveTargets[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &ActiveTarget{} + } + if q == nil { + q = &ActiveTarget{} + } + if !p.EqualVT(q) { + return false + } + } + } + if len(this.DroppedTargets) != len(that.DroppedTargets) { + return false + } + for i, vx := range this.DroppedTargets { + vy := that.DroppedTargets[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &DroppedTarget{} + } + if q == nil { + q = &DroppedTarget{} + } + if !p.EqualVT(q) { + return false + } + } + } + return true +} + +func (this *TargetDiscovery) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*TargetDiscovery) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ActiveTarget) EqualVT(that *ActiveTarget) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !this.DiscoveredLabels.EqualVT(that.DiscoveredLabels) { + return false + } + if !this.Labels.EqualVT(that.Labels) { + return false + } + if this.ScrapePool != that.ScrapePool { + return false + } + if this.ScrapeUrl != that.ScrapeUrl { + return false + } + if this.GlobalUrl != that.GlobalUrl { + return false + } + if this.LastError != that.LastError { + return false + } + if !(*timestamppb1.Timestamp)(this.LastScrape).EqualVT((*timestamppb1.Timestamp)(that.LastScrape)) { + return false + } + if this.LastScrapeDuration != that.LastScrapeDuration { + return false + } + if this.Health != that.Health { + return false + } + return true +} + +func (this *ActiveTarget) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ActiveTarget) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *DroppedTarget) EqualVT(that *DroppedTarget) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !this.DiscoveredLabels.EqualVT(that.DiscoveredLabels) { + return false + } + return true +} + +func (this *DroppedTarget) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*DroppedTarget) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *TargetsRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TargetsRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *TargetsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.PartialResponseStrategy != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PartialResponseStrategy)) + i-- + dAtA[i] = 0x10 + } + if m.State != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TargetsResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TargetsResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *TargetsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if vtmsg, ok := m.Result.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *TargetsResponse_Targets) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *TargetsResponse_Targets) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Targets != nil { + size, err := m.Targets.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *TargetsResponse_Warning) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *TargetsResponse_Warning) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Warning) + copy(dAtA[i:], m.Warning) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Warning))) + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil +} +func (m *TargetDiscovery) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TargetDiscovery) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *TargetDiscovery) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DroppedTargets) > 0 { + for iNdEx := len(m.DroppedTargets) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.DroppedTargets[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.ActiveTargets) > 0 { + for iNdEx := len(m.ActiveTargets) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.ActiveTargets[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ActiveTarget) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ActiveTarget) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ActiveTarget) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.Health != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Health)) + i-- + dAtA[i] = 0x48 + } + if m.LastScrapeDuration != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.LastScrapeDuration)))) + i-- + dAtA[i] = 0x41 + } + if m.LastScrape != nil { + size, err := (*timestamppb1.Timestamp)(m.LastScrape).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + if len(m.LastError) > 0 { + i -= len(m.LastError) + copy(dAtA[i:], m.LastError) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LastError))) + i-- + dAtA[i] = 0x32 + } + if len(m.GlobalUrl) > 0 { + i -= len(m.GlobalUrl) + copy(dAtA[i:], m.GlobalUrl) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.GlobalUrl))) + i-- + dAtA[i] = 0x2a + } + if len(m.ScrapeUrl) > 0 { + i -= len(m.ScrapeUrl) + copy(dAtA[i:], m.ScrapeUrl) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ScrapeUrl))) + i-- + dAtA[i] = 0x22 + } + if len(m.ScrapePool) > 0 { + i -= len(m.ScrapePool) + copy(dAtA[i:], m.ScrapePool) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ScrapePool))) + i-- + dAtA[i] = 0x1a + } + if m.Labels != nil { + size, err := m.Labels.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.DiscoveredLabels != nil { + size, err := m.DiscoveredLabels.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DroppedTarget) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DroppedTarget) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *DroppedTarget) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.DiscoveredLabels != nil { + size, err := m.DiscoveredLabels.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TargetsRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.State != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.State)) + } + if m.PartialResponseStrategy != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PartialResponseStrategy)) + } + return n +} + +func (m *TargetsResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Result.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + return n +} + +func (m *TargetsResponse_Targets) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Targets != nil { + l = m.Targets.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *TargetsResponse_Warning) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Warning) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return n +} +func (m *TargetDiscovery) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ActiveTargets) > 0 { + for _, e := range m.ActiveTargets { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.DroppedTargets) > 0 { + for _, e := range m.DroppedTargets { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + return n +} + +func (m *ActiveTarget) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DiscoveredLabels != nil { + l = m.DiscoveredLabels.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Labels != nil { + l = m.Labels.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.ScrapePool) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.ScrapeUrl) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.GlobalUrl) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.LastError) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.LastScrape != nil { + l = (*timestamppb1.Timestamp)(m.LastScrape).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.LastScrapeDuration != 0 { + n += 9 + } + if m.Health != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Health)) + } + return n +} + +func (m *DroppedTarget) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DiscoveredLabels != nil { + l = m.DiscoveredLabels.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} + +func (m *TargetsRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TargetsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TargetsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + m.State = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= TargetsRequest_State(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) + } + m.PartialResponseStrategy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PartialResponseStrategy |= storepb.PartialResponseStrategy(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TargetsResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TargetsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TargetsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Targets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Result.(*TargetsResponse_Targets); ok { + if err := oneof.Targets.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &TargetDiscovery{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Result = &TargetsResponse_Targets{Targets: v} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Warning", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Result = &TargetsResponse_Warning{Warning: string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TargetDiscovery) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TargetDiscovery: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TargetDiscovery: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActiveTargets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ActiveTargets = append(m.ActiveTargets, &ActiveTarget{}) + if err := m.ActiveTargets[len(m.ActiveTargets)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DroppedTargets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DroppedTargets = append(m.DroppedTargets, &DroppedTarget{}) + if err := m.DroppedTargets[len(m.DroppedTargets)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ActiveTarget) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ActiveTarget: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ActiveTarget: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DiscoveredLabels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DiscoveredLabels == nil { + m.DiscoveredLabels = &labelpb.LabelSet{} + } + if err := m.DiscoveredLabels.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = &labelpb.LabelSet{} + } + if err := m.Labels.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ScrapePool", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ScrapePool = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ScrapeUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ScrapeUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GlobalUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GlobalUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastError", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LastError = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastScrape", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LastScrape == nil { + m.LastScrape = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.LastScrape).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field LastScrapeDuration", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.LastScrapeDuration = float64(math.Float64frombits(v)) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Health", wireType) + } + m.Health = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Health |= TargetHealth(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DroppedTarget) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DroppedTarget: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DroppedTarget: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DiscoveredLabels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DiscoveredLabels == nil { + m.DiscoveredLabels = &labelpb.LabelSet{} + } + if err := m.DiscoveredLabels.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pkg/tenancy/tenancy_test.go b/pkg/tenancy/tenancy_test.go index 4418fa36e43..48c66f954de 100644 --- a/pkg/tenancy/tenancy_test.go +++ b/pkg/tenancy/tenancy_test.go @@ -12,6 +12,7 @@ import ( "github.com/pkg/errors" "github.com/thanos-io/thanos/pkg/component" "github.com/thanos-io/thanos/pkg/store" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" "github.com/thanos-io/thanos/pkg/tenancy" "google.golang.org/grpc" @@ -129,13 +130,13 @@ func TestTenantProxyPassing(t *testing.T) { nil, func() []store.Client { return cls }, component.Query, - nil, 0*time.Second, store.EagerRetrieval, + labelpb.EmptyLabels(), 0*time.Second, store.EagerRetrieval, ) // We assert directly in the mocked store apis LabelValues/LabelNames/Series funcs _, _ = q.LabelValues(ctx, &storepb.LabelValuesRequest{}) _, _ = q.LabelNames(ctx, &storepb.LabelNamesRequest{}) - seriesMatchers := []storepb.LabelMatcher{ + seriesMatchers := []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "foo", Value: "bar"}, } @@ -174,14 +175,14 @@ func TestTenantProxyPassing(t *testing.T) { nil, func() []store.Client { return cls }, component.Query, - nil, 0*time.Second, store.EagerRetrieval, + labelpb.EmptyLabels(), 0*time.Second, store.EagerRetrieval, ) // We assert directly in the mocked store apis LabelValues/LabelNames/Series funcs _, _ = q.LabelValues(ctx, &storepb.LabelValuesRequest{}) _, _ = q.LabelNames(ctx, &storepb.LabelNamesRequest{}) - seriesMatchers := []storepb.LabelMatcher{ + seriesMatchers := []*storepb.LabelMatcher{ {Type: storepb.LabelMatcher_EQ, Name: "foo", Value: "bar"}, } diff --git a/pkg/testutil/protoassert.go b/pkg/testutil/protoassert.go new file mode 100644 index 00000000000..fbefe0fe8a7 --- /dev/null +++ b/pkg/testutil/protoassert.go @@ -0,0 +1,102 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +package testutil + +import ( + "path/filepath" + "reflect" + "runtime" + "testing" + + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" +) + +// ProtoEquals fails the test if expected and actual are not equal, +// using protocmp.Transform() to properly compare protobuf messages. +// Unlike reflect.DeepEqual, this ignores internal proto fields +// (state, sizeCache, unknownFields) that can cause spurious failures. +// Nil and empty slices/maps are treated as equivalent. +// +// Equality is checked via a tiered fast path before falling back to +// cmp.Diff (which is only needed to produce a human-readable diff on +// mismatch): +// +// 1. EqualMessageVT — vtprotobuf generated, zero reflection. +// 2. proto.Equal — standard library optimized reflection. +// 3. Slice iteration — element-wise using (1) then (2). +// 4. cmp.Diff + protocmp.Transform — expensive, only on mismatch. +func ProtoEquals(tb testing.TB, expected, actual any, msgAndArgs ...any) { + ProtoEqualsWithOptions(tb, expected, actual, nil, msgAndArgs...) +} + +// vtEqualable is satisfied by all vtprotobuf-generated messages. +type vtEqualable interface { + EqualMessageVT(proto.Message) bool +} + +// fastProtoEqual returns true if expected and actual are provably equal +// using fast proto-aware checks. Returns false if equality cannot be +// confirmed (either they differ, or the types don't support fast checks). +func fastProtoEqual(expected, actual any) bool { + // Tier 1: vtprotobuf EqualMessageVT (generated code, no reflection). + if ev, ok := expected.(vtEqualable); ok { + if av, ok := actual.(proto.Message); ok { + return ev.EqualMessageVT(av) + } + } + + // Tier 2: proto.Equal (optimized reflection, no diff computation). + if ep, ok := expected.(proto.Message); ok { + if ap, ok := actual.(proto.Message); ok { + return proto.Equal(ep, ap) + } + } + + // Tier 3: slice — iterate elements and try tiers 1-2 per element. + ev := reflect.ValueOf(expected) + av := reflect.ValueOf(actual) + if ev.Kind() == reflect.Slice && av.Kind() == reflect.Slice { + if ev.Len() == 0 && av.Len() == 0 { + return true + } + if ev.Len() != av.Len() { + return false + } + for i := 0; i < ev.Len(); i++ { + if !fastProtoEqual(ev.Index(i).Interface(), av.Index(i).Interface()) { + return false + } + } + return true + } + + return false +} + +// ProtoEqualsWithOptions is like ProtoEquals but accepts additional cmp.Options. +// Use this when comparing structs with unexported fields, e.g.: +// +// thanostestutil.ProtoEqualsWithOptions(t, expected, actual, cmpopts.AllowUnexported(myStruct{})) +func ProtoEqualsWithOptions(tb testing.TB, expected, actual any, opts cmp.Options, msgAndArgs ...any) { + tb.Helper() + + // When no custom options are provided, use the tiered fast path. + // Custom options (e.g. AllowUnexported) can change equality semantics, + // so we skip the fast path in that case. + if len(opts) == 0 && fastProtoEqual(expected, actual) { + return + } + + cmpOpts := append(cmp.Options{protocmp.Transform(), cmpopts.EquateEmpty()}, opts...) + if diff := cmp.Diff(expected, actual, cmpOpts...); diff != "" { + _, file, line, _ := runtime.Caller(1) + if len(msgAndArgs) > 0 { + tb.Fatalf("\033[31m%s:%d: %s\n\nmismatch (-want +got):\n%s\033[39m", filepath.Base(file), line, msgAndArgs[0], diff) + } + tb.Fatalf("\033[31m%s:%d:\n\nmismatch (-want +got):\n%s\033[39m", filepath.Base(file), line, diff) + } +} diff --git a/pkg/testutil/protoassert_test.go b/pkg/testutil/protoassert_test.go new file mode 100644 index 00000000000..04801c1285a --- /dev/null +++ b/pkg/testutil/protoassert_test.go @@ -0,0 +1,138 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +package testutil + +import ( + "testing" + + "github.com/thanos-io/thanos/pkg/store/labelpb" +) + +func TestProtoEquals_SingleMessage(t *testing.T) { + a := &labelpb.Label{Name: "foo", Value: "bar"} + b := &labelpb.Label{Name: "foo", Value: "bar"} + ProtoEquals(t, a, b) +} + +func TestProtoEquals_IgnoresInternalFields(t *testing.T) { + a := &labelpb.Label{Name: "foo", Value: "bar"} + // Force internal proto state to diverge by serializing and deserializing. + data, err := a.MarshalVT() + if err != nil { + t.Fatal(err) + } + b := &labelpb.Label{} + if err := b.UnmarshalVT(data); err != nil { + t.Fatal(err) + } + ProtoEquals(t, a, b) +} + +func TestProtoEquals_SliceOfPointers(t *testing.T) { + a := []*labelpb.Label{ + {Name: "a", Value: "1"}, + {Name: "b", Value: "2"}, + } + b := []*labelpb.Label{ + {Name: "a", Value: "1"}, + {Name: "b", Value: "2"}, + } + ProtoEquals(t, a, b) +} + +func TestProtoEquals_NestedProtoInSlice(t *testing.T) { + a := []*labelpb.LabelSet{ + {Labels: labelpb.FromStrings("a", "1", "b", "2")}, + {Labels: labelpb.FromStrings("c", "3")}, + } + b := []*labelpb.LabelSet{ + {Labels: labelpb.FromStrings("a", "1", "b", "2")}, + {Labels: labelpb.FromStrings("c", "3")}, + } + ProtoEquals(t, a, b) +} + +func TestProtoEquals_SliceOrderMatters(t *testing.T) { + a := []*labelpb.Label{ + {Name: "a", Value: "1"}, + {Name: "b", Value: "2"}, + } + reversed := []*labelpb.Label{ + {Name: "b", Value: "2"}, + {Name: "a", Value: "1"}, + } + + mock := &mockTB{} + ProtoEquals(mock, a, reversed) + if !mock.failed { + t.Fatal("expected ProtoEquals to fail for differently-ordered slices") + } +} + +func TestProtoEquals_DifferentValues(t *testing.T) { + a := &labelpb.Label{Name: "foo", Value: "bar"} + b := &labelpb.Label{Name: "foo", Value: "baz"} + + mock := &mockTB{} + ProtoEquals(mock, a, b) + if !mock.failed { + t.Fatal("expected ProtoEquals to fail for different values") + } +} + +func TestProtoEquals_DifferentLengthSlices(t *testing.T) { + a := []*labelpb.Label{ + {Name: "a", Value: "1"}, + {Name: "b", Value: "2"}, + } + b := []*labelpb.Label{ + {Name: "a", Value: "1"}, + } + + mock := &mockTB{} + ProtoEquals(mock, a, b) + if !mock.failed { + t.Fatal("expected ProtoEquals to fail for different-length slices") + } +} + +func TestProtoEquals_NilVsEmptySlice(t *testing.T) { + var a []*labelpb.Label + b := []*labelpb.Label{} + ProtoEquals(t, a, b) +} + +func TestProtoEquals_NilVsEmptyMap(t *testing.T) { + var a map[string]*labelpb.Label + b := map[string]*labelpb.Label{} + ProtoEquals(t, a, b) +} + +func TestProtoEquals_MsgAndArgs(t *testing.T) { + a := &labelpb.Label{Name: "x", Value: "1"} + b := &labelpb.Label{Name: "x", Value: "2"} + + mock := &mockTB{} + ProtoEquals(mock, a, b, "custom message") + if !mock.failed { + t.Fatal("expected failure") + } + if mock.msg == "" { + t.Fatal("expected non-empty failure message") + } +} + +// mockTB captures Fatalf calls without killing the test process. +type mockTB struct { + testing.TB + failed bool + msg string +} + +func (m *mockTB) Helper() {} + +func (m *mockTB) Fatalf(format string, args ...interface{}) { + m.failed = true + m.msg = format +} diff --git a/pkg/unique/README.md b/pkg/unique/README.md new file mode 100644 index 00000000000..4b15effa86e --- /dev/null +++ b/pkg/unique/README.md @@ -0,0 +1,99 @@ +# pkg/unique + +String interning backed by [xsync.Map](https://github.com/puzpuzpuz/xsync) +built as a higher-throughput alternative to Go's `unique.Make[string]`. + +## Why not `unique.Make`? + +Go's `unique.Make[string]` uses a sharded mutex-based map internally. +Under concurrent workloads typical of the receive path (many goroutines +unmarshalling protobuf labels in parallel), the mutex contention becomes +a bottleneck -- particularly on the write (miss) path. + +This package uses xsync.Map, a [Cache-Line Hash Table](https://github.com/LPD-EPFL/CLHT) +where read operations are obstruction-free with no writes to shared memory. +This is the same concurrent map design used by +[puzpuzpuz/xsync](https://github.com/puzpuzpuz/xsync). Cleanup of unused +entries follows the `uintptr` + `runtime.SetFinalizer` pattern from +[go4.org/intern](https://pkg.go.dev/go4.org/intern), where pointers are +hidden from the GC so that finalizers fire when no live `Handle` references +remain. + +## Build variants + +There are two implementations, selected at compile time via build tag: + +### Default (finalizer-based cleanup) + +Entries are automatically reclaimed when no `Handle` references remain. +This is the safe default for general use. + +### `fast_intern_nogc` (no cleanup) + +Build with `-tags fast_intern_nogc` to use a simpler implementation where +interned strings are never freed. The `Handle` type is a plain string with +no pointer indirection, making the hot-path lookup cheaper. + +This variant will leak memory for strings that are interned and then never +seen again. In the context of a metric system where the same labels and +values are reused constantly, the interned set reaches a bounded steady +state and this is acceptable. Do not use this variant if your interned +key space is unbounded. + +**How bad is the leak in practice?** (Some back-of-napkin math): +Interning happens during protobuf unmarshal of metric `Label` name/value pairs -- +things like `__name__`, `job`, `instance`, `pod`. The highest-churn values +are instance and pod identifiers (~50 bytes each). Trace IDs, request IDs, etc. +are not a concern -- they would only appear if someone explicitly added them as +metric labels, which is a cardinality anti-pattern that would break TSDB +long before the intern pool matters. + +Assuming a large system with 10,000 instances turning over daily, each +producing ~5 unique churning label values at ~66 bytes per interned entry +(50 bytes content + 16 bytes Go string header): + +``` +Daily leak: 10,000 × 5 × 66 bytes ≈ 3 MB/day +Weekly leak: ≈ 23 MB +Monthly leak: ≈ 100 MB +``` + +For a receiver process typically using 4-16 GB, this is 1-2% of working +memory per month -- and redeployed well before it accumulates. + +``` +go build -tags fast_intern_nogc ./... +go test -tags fast_intern_nogc ./pkg/unique/ +``` + +## API + +- `Make(s string) Handle` -- intern a string, return a Handle +- `Handle.Value() string` -- get the interned string + +## Benchmarks + +Concurrent throughput (32 cores), 10,000 known keys (unsafe.String-backed, +simulating protobuf unmarshal), batch of 10,000 lookups per iteration: + +### Default (finalizer) vs stdlib + +``` +BenchmarkIntern_Concurrent/xsync_finalizer/hit99.99-32 172182 27430 ns/op 39 B/op 2 allocs/op +BenchmarkIntern_Concurrent/xsync_finalizer/hit99-32 87534 50415 ns/op 2704 B/op 225 allocs/op +BenchmarkIntern_Concurrent/xsync_finalizer/hit50-32 5779 575061 ns/op 150252 B/op 11740 allocs/op +BenchmarkIntern_Concurrent/stdlib_unique/hit99.99-32 90100 41133 ns/op 22 B/op 2 allocs/op +BenchmarkIntern_Concurrent/stdlib_unique/hit99-32 50424 79038 ns/op 2758 B/op 232 allocs/op +BenchmarkIntern_Concurrent/stdlib_unique/hit50-32 1602 1918517 ns/op 155432 B/op 12202 allocs/op +``` + +### `fast_intern_nogc` vs stdlib + +``` +BenchmarkIntern_Concurrent/xsync_nogc/hit99.99-32 235810 16473 ns/op 19 B/op 2 allocs/op +BenchmarkIntern_Concurrent/xsync_nogc/hit99-32 188784 23952 ns/op 2610 B/op 206 allocs/op +BenchmarkIntern_Concurrent/xsync_nogc/hit50-32 22046 154803 ns/op 142594 B/op 10906 allocs/op +BenchmarkIntern_Concurrent/stdlib_unique/hit99.99-32 90100 41133 ns/op 22 B/op 2 allocs/op +BenchmarkIntern_Concurrent/stdlib_unique/hit99-32 50424 79038 ns/op 2758 B/op 232 allocs/op +BenchmarkIntern_Concurrent/stdlib_unique/hit50-32 1602 1918517 ns/op 155432 B/op 12202 allocs/op +``` diff --git a/pkg/unique/intern.go b/pkg/unique/intern.go new file mode 100644 index 00000000000..474dbcde4fb --- /dev/null +++ b/pkg/unique/intern.go @@ -0,0 +1,127 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +//go:build !fast_intern_nogc + +// Package unique provides string interning backed by a lock-free concurrent +// map (xsync.MapOf) with finalizer-based cleanup. It is intended as a +// higher-throughput alternative to Go's unique.Make[string] for workloads +// where read-heavy lookups dominate (e.g., label name/value deduplication +// across protobuf unmarshals). +// +// Key properties: +// - Reads are obstruction-free (CLHT -- no mutex, no atomic writes to shared memory). +// - Entries are cleaned up via runtime.SetFinalizer when no Handle references remain. +// - Zero per-read GC coordination (unlike weak.Pointer.Value). +// - The hit path uses CAS rather than Store for the resurrection flag, avoiding +// cache-line dirtying when the flag is already set (steady-state hot path). +package unique + +import ( + "runtime" + "strings" + "unsafe" + + "go.uber.org/atomic" + + "github.com/puzpuzpuz/xsync/v3" +) + +// pool stores uintptr (invisible to GC) keyed by string. Cleanup +// happens via runtime.SetFinalizer on the fValue, which removes +// the map entry when no strong references remain. +var pool = xsync.NewMapOf[string, uintptr]() + +// Handle is a reference to a canonically interned string. As long as at +// least one Handle for a given string value exists, the entry remains in +// the intern table. When all Handles are collected, the GC may reclaim +// the entry via its finalizer. +// +// Handles are comparable: two Handles are equal iff they refer to the +// same canonical string (pointer equality). +type Handle struct { + val *fValue +} + +// Value returns the interned string. +func (h Handle) Value() string { + return h.val.s +} + +// fValue wraps a string with a resurrected flag to handle the race +// between finalizer execution and concurrent lookups. +type fValue struct { + s string + resurrected atomic.Bool +} + +// Make returns a Handle to the canonical interned copy of s. +// +// Safe to call with unsafe strings (e.g., from unsafe.String over a +// protobuf byte buffer). On cache hit, the input is never retained. +// On miss, a proper copy is made before storing, so the caller's +// backing memory is never held by the intern table. +// +// On hit: zero allocations (CAS avoids cache-line writes when +// resurrection flag is already set). +// On miss: one string copy + one fValue allocation. +func Make(s string) Handle { + if raw, ok := pool.Load(s); ok { + v := uintptrToFValue(raw) + // CAS rather than Store: at steady state the flag is already true + // (set by a previous hit), so CAS is a read-only no-op that avoids + // dirtying the cache line. Only the first hit after a finalizer + // cycle (which CAS'd true→false) will actually write. + v.resurrected.CompareAndSwap(false, true) + return Handle{val: v} + } + // Slow path: copy the string to detach from any unsafe backing memory, + // then atomically insert. + owned := strings.Clone(s) + raw, loaded := pool.LoadOrCompute(owned, func() uintptr { + v := &fValue{s: owned} + runtime.SetFinalizer(v, finalizerCleanup) + return fValueToUintptr(v) + }) + v := uintptrToFValue(raw) + if loaded { + v.resurrected.CompareAndSwap(false, true) + } + return Handle{val: v} +} + +// Size returns the number of entries in the intern pool. +func Size() int { + return pool.Size() +} + +// Clear removes all entries from the intern pool. Intended for testing. +func Clear() { + pool.Range(func(k string, v uintptr) bool { + pool.Delete(k) + return true + }) +} + +func fValueToUintptr(v *fValue) uintptr { + return uintptr(unsafe.Pointer(v)) +} + +// uintptrToFValue converts a uintptr back to *fValue. This is +// intentionally hiding the pointer from the GC -- the same pattern +// used by go4.org/intern. The uintptr is stored in the map so the GC +// does not consider it a reference, allowing the finalizer to fire +// when no real references remain. +func uintptrToFValue(u uintptr) *fValue { + return (*fValue)(unsafe.Add(nil, int(u))) +} + +func finalizerCleanup(v *fValue) { + if v.resurrected.CompareAndSwap(true, false) { + // Someone grabbed a reference while the finalizer was pending. + // Re-register and let the next GC cycle try again. + runtime.SetFinalizer(v, finalizerCleanup) + return + } + pool.Delete(v.s) +} diff --git a/pkg/unique/intern_bench_test.go b/pkg/unique/intern_bench_test.go new file mode 100644 index 00000000000..66fbf269b05 --- /dev/null +++ b/pkg/unique/intern_bench_test.go @@ -0,0 +1,138 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +package unique + +import ( + "fmt" + "strconv" + "testing" + stdunique "unique" + "unsafe" +) + +// Strategies under test. +type strategy struct { + name string + intern func(string) string + setup func() +} + +func strategies() []strategy { + return []strategy{ + { + name: "xsync_finalizer", + intern: func(s string) string { + return Make(s).Value() + }, + setup: Clear, + }, + { + name: "stdlib_unique", + intern: func(s string) string { + return stdunique.Make(s).Value() + }, + setup: func() {}, + }, + } +} + +// generateKeys builds n distinct byte-buffer-backed strings via unsafe.String, +// simulating the protobuf unmarshal code path where strings reference a +// reusable decode buffer. +func generateKeys(n int) []string { + keys := make([]string, n) + for i := range keys { + buf := fmt.Appendf(nil, "label_name_%06d", i) + keys[i] = unsafe.String(unsafe.SliceData(buf), len(buf)) + } + return keys +} + +// BenchmarkIntern_Serial measures single-goroutine throughput at different +// hit rates. Each b.N iteration performs a batch of 10,000 intern calls +// matching the target ratio. +func BenchmarkIntern_Serial(b *testing.B) { + keys := generateKeys(10000) + + type hitRate struct { + name string + missPerTenK int // misses per 10,000 iterations + } + rates := []hitRate{ + {"hit99.99", 1}, + {"hit99", 100}, + {"hit50", 5000}, + } + + for _, s := range strategies() { + b.Run(s.name, func(b *testing.B) { + for _, rate := range rates { + b.Run(rate.name, func(b *testing.B) { + s.setup() + for _, k := range keys { + s.intern(k) + } + b.ResetTimer() + b.ReportAllocs() + j := 0 + for i := 0; i < b.N; i++ { + for k := range 10000 { + if k < rate.missPerTenK { + s.intern("miss/" + strconv.Itoa(j)) + j++ + } else { + s.intern(keys[k]) + } + } + } + }) + } + }) + } +} + +// BenchmarkIntern_Concurrent measures parallel throughput under contention +// at different hit rates. Each pb.Next() iteration performs a batch of 10,000 +// intern calls matching the target ratio. +func BenchmarkIntern_Concurrent(b *testing.B) { + keys := generateKeys(10000) + + type hitRate struct { + name string + missPerTenK int + } + rates := []hitRate{ + {"hit99.99", 1}, + {"hit99", 100}, + {"hit50", 5000}, + } + + for _, s := range strategies() { + b.Run(s.name, func(b *testing.B) { + for _, rate := range rates { + b.Run(rate.name, func(b *testing.B) { + s.setup() + for _, k := range keys { + s.intern(k) + } + b.ResetTimer() + b.ReportAllocs() + b.RunParallel(func(pb *testing.PB) { + j := 0 + for pb.Next() { + for i := range 10000 { + if i < rate.missPerTenK { + s.intern("miss/" + strconv.Itoa(j)) + j++ + } else { + s.intern(keys[i]) + } + } + } + }) + }) + } + }) + } +} diff --git a/pkg/unique/intern_nogc.go b/pkg/unique/intern_nogc.go new file mode 100644 index 00000000000..eade60b75d1 --- /dev/null +++ b/pkg/unique/intern_nogc.go @@ -0,0 +1,70 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +//go:build fast_intern_nogc + +// Package unique provides high-throughput string interning backed by +// a lock-free concurrent map (xsync.Map) without finalizer-based +// cleanup. Interned strings live for the lifetime of the process. +// This is appropriate for workloads where the interned set is bounded +// (e.g., metric label names/values in a metric system where the same +// labels and values are reused constantly). +// +// Key properties: +// - Reads are obstruction-free (xsync CLHT). +// - Handle is a plain string -- no pointer indirection, no fValue wrapper. +// - No finalizers, no resurrection flags, no GC coordination. +package unique + +import ( + "strings" + + "github.com/puzpuzpuz/xsync/v3" +) + +// pool is the shared intern table. Entries are never removed. +var pool = xsync.NewMapOf[string, string]() + +// Handle is a reference to a canonically interned string. +// It wraps the canonical string directly -- no pointer chase. +type Handle struct { + s string +} + +// Value returns the interned string. +func (h Handle) Value() string { + return h.s +} + +// Make returns a Handle to the canonical interned copy of s. +// +// Safe to call with unsafe strings (e.g., from unsafe.String over a +// protobuf byte buffer). On cache hit, the input is never retained. +// On miss, a proper copy is made before storing. +// +// On hit: zero allocations. +// On miss: one string copy. +func Make(s string) Handle { + if v, ok := pool.Load(s); ok { + return Handle{s: v} + } + + owned := strings.Clone(s) + v, _ := pool.LoadOrCompute(owned, func() string { + return owned + }) + return Handle{s: v} +} + +// Size returns the number of entries in the intern pool. +func Size() int { + return pool.Size() +} + +// Clear removes all entries from the intern pool. Intended for testing. +func Clear() { + pool.Range(func(k string, v string) bool { + pool.Delete(k) + return true + }) +} diff --git a/pkg/unique/intern_test.go b/pkg/unique/intern_test.go new file mode 100644 index 00000000000..3904ad7c7bd --- /dev/null +++ b/pkg/unique/intern_test.go @@ -0,0 +1,104 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +package unique + +import ( + "fmt" + "sync" + "testing" + "unsafe" + + "github.com/stretchr/testify/require" +) + +func TestMake_Deduplication(t *testing.T) { + Clear() + + a := Make("hello") + b := Make("hell" + "o") // distinct allocation, same content + + require.Equal(t, a.Value(), b.Value()) + require.Equal(t, a, b, "handles for the same string must be equal") + require.Equal(t, 1, Size()) +} + +func TestMake_DistinctValues(t *testing.T) { + Clear() + + a := Make("foo") + b := Make("bar") + + require.NotEqual(t, a.Value(), b.Value()) + require.NotEqual(t, a, b) + require.Equal(t, 2, Size()) +} + +func TestMake_UnsafeStringInput(t *testing.T) { + Clear() + + // Simulate the protobuf unmarshal pattern: unsafe.String over a byte buffer. + buf := []byte("ephemeral_value") + unsafeStr := unsafe.String(unsafe.SliceData(buf), len(buf)) + h := Make(unsafeStr) + require.Equal(t, "ephemeral_value", h.Value()) + + // Mutate the original buffer to prove the interned string is detached. + buf[0] = 'X' + require.Equal(t, "ephemeral_value", h.Value(), + "interned string must not alias the input buffer") +} + +func TestMake_Concurrent(t *testing.T) { + Clear() + + const goroutines = 32 + const keysPerGoroutine = 1000 + + keys := make([]string, 100) + for i := range keys { + keys[i] = fmt.Sprintf("label_%03d", i) + } + + var wg sync.WaitGroup + wg.Add(goroutines) + results := make([][]Handle, goroutines) + + for g := 0; g < goroutines; g++ { + g := g + go func() { + defer wg.Done() + local := make([]Handle, 0, keysPerGoroutine) + for i := 0; i < keysPerGoroutine; i++ { + local = append(local, Make(keys[i%len(keys)])) + } + results[g] = local + }() + } + wg.Wait() + + require.Equal(t, 100, Size(), "should have exactly 100 unique interned strings") + + // All goroutines should have gotten the same Handle for the same key. + for i := 0; i < len(keys); i++ { + canonical := results[0][i] + for g := 1; g < goroutines; g++ { + require.Equal(t, canonical, results[g][i], + "all goroutines must get the same handle for key %q", keys[i]) + } + } +} + +func TestClear(t *testing.T) { + Clear() + + Make("a") + Make("b") + require.Equal(t, 2, Size()) + + Clear() + require.Equal(t, 0, Size()) + + Make("c") + require.Equal(t, 1, Size()) +} diff --git a/pkg/vtproto/codec.go b/pkg/vtproto/codec.go new file mode 100644 index 00000000000..b5100a18807 --- /dev/null +++ b/pkg/vtproto/codec.go @@ -0,0 +1,109 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Package vtproto registers the vtprotobuf gRPC codec so that all gRPC +// marshal/unmarshal operations use the generated MarshalVT/UnmarshalVT +// methods when available, falling back to standard proto for messages +// that don't implement them. +// +// Import this package with a blank identifier to activate the codec: +// +// import _ "github.com/thanos-io/thanos/pkg/vtproto" +package vtproto + +import ( + "fmt" + + "google.golang.org/grpc/encoding" + _ "google.golang.org/grpc/encoding/proto" + "google.golang.org/grpc/mem" + "google.golang.org/protobuf/proto" +) + +const codecName = "proto" + +type vtMarshal interface { + SizeVT() int + MarshalToSizedBufferVT([]byte) (int, error) +} + +type vtUnmarshal interface { + UnmarshalVT([]byte) error +} + +// codecV2 implements encoding.CodecV2 using VT marshal/unmarshal with +// pooled buffers from gRPC's mem.DefaultBufferPool. This avoids the +// per-call allocations of the V1 codec bridge which calls MarshalVT() +// (allocates a new []byte every time) and Materialize() (copies +// incoming data into a fresh contiguous slice). +type codecV2 struct{} + +func (codecV2) Marshal(v any) (mem.BufferSlice, error) { + vt, ok := v.(vtMarshal) + if !ok { + // Fall back to standard proto marshal for non-VT types + // (e.g. gRPC health checks, echo, reflection). + pm, ok := v.(proto.Message) + if !ok { + return nil, fmt.Errorf("vtproto codec: failed to marshal, message is %T (not a proto.Message)", v) + } + buf, err := proto.Marshal(pm) + if err != nil { + return nil, err + } + return mem.BufferSlice{mem.SliceBuffer(buf)}, nil + } + + size := vt.SizeVT() + if mem.IsBelowBufferPoolingThreshold(size) { + buf := make([]byte, size) + n, err := vt.MarshalToSizedBufferVT(buf) + if err != nil { + return nil, err + } + return mem.BufferSlice{mem.SliceBuffer(buf[:n])}, nil + } + + pool := mem.DefaultBufferPool() + buf := pool.Get(size) + n, err := vt.MarshalToSizedBufferVT((*buf)[:size]) + if err != nil { + pool.Put(buf) + return nil, err + } + *buf = (*buf)[:n] + return mem.BufferSlice{mem.NewBuffer(buf, pool)}, nil +} + +func (codecV2) Unmarshal(data mem.BufferSlice, v any) error { + // MaterializeToBuffer avoids a copy when data is already a single + // contiguous buffer (common case for unary RPCs). When it does need + // to merge chunks, it pulls from gRPC's buffer pool. + buf := data.MaterializeToBuffer(mem.DefaultBufferPool()) + defer buf.Free() + + vt, ok := v.(vtUnmarshal) + if !ok { + // Fall back to standard proto unmarshal for non-VT types. + pm, ok := v.(proto.Message) + if !ok { + return fmt.Errorf("vtproto codec: failed to unmarshal, message is %T (not a proto.Message)", v) + } + return proto.Unmarshal(buf.ReadOnlyData(), pm) + } + + return vt.UnmarshalVT(buf.ReadOnlyData()) +} + +func (codecV2) Name() string { + return codecName +} + +func init() { + // RegisterCodecV2 overwrites any prior V1 registration with the same + // name ("proto"). gRPC's getCodec checks V1 first, but since + // RegisterCodecV2 stores into the same map, the old V1 entry is + // replaced and GetCodec returns nil, causing the fallthrough to + // GetCodecV2 which finds our V2 codec. + encoding.RegisterCodecV2(&codecV2{}) +} diff --git a/pkg/vtproto/context.go b/pkg/vtproto/context.go new file mode 100644 index 00000000000..8cafe078a43 --- /dev/null +++ b/pkg/vtproto/context.go @@ -0,0 +1,25 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +package vtproto + +import ( + "context" + "sync" +) + +type returnWGKey struct{} + +// WithReturnWG returns a child context carrying the given WaitGroup. +// Used by the generated POOL_RETURN_REFCOUNT gRPC handler to let the +// application-level handler participate in reference counting. +func WithReturnWG(ctx context.Context, wg *sync.WaitGroup) context.Context { + return context.WithValue(ctx, returnWGKey{}, wg) +} + +// ReturnWGFromContext extracts the pool-return WaitGroup injected by the +// generated POOL_RETURN_REFCOUNT handler, or nil if none is present. +func ReturnWGFromContext(ctx context.Context) *sync.WaitGroup { + wg, _ := ctx.Value(returnWGKey{}).(*sync.WaitGroup) + return wg +} diff --git a/pkg/vtproto/gen/README.md b/pkg/vtproto/gen/README.md new file mode 100644 index 00000000000..4c880fb620b --- /dev/null +++ b/pkg/vtproto/gen/README.md @@ -0,0 +1,93 @@ +# protoc-gen-go-grpc-vtpool + +A `protoc` plugin that generates pool-aware gRPC server handlers. For messages with vtprotobuf's `mempool` option, the standard `protoc-gen-go-grpc` handlers allocate request objects via `new(Type)` on every call. This plugin generates replacement handlers that acquire objects from the VT pool instead, and patches the `ServiceDesc` at `init()` to swap them in. The original `_grpc.pb.go` is not modified. + +## Configuration + +Messages opt in via two proto options -- both are required: + +```protobuf +import "github.com/planetscale/vtprotobuf/vtproto/ext.proto"; +import "vtpool.proto"; + +message WriteRequest { + option (vtproto.mempool) = true; // enables vtprotobuf pool generation + option (vtpool.pool_return) = POOL_RETURN_DEFER; // controls handler return-to-pool behavior + ... +} +``` + +Messages without an explicit `pool_return` option are left untouched. + +### Pool return modes + +| Mode | Proto Value | Behavior | +| -------- | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| Defer | `POOL_RETURN_DEFER` | `defer in.ReturnToVTPool()` immediately after acquisition. Safe default -- no leaks. | +| Caller | `POOL_RETURN_CALLER` | No defer. The RPC handler takes ownership and must return the object to the pool itself. Returns to pool only on decode error. | +| Refcount | `POOL_RETURN_REFCOUNT` | Reference-counted return. A `sync.WaitGroup` is injected into the context; pool return is deferred until all holders call `Done()`. | + +Use **Defer** for most RPCs. Use **Caller** when the handler directly passes ownership and manages the lifecycle itself. Use **Refcount** when the handler fans work out to asynchronous goroutines that outlive the handler call and need the request to remain valid. + +### POOL_RETURN_REFCOUNT details + +The generated handler for `POOL_RETURN_REFCOUNT`: + +1. Acquires the request from the pool. +2. Creates a `sync.WaitGroup`, calls `wg.Add(1)`. +3. Spawns a goroutine that waits on the WG and then returns the object to the pool. +4. Defers `wg.Done()` (the handler's own reference). +5. Injects the WG into the context via `vtproto.WithReturnWG(ctx, wg)`. + +The application-level handler extracts the WG with `vtproto.ReturnWGFromContext(ctx)` and passes it through the pipeline. Any goroutine that holds a reference to the request data must call `wg.Add(1)` before the spawning function returns, and `wg.Done()` when it is finished. + +**Safety requirements:** + +- Every `wg.Add(1)` must have a matching `wg.Done()`. A missing `Done()` leaks the pooled object; a missing `Add()` causes a use-after-return race. +- `wg.Add(1)` must happen synchronously (before the parent function returns), not inside the spawned goroutine. Otherwise the pool-return goroutine may fire before the `Add` executes. +- The WG may be `nil` when the handler is called from a non-gRPC path (e.g. HTTP). Callers must guard against nil before calling `Add`/`Done`. +- The request and its sub-messages (e.g. `TimeSeries`) must not be mutated after the handler returns, since the pool-return goroutine will call `ResetVT()` on them. + +## Generated output + +For `rpc RemoteWrite(WriteRequest) returns (WriteResponse)` with `POOL_RETURN_DEFER`: + +```go +func init() { + for i, m := range WriteableStore_ServiceDesc.Methods { + switch m.MethodName { + case "RemoteWrite": + WriteableStore_ServiceDesc.Methods[i].Handler = _WriteableStore_RemoteWrite_VTPoolHandler + } + } +} + +func _WriteableStore_RemoteWrite_VTPoolHandler(srv interface{}, ctx context.Context, + dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := WriteRequestFromVTPool() + defer in.ReturnToVTPool() + if err := dec(in); err != nil { return nil, err } + if interceptor == nil { return srv.(WriteableStoreServer).RemoteWrite(ctx, in) } + ... +} +``` + +## Invocation + +The plugin is built from source and wired into `scripts/genproto.sh`, so `make proto` handles everything. To invoke manually: + +```bash +protoc \ + --go-grpc-vtpool_out=. \ + --go-grpc-vtpool_opt=paths=source_relative \ + -I="${VTPOOL_PROTO_DIR}" \ + ... +``` + +`VTPOOL_PROTO_DIR` must point to the directory containing `vtpool.proto` (`pkg/vtproto/gen/`). + +## Testing + +```bash +go test ./pkg/vtproto/gen/test/ +``` diff --git a/pkg/vtproto/gen/generator.go b/pkg/vtproto/gen/generator.go new file mode 100644 index 00000000000..50838f85804 --- /dev/null +++ b/pkg/vtproto/gen/generator.go @@ -0,0 +1,330 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +package main + +import ( + "fmt" + + "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/descriptorpb" + + vtextpb "github.com/planetscale/vtprotobuf/vtproto" + vtpoolext "github.com/thanos-io/thanos/pkg/vtproto/gen/vtpoolext" +) + +const ( + contextPackage = protogen.GoImportPath("context") + grpcPackage = protogen.GoImportPath("google.golang.org/grpc") + syncPackage = protogen.GoImportPath("sync") + vtprotoPackage = protogen.GoImportPath("github.com/thanos-io/thanos/pkg/vtproto") +) + +// hasMempool reports whether the message has option (vtproto.mempool) = true. +func hasMempool(msg *protogen.Message) bool { + opts, ok := msg.Desc.Options().(*descriptorpb.MessageOptions) + if !ok || opts == nil { + return false + } + if !proto.HasExtension(opts, vtextpb.E_Mempool) { + return false + } + switch v := proto.GetExtension(opts, vtextpb.E_Mempool).(type) { + case bool: + return v + case *bool: + return v != nil && *v + default: + return false + } +} + +// resolvePoolMode returns the pool return mode for a message, or "" if the +// message has no explicit vtpool.pool_return option set. Only messages with +// an explicit option will have pool-aware handlers generated. +func resolvePoolMode(msg *protogen.Message) string { + opts, ok := msg.Desc.Options().(*descriptorpb.MessageOptions) + if !ok || opts == nil { + return "" + } + if !proto.HasExtension(opts, vtpoolext.E_PoolReturn) { + return "" + } + switch v := proto.GetExtension(opts, vtpoolext.E_PoolReturn).(type) { + case vtpoolext.PoolReturnMode: + return poolModeString(v) + case *vtpoolext.PoolReturnMode: + if v == nil { + return "" + } + return poolModeString(*v) + default: + return "" + } +} + +func poolModeString(v vtpoolext.PoolReturnMode) string { + switch v { + case vtpoolext.PoolReturnMode_POOL_RETURN_DEFER: + return "defer" + case vtpoolext.PoolReturnMode_POOL_RETURN_CALLER: + return "caller" + case vtpoolext.PoolReturnMode_POOL_RETURN_REFCOUNT: + return "refcount" + default: + return "" + } +} + +// poolMethod holds info about a service method whose input message is poolable. +type poolMethod struct { + service *protogen.Service + method *protogen.Method + stream bool // true for server-streaming (RecvMsg pattern) + poolMode string // resolved pool return mode for this method's input +} + +// generateFile produces a _grpc_vtpool.pb.go file for proto files that have +// services with poolable input messages. +func generateFile(gen *protogen.Plugin, file *protogen.File) { + if len(file.Services) == 0 { + return + } + + var methods []poolMethod + for _, svc := range file.Services { + for _, m := range svc.Methods { + if !hasMempool(m.Input) { + continue + } + mode := resolvePoolMode(m.Input) + if mode == "" { + continue + } + if m.Desc.IsStreamingClient() { + continue + } + methods = append(methods, poolMethod{ + service: svc, + method: m, + stream: m.Desc.IsStreamingServer(), + poolMode: mode, + }) + } + } + + if len(methods) == 0 { + return + } + + filename := file.GeneratedFilenamePrefix + "_grpc_vtpool.pb.go" + g := gen.NewGeneratedFile(filename, file.GoImportPath) + + g.P("// Code generated by protoc-gen-go-grpc-vtpool. DO NOT EDIT.") + g.P("// versions:") + g.P("// - protoc-gen-go-grpc-vtpool v", version) + g.P("// source: ", file.Desc.Path()) + g.P() + g.P("package ", file.GoPackageName) + g.P() + + genInit(g, methods) + + for _, pm := range methods { + if pm.stream { + genStreamHandler(g, pm) + } else { + genUnaryHandler(g, pm) + } + } +} + +// genInit generates an init() that patches each ServiceDesc to use the +// pool-aware handler functions. +func genInit(g *protogen.GeneratedFile, methods []poolMethod) { + // Group methods by service so we patch each ServiceDesc once. + type patchEntry struct { + methodName string + handlerName string + stream bool + } + byService := make(map[string][]patchEntry) + var serviceOrder []string + for _, pm := range methods { + key := pm.service.GoName + if _, seen := byService[key]; !seen { + serviceOrder = append(serviceOrder, key) + } + byService[key] = append(byService[key], patchEntry{ + methodName: string(pm.method.Desc.Name()), + handlerName: vtPoolHandlerName(pm.service, pm.method), + stream: pm.stream, + }) + } + + g.P("func init() {") + for _, svcName := range serviceOrder { + entries := byService[svcName] + descVar := svcName + "_ServiceDesc" + + // Patch unary methods. + var unary []patchEntry + for _, e := range entries { + if !e.stream { + unary = append(unary, e) + } + } + if len(unary) > 0 { + g.P("for i, m := range ", descVar, ".Methods {") + g.P("switch m.MethodName {") + for _, e := range unary { + g.P(`case "`, e.methodName, `":`) + g.P(descVar, ".Methods[i].Handler = ", e.handlerName) + } + g.P("}") + g.P("}") + } + + // Patch streaming methods. + var streams []patchEntry + for _, e := range entries { + if e.stream { + streams = append(streams, e) + } + } + if len(streams) > 0 { + g.P("for i, s := range ", descVar, ".Streams {") + g.P("switch s.StreamName {") + for _, e := range streams { + g.P(`case "`, e.methodName, `":`) + g.P(descVar, ".Streams[i].Handler = ", e.handlerName) + } + g.P("}") + g.P("}") + } + } + g.P("}") + g.P() +} + +// genUnaryHandler generates a pool-aware unary server handler. +// +// Standard pattern (from protoc-gen-go-grpc): +// +// func _Svc_Method_Handler(srv interface{}, ctx context.Context, +// dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +// in := new(InputType) +// if err := dec(in); err != nil { return nil, err } +// ... +// } +// +// Pool-aware replacement: +// +// in := InputTypeFromVTPool() +// defer in.ReturnToVTPool() // when pool_return=POOL_RETURN_DEFER +func genUnaryHandler(g *protogen.GeneratedFile, pm poolMethod) { + svc := pm.service + method := pm.method + handlerName := vtPoolHandlerName(svc, method) + inputIdent := method.Input.GoIdent + fmSymbol := fmt.Sprintf("%s_%s_FullMethodName", svc.GoName, method.GoName) + fromPool := fromVTPoolIdent(inputIdent) + + g.P("func ", handlerName, "(srv interface{}, ctx ", contextPackage.Ident("Context"), + ", dec func(interface{}) error, interceptor ", grpcPackage.Ident("UnaryServerInterceptor"), + ") (interface{}, error) {") + + g.P("in := ", fromPool, "()") + + switch pm.poolMode { + case "defer": + g.P("defer in.ReturnToVTPool()") + case "refcount": + g.P("wg := &", syncPackage.Ident("WaitGroup"), "{}") + g.P("wg.Add(1)") + g.P("go func() {") + g.P("wg.Wait()") + g.P("in.ReturnToVTPool()") + g.P("}()") + g.P("defer wg.Done()") + g.P("ctx = ", vtprotoPackage.Ident("WithReturnWG"), "(ctx, wg)") + } + + g.P("if err := dec(in); err != nil {") + if pm.poolMode == "caller" { + g.P("in.ReturnToVTPool()") + } + g.P("return nil, err") + g.P("}") + + g.P("if interceptor == nil {") + g.P("return srv.(", svc.GoName, "Server).", method.GoName, "(ctx, in)") + g.P("}") + + g.P("info := &", grpcPackage.Ident("UnaryServerInfo"), "{") + g.P("Server: srv,") + g.P("FullMethod: ", fmSymbol, ",") + g.P("}") + + g.P("handler := func(ctx ", contextPackage.Ident("Context"), ", req interface{}) (interface{}, error) {") + g.P("return srv.(", svc.GoName, "Server).", method.GoName, "(ctx, req.(*", inputIdent, "))") + g.P("}") + + g.P("return interceptor(ctx, in, info, handler)") + g.P("}") + g.P() +} + +// genStreamHandler generates a pool-aware server-streaming handler. +// +// Standard pattern: +// +// func _Svc_Method_Handler(srv interface{}, stream grpc.ServerStream) error { +// m := new(InputType) +// if err := stream.RecvMsg(m); err != nil { return err } +// return srv.(SvcServer).Method(m, &grpc.GenericServerStream[In, Out]{ServerStream: stream}) +// } +func genStreamHandler(g *protogen.GeneratedFile, pm poolMethod) { + svc := pm.service + method := pm.method + handlerName := vtPoolHandlerName(svc, method) + inputIdent := method.Input.GoIdent + outputIdent := method.Output.GoIdent + fromPool := fromVTPoolIdent(inputIdent) + + typeParam := g.QualifiedGoIdent(inputIdent) + ", " + g.QualifiedGoIdent(outputIdent) + streamImpl := g.QualifiedGoIdent(grpcPackage.Ident("GenericServerStream")) + "[" + typeParam + "]" + + g.P("func ", handlerName, "(srv interface{}, stream ", grpcPackage.Ident("ServerStream"), ") error {") + + g.P("m := ", fromPool, "()") + if pm.poolMode == "defer" { + g.P("defer m.ReturnToVTPool()") + } + + g.P("if err := stream.RecvMsg(m); err != nil {") + if pm.poolMode == "caller" { + g.P("m.ReturnToVTPool()") + } + g.P("return err") + g.P("}") + + g.P("return srv.(", svc.GoName, "Server).", method.GoName, "(m, &", streamImpl, "{ServerStream: stream})") + g.P("}") + g.P() +} + +// vtPoolHandlerName returns the name of the pool-aware handler function. +func vtPoolHandlerName(svc *protogen.Service, method *protogen.Method) string { + return fmt.Sprintf("_%s_%s_VTPoolHandler", svc.GoName, method.GoName) +} + +// fromVTPoolIdent returns a protogen.GoIdent for the TypeFromVTPool() function. +// The pool function lives in the same package as the message type. +func fromVTPoolIdent(msgIdent protogen.GoIdent) protogen.GoIdent { + return protogen.GoIdent{ + GoName: msgIdent.GoName + "FromVTPool", + GoImportPath: msgIdent.GoImportPath, + } +} diff --git a/pkg/vtproto/gen/main.go b/pkg/vtproto/gen/main.go new file mode 100644 index 00000000000..bcdf22b8cab --- /dev/null +++ b/pkg/vtproto/gen/main.go @@ -0,0 +1,60 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// protoc-gen-go-grpc-vtpool is a protoc plugin that generates pool-aware +// gRPC server handler functions for messages that have both vtprotobuf's +// mempool option and a vtpool.pool_return option set. It produces a +// supplementary _grpc_vtpool.pb.go file that patches the ServiceDesc at +// init() time to use handlers that acquire request messages from the VT +// pool instead of heap-allocating. +// +// Messages must opt in explicitly via proto options: +// +// message WriteRequest { +// option (vtproto.mempool) = true; +// option (vtpool.pool_return) = POOL_RETURN_DEFER; +// ... +// } +// +// Pool return modes (set per-message via vtpool.pool_return): +// - POOL_RETURN_DEFER: generates defer in.ReturnToVTPool() after acquisition +// - POOL_RETURN_CALLER: no return generated; the RPC handler takes ownership +// +// Usage: +// +// protoc --go-grpc-vtpool_out=. --go-grpc-vtpool_opt=paths=source_relative foo.proto +package main + +import ( + "flag" + "fmt" + + "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/types/pluginpb" +) + +const version = "0.1.0" + +func main() { + showVersion := flag.Bool("version", false, "print the version and exit") + flag.Parse() + if *showVersion { + fmt.Printf("protoc-gen-go-grpc-vtpool %v\n", version) + return + } + + var flags flag.FlagSet + + protogen.Options{ + ParamFunc: flags.Set, + }.Run(func(gen *protogen.Plugin) error { + gen.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) + for _, f := range gen.Files { + if !f.Generate { + continue + } + generateFile(gen, f) + } + return nil + }) +} diff --git a/pkg/vtproto/gen/test/plugin_test.go b/pkg/vtproto/gen/test/plugin_test.go new file mode 100644 index 00000000000..9a6abc77343 --- /dev/null +++ b/pkg/vtproto/gen/test/plugin_test.go @@ -0,0 +1,325 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +package test + +import ( + "os" + "os/exec" + "path/filepath" + "strings" + "testing" +) + +func TestPluginGoldenOutput(t *testing.T) { + pluginBin := findPluginBinary(t) + protocBin := findProtoc(t) + + gogoProtoRoot := modDir(t, "github.com/gogo/protobuf") + vtprotoInclude := filepath.Join(modDir(t, "github.com/planetscale/vtprotobuf"), "include") + vtpoolProtoDir := filepath.Join(repoRoot(t), "pkg", "vtproto", "gen") + + testdataDir := filepath.Join(vtpoolProtoDir, "test", "testdata") + goldenPath := filepath.Join(testdataDir, "test_grpc_vtpool.pb.go.golden") + + golden, err := os.ReadFile(goldenPath) + if err != nil { + t.Fatalf("reading golden file: %v", err) + } + + outDir := t.TempDir() + + cmd := exec.Command(protocBin, + "--go-grpc-vtpool_out="+outDir, + "--go-grpc-vtpool_opt=paths=source_relative", + "--go-grpc-vtpool_opt=Mgoogle/protobuf/descriptor.proto=google.golang.org/protobuf/types/descriptorpb", + "-I="+testdataDir, + "-I="+filepath.Join(gogoProtoRoot, "protobuf"), + "-I="+vtprotoInclude, + "-I="+vtpoolProtoDir, + filepath.Join(testdataDir, "test.proto"), + ) + cmd.Env = append(os.Environ(), "PATH="+filepath.Dir(pluginBin)+":"+os.Getenv("PATH")) + out, err := cmd.CombinedOutput() + if err != nil { + t.Fatalf("protoc failed: %v\n%s", err, out) + } + + generatedPath := filepath.Join(outDir, "test_grpc_vtpool.pb.go") + generated, err := os.ReadFile(generatedPath) + if err != nil { + t.Fatalf("reading generated file: %v", err) + } + + if string(generated) != string(golden) { + t.Errorf("generated output differs from golden file.\n\n--- golden\n+++ generated\n%s", + unifiedDiff(string(golden), string(generated))) + } +} + +func TestNoOptionMethodExcluded(t *testing.T) { + pluginBin := findPluginBinary(t) + protocBin := findProtoc(t) + + gogoProtoRoot := modDir(t, "github.com/gogo/protobuf") + vtprotoInclude := filepath.Join(modDir(t, "github.com/planetscale/vtprotobuf"), "include") + vtpoolProtoDir := filepath.Join(repoRoot(t), "pkg", "vtproto", "gen") + testdataDir := filepath.Join(vtpoolProtoDir, "test", "testdata") + + outDir := t.TempDir() + + cmd := exec.Command(protocBin, + "--go-grpc-vtpool_out="+outDir, + "--go-grpc-vtpool_opt=paths=source_relative", + "--go-grpc-vtpool_opt=Mgoogle/protobuf/descriptor.proto=google.golang.org/protobuf/types/descriptorpb", + "-I="+testdataDir, + "-I="+filepath.Join(gogoProtoRoot, "protobuf"), + "-I="+vtprotoInclude, + "-I="+vtpoolProtoDir, + filepath.Join(testdataDir, "test.proto"), + ) + cmd.Env = append(os.Environ(), "PATH="+filepath.Dir(pluginBin)+":"+os.Getenv("PATH")) + out, err := cmd.CombinedOutput() + if err != nil { + t.Fatalf("protoc failed: %v\n%s", err, out) + } + + generated, err := os.ReadFile(filepath.Join(outDir, "test_grpc_vtpool.pb.go")) + if err != nil { + t.Fatalf("reading generated file: %v", err) + } + content := string(generated) + + for _, excluded := range []string{"NoOptionMethod", "PlainMethod"} { + if strings.Contains(content, excluded) { + t.Errorf("generated output should not contain %q but does", excluded) + } + } + + for _, included := range []string{ + "DeferRequestFromVTPool", + "CallerRequestFromVTPool", + "RefcountRequestFromVTPool", + "defer in.ReturnToVTPool()", + "defer m.ReturnToVTPool()", + "_TestService_DeferMethod_VTPoolHandler", + "_TestService_CallerMethod_VTPoolHandler", + "_TestService_RefcountMethod_VTPoolHandler", + "_TestService_DeferStream_VTPoolHandler", + "_TestService_CallerStream_VTPoolHandler", + "vtproto.WithReturnWG", + "sync.WaitGroup", + } { + if !strings.Contains(content, included) { + t.Errorf("generated output should contain %q but does not", included) + } + } +} + +func TestCallerModeNoDefer(t *testing.T) { + pluginBin := findPluginBinary(t) + protocBin := findProtoc(t) + + gogoProtoRoot := modDir(t, "github.com/gogo/protobuf") + vtprotoInclude := filepath.Join(modDir(t, "github.com/planetscale/vtprotobuf"), "include") + vtpoolProtoDir := filepath.Join(repoRoot(t), "pkg", "vtproto", "gen") + testdataDir := filepath.Join(vtpoolProtoDir, "test", "testdata") + + outDir := t.TempDir() + + cmd := exec.Command(protocBin, + "--go-grpc-vtpool_out="+outDir, + "--go-grpc-vtpool_opt=paths=source_relative", + "--go-grpc-vtpool_opt=Mgoogle/protobuf/descriptor.proto=google.golang.org/protobuf/types/descriptorpb", + "-I="+testdataDir, + "-I="+filepath.Join(gogoProtoRoot, "protobuf"), + "-I="+vtprotoInclude, + "-I="+vtpoolProtoDir, + filepath.Join(testdataDir, "test.proto"), + ) + cmd.Env = append(os.Environ(), "PATH="+filepath.Dir(pluginBin)+":"+os.Getenv("PATH")) + out, err := cmd.CombinedOutput() + if err != nil { + t.Fatalf("protoc failed: %v\n%s", err, out) + } + + generated, err := os.ReadFile(filepath.Join(outDir, "test_grpc_vtpool.pb.go")) + if err != nil { + t.Fatalf("reading generated file: %v", err) + } + + // The CallerMethod handler should NOT have "defer in.ReturnToVTPool()" + // but SHOULD have "in.ReturnToVTPool()" inside the error branch. + lines := strings.Split(string(generated), "\n") + inCallerHandler := false + for _, line := range lines { + if strings.Contains(line, "_TestService_CallerMethod_VTPoolHandler") { + inCallerHandler = true + } + if inCallerHandler && strings.TrimSpace(line) == "}" && !strings.Contains(line, "})") { + break + } + if inCallerHandler && strings.Contains(line, "defer") && strings.Contains(line, "ReturnToVTPool") { + t.Error("CallerMethod handler should not use defer for ReturnToVTPool") + } + } +} + +func TestRefcountModeWaitGroupAndContext(t *testing.T) { + pluginBin := findPluginBinary(t) + protocBin := findProtoc(t) + + gogoProtoRoot := modDir(t, "github.com/gogo/protobuf") + vtprotoInclude := filepath.Join(modDir(t, "github.com/planetscale/vtprotobuf"), "include") + vtpoolProtoDir := filepath.Join(repoRoot(t), "pkg", "vtproto", "gen") + testdataDir := filepath.Join(vtpoolProtoDir, "test", "testdata") + + outDir := t.TempDir() + + cmd := exec.Command(protocBin, + "--go-grpc-vtpool_out="+outDir, + "--go-grpc-vtpool_opt=paths=source_relative", + "--go-grpc-vtpool_opt=Mgoogle/protobuf/descriptor.proto=google.golang.org/protobuf/types/descriptorpb", + "-I="+testdataDir, + "-I="+filepath.Join(gogoProtoRoot, "protobuf"), + "-I="+vtprotoInclude, + "-I="+vtpoolProtoDir, + filepath.Join(testdataDir, "test.proto"), + ) + cmd.Env = append(os.Environ(), "PATH="+filepath.Dir(pluginBin)+":"+os.Getenv("PATH")) + out, err := cmd.CombinedOutput() + if err != nil { + t.Fatalf("protoc failed: %v\n%s", err, out) + } + + generated, err := os.ReadFile(filepath.Join(outDir, "test_grpc_vtpool.pb.go")) + if err != nil { + t.Fatalf("reading generated file: %v", err) + } + + lines := strings.Split(string(generated), "\n") + inRefcountHandler := false + foundWaitGroup := false + foundWithReturnWG := false + foundDeferDone := false + foundDeferReturn := false + for _, line := range lines { + if strings.Contains(line, "func _TestService_RefcountMethod_VTPoolHandler") { + inRefcountHandler = true + } + if inRefcountHandler && strings.TrimSpace(line) == "}" && !strings.Contains(line, "})") { + break + } + if inRefcountHandler { + if strings.Contains(line, "sync.WaitGroup") { + foundWaitGroup = true + } + if strings.Contains(line, "WithReturnWG") { + foundWithReturnWG = true + } + if strings.Contains(line, "defer wg.Done()") { + foundDeferDone = true + } + if strings.Contains(line, "defer") && strings.Contains(line, "ReturnToVTPool") { + foundDeferReturn = true + } + } + } + + if !foundWaitGroup { + t.Error("RefcountMethod handler should contain sync.WaitGroup") + } + if !foundWithReturnWG { + t.Error("RefcountMethod handler should contain WithReturnWG") + } + if !foundDeferDone { + t.Error("RefcountMethod handler should contain defer wg.Done()") + } + if foundDeferReturn { + t.Error("RefcountMethod handler should NOT use defer in.ReturnToVTPool()") + } +} + +// --- helpers --- + +func repoRoot(t *testing.T) string { + t.Helper() + // Walk up from this test file to find go.mod + dir, err := os.Getwd() + if err != nil { + t.Fatal(err) + } + for { + if _, err := os.Stat(filepath.Join(dir, "go.mod")); err == nil { + return dir + } + parent := filepath.Dir(dir) + if parent == dir { + t.Fatal("could not find repo root (no go.mod found)") + } + dir = parent + } +} + +func findPluginBinary(t *testing.T) string { + t.Helper() + root := repoRoot(t) + bin := filepath.Join(t.TempDir(), "protoc-gen-go-grpc-vtpool") + cmd := exec.Command("go", "build", "-o", bin, "./pkg/vtproto/gen/") + cmd.Dir = root + out, err := cmd.CombinedOutput() + if err != nil { + t.Fatalf("building plugin: %v\n%s", err, out) + } + return bin +} + +func findProtoc(t *testing.T) string { + t.Helper() + candidates := []string{ + filepath.Join(os.Getenv("HOME"), "go", "bin", "protoc-3.20.1"), + "protoc", + } + for _, c := range candidates { + if p, err := exec.LookPath(c); err == nil { + return p + } + } + t.Skip("protoc not found in PATH") + return "" +} + +func modDir(t *testing.T, mod string) string { + t.Helper() + cmd := exec.Command("go", "list", "-m", "-f", "{{.Dir}}", mod) + cmd.Dir = repoRoot(t) + out, err := cmd.Output() + if err != nil { + t.Fatalf("resolving module %s: %v", mod, err) + } + return strings.TrimSpace(string(out)) +} + +func unifiedDiff(a, b string) string { + aLines := strings.Split(a, "\n") + bLines := strings.Split(b, "\n") + var diff strings.Builder + maxLen := len(aLines) + if len(bLines) > maxLen { + maxLen = len(bLines) + } + for i := 0; i < maxLen; i++ { + lineA, lineB := "", "" + if i < len(aLines) { + lineA = aLines[i] + } + if i < len(bLines) { + lineB = bLines[i] + } + if lineA != lineB { + diff.WriteString("- " + lineA + "\n") + diff.WriteString("+ " + lineB + "\n") + } + } + return diff.String() +} diff --git a/pkg/vtproto/gen/test/testdata/test.proto b/pkg/vtproto/gen/test/testdata/test.proto new file mode 100644 index 00000000000..515076c2be7 --- /dev/null +++ b/pkg/vtproto/gen/test/testdata/test.proto @@ -0,0 +1,53 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +syntax = "proto3"; +package testpkg; + +option go_package = "github.com/thanos-io/thanos/pkg/vtproto/gen/test/testdata"; + +import "github.com/planetscale/vtprotobuf/vtproto/ext.proto"; +import "vtpool.proto"; + +message DeferRequest { + option (vtproto.mempool) = true; + option (vtpool.pool_return) = POOL_RETURN_DEFER; + string name = 1; +} + +message CallerRequest { + option (vtproto.mempool) = true; + option (vtpool.pool_return) = POOL_RETURN_CALLER; + string name = 1; +} + +message RefcountRequest { + option (vtproto.mempool) = true; + option (vtpool.pool_return) = POOL_RETURN_REFCOUNT; + string name = 1; +} + +// Has mempool but no pool_return -- should NOT get a pool-aware handler. +message NoOptionRequest { + option (vtproto.mempool) = true; + string name = 1; +} + +// Has neither mempool nor pool_return -- should be ignored entirely. +message PlainRequest { + string name = 1; +} + +message Response { + string result = 1; +} + +service TestService { + rpc DeferMethod(DeferRequest) returns (Response); + rpc CallerMethod(CallerRequest) returns (Response); + rpc RefcountMethod(RefcountRequest) returns (Response); + rpc NoOptionMethod(NoOptionRequest) returns (Response); + rpc PlainMethod(PlainRequest) returns (Response); + rpc DeferStream(DeferRequest) returns (stream Response); + rpc CallerStream(CallerRequest) returns (stream Response); +} diff --git a/pkg/vtproto/gen/test/testdata/test_grpc_vtpool.pb.go.golden b/pkg/vtproto/gen/test/testdata/test_grpc_vtpool.pb.go.golden new file mode 100644 index 00000000000..ab229e691d2 --- /dev/null +++ b/pkg/vtproto/gen/test/testdata/test_grpc_vtpool.pb.go.golden @@ -0,0 +1,116 @@ +// Code generated by protoc-gen-go-grpc-vtpool. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc-vtpool v0.1.0 +// source: test.proto + +package testdata + +import ( + context "context" + vtproto "github.com/thanos-io/thanos/pkg/vtproto" + grpc "google.golang.org/grpc" + sync "sync" +) + +func init() { + for i, m := range TestService_ServiceDesc.Methods { + switch m.MethodName { + case "DeferMethod": + TestService_ServiceDesc.Methods[i].Handler = _TestService_DeferMethod_VTPoolHandler + case "CallerMethod": + TestService_ServiceDesc.Methods[i].Handler = _TestService_CallerMethod_VTPoolHandler + case "RefcountMethod": + TestService_ServiceDesc.Methods[i].Handler = _TestService_RefcountMethod_VTPoolHandler + } + } + for i, s := range TestService_ServiceDesc.Streams { + switch s.StreamName { + case "DeferStream": + TestService_ServiceDesc.Streams[i].Handler = _TestService_DeferStream_VTPoolHandler + case "CallerStream": + TestService_ServiceDesc.Streams[i].Handler = _TestService_CallerStream_VTPoolHandler + } + } +} + +func _TestService_DeferMethod_VTPoolHandler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := DeferRequestFromVTPool() + defer in.ReturnToVTPool() + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TestServiceServer).DeferMethod(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TestService_DeferMethod_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TestServiceServer).DeferMethod(ctx, req.(*DeferRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TestService_CallerMethod_VTPoolHandler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := CallerRequestFromVTPool() + if err := dec(in); err != nil { + in.ReturnToVTPool() + return nil, err + } + if interceptor == nil { + return srv.(TestServiceServer).CallerMethod(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TestService_CallerMethod_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TestServiceServer).CallerMethod(ctx, req.(*CallerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TestService_RefcountMethod_VTPoolHandler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := RefcountRequestFromVTPool() + wg := &sync.WaitGroup{} + wg.Add(1) + go func() { + wg.Wait() + in.ReturnToVTPool() + }() + defer wg.Done() + ctx = vtproto.WithReturnWG(ctx, wg) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TestServiceServer).RefcountMethod(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TestService_RefcountMethod_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TestServiceServer).RefcountMethod(ctx, req.(*RefcountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TestService_DeferStream_VTPoolHandler(srv interface{}, stream grpc.ServerStream) error { + m := DeferRequestFromVTPool() + defer m.ReturnToVTPool() + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(TestServiceServer).DeferStream(m, &grpc.GenericServerStream[DeferRequest, Response]{ServerStream: stream}) +} + +func _TestService_CallerStream_VTPoolHandler(srv interface{}, stream grpc.ServerStream) error { + m := CallerRequestFromVTPool() + if err := stream.RecvMsg(m); err != nil { + m.ReturnToVTPool() + return err + } + return srv.(TestServiceServer).CallerStream(m, &grpc.GenericServerStream[CallerRequest, Response]{ServerStream: stream}) +} diff --git a/pkg/vtproto/gen/vtpool.proto b/pkg/vtproto/gen/vtpool.proto new file mode 100644 index 00000000000..669b2ede07e --- /dev/null +++ b/pkg/vtproto/gen/vtpool.proto @@ -0,0 +1,31 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +syntax = "proto2"; +package vtpool; + +import "google/protobuf/descriptor.proto"; + +option go_package = "github.com/thanos-io/thanos/pkg/vtproto/gen/vtpoolext"; + +// Pool return strategy for gRPC handler code generation. +enum PoolReturnMode { + // Unset / not specified. The plugin will not generate a pool-aware handler. + POOL_RETURN_UNSPECIFIED = 0; + // Generate defer in.ReturnToVTPool() immediately after acquisition. + POOL_RETURN_DEFER = 1; + // No return generated; the RPC handler takes ownership of the pooled object. + POOL_RETURN_CALLER = 2; + // Reference-counted return. The handler creates a sync.WaitGroup, injects it + // into the context via vtproto.WithReturnWG, and defers wg.Done(). A background + // goroutine waits on the WG and returns the object to the pool only when all + // references are released. Use when the RPC handler fans work out to async + // goroutines that outlive the handler call. + POOL_RETURN_REFCOUNT = 3; +} + +extend google.protobuf.MessageOptions { + // Controls how the generated gRPC handler returns this message to the VT pool. + // Only meaningful on messages that also have option (vtproto.mempool) = true. + optional PoolReturnMode pool_return = 64201; +} diff --git a/pkg/vtproto/gen/vtpoolext/vtpool.pb.go b/pkg/vtproto/gen/vtpoolext/vtpool.pb.go new file mode 100644 index 00000000000..6a3ea1e6b2f --- /dev/null +++ b/pkg/vtproto/gen/vtpoolext/vtpool.pb.go @@ -0,0 +1,193 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v6.33.0 +// source: vtpool.proto + +package vtpoolext + +import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Pool return strategy for gRPC handler code generation. +type PoolReturnMode int32 + +const ( + // Unset / not specified. The plugin will not generate a pool-aware handler. + PoolReturnMode_POOL_RETURN_UNSPECIFIED PoolReturnMode = 0 + // Generate defer in.ReturnToVTPool() immediately after acquisition. + PoolReturnMode_POOL_RETURN_DEFER PoolReturnMode = 1 + // No return generated; the RPC handler takes ownership of the pooled object. + PoolReturnMode_POOL_RETURN_CALLER PoolReturnMode = 2 + // Reference-counted return. The handler creates a sync.WaitGroup, injects it + // into the context via vtproto.WithReturnWG, and defers wg.Done(). A background + // goroutine waits on the WG and returns the object to the pool only when all + // references are released. Use when the RPC handler fans work out to async + // goroutines that outlive the handler call. + PoolReturnMode_POOL_RETURN_REFCOUNT PoolReturnMode = 3 +) + +// Enum value maps for PoolReturnMode. +var ( + PoolReturnMode_name = map[int32]string{ + 0: "POOL_RETURN_UNSPECIFIED", + 1: "POOL_RETURN_DEFER", + 2: "POOL_RETURN_CALLER", + 3: "POOL_RETURN_REFCOUNT", + } + PoolReturnMode_value = map[string]int32{ + "POOL_RETURN_UNSPECIFIED": 0, + "POOL_RETURN_DEFER": 1, + "POOL_RETURN_CALLER": 2, + "POOL_RETURN_REFCOUNT": 3, + } +) + +func (x PoolReturnMode) Enum() *PoolReturnMode { + p := new(PoolReturnMode) + *p = x + return p +} + +func (x PoolReturnMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PoolReturnMode) Descriptor() protoreflect.EnumDescriptor { + return file_vtpool_proto_enumTypes[0].Descriptor() +} + +func (PoolReturnMode) Type() protoreflect.EnumType { + return &file_vtpool_proto_enumTypes[0] +} + +func (x PoolReturnMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *PoolReturnMode) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = PoolReturnMode(num) + return nil +} + +// Deprecated: Use PoolReturnMode.Descriptor instead. +func (PoolReturnMode) EnumDescriptor() ([]byte, []int) { + return file_vtpool_proto_rawDescGZIP(), []int{0} +} + +var file_vtpool_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*PoolReturnMode)(nil), + Field: 64201, + Name: "vtpool.pool_return", + Tag: "varint,64201,opt,name=pool_return,enum=vtpool.PoolReturnMode", + Filename: "vtpool.proto", + }, +} + +// Extension fields to descriptorpb.MessageOptions. +var ( + // Controls how the generated gRPC handler returns this message to the VT pool. + // Only meaningful on messages that also have option (vtproto.mempool) = true. + // + // optional vtpool.PoolReturnMode pool_return = 64201; + E_PoolReturn = &file_vtpool_proto_extTypes[0] +) + +var File_vtpool_proto protoreflect.FileDescriptor + +var file_vtpool_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x76, 0x74, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, + 0x76, 0x74, 0x70, 0x6f, 0x6f, 0x6c, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2a, 0x76, 0x0a, 0x0e, 0x50, 0x6f, 0x6f, 0x6c, + 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x4f, + 0x4f, 0x4c, 0x5f, 0x52, 0x45, 0x54, 0x55, 0x52, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x50, 0x4f, 0x4f, 0x4c, 0x5f, + 0x52, 0x45, 0x54, 0x55, 0x52, 0x4e, 0x5f, 0x44, 0x45, 0x46, 0x45, 0x52, 0x10, 0x01, 0x12, 0x16, + 0x0a, 0x12, 0x50, 0x4f, 0x4f, 0x4c, 0x5f, 0x52, 0x45, 0x54, 0x55, 0x52, 0x4e, 0x5f, 0x43, 0x41, + 0x4c, 0x4c, 0x45, 0x52, 0x10, 0x02, 0x12, 0x18, 0x0a, 0x14, 0x50, 0x4f, 0x4f, 0x4c, 0x5f, 0x52, + 0x45, 0x54, 0x55, 0x52, 0x4e, 0x5f, 0x52, 0x45, 0x46, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x10, 0x03, + 0x3a, 0x5a, 0x0a, 0x0b, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x12, + 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0xc9, 0xf5, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x76, 0x74, 0x70, 0x6f, 0x6f, + 0x6c, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x4d, 0x6f, 0x64, 0x65, + 0x52, 0x0a, 0x70, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x42, 0x37, 0x5a, 0x35, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, + 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x74, 0x68, 0x61, 0x6e, 0x6f, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, + 0x76, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x76, 0x74, 0x70, 0x6f, + 0x6f, 0x6c, 0x65, 0x78, 0x74, +} + +var ( + file_vtpool_proto_rawDescOnce sync.Once + file_vtpool_proto_rawDescData = file_vtpool_proto_rawDesc +) + +func file_vtpool_proto_rawDescGZIP() []byte { + file_vtpool_proto_rawDescOnce.Do(func() { + file_vtpool_proto_rawDescData = protoimpl.X.CompressGZIP(file_vtpool_proto_rawDescData) + }) + return file_vtpool_proto_rawDescData +} + +var file_vtpool_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_vtpool_proto_goTypes = []any{ + (PoolReturnMode)(0), // 0: vtpool.PoolReturnMode + (*descriptorpb.MessageOptions)(nil), // 1: google.protobuf.MessageOptions +} +var file_vtpool_proto_depIdxs = []int32{ + 1, // 0: vtpool.pool_return:extendee -> google.protobuf.MessageOptions + 0, // 1: vtpool.pool_return:type_name -> vtpool.PoolReturnMode + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 1, // [1:2] is the sub-list for extension type_name + 0, // [0:1] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_vtpool_proto_init() } +func file_vtpool_proto_init() { + if File_vtpool_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_vtpool_proto_rawDesc, + NumEnums: 1, + NumMessages: 0, + NumExtensions: 1, + NumServices: 0, + }, + GoTypes: file_vtpool_proto_goTypes, + DependencyIndexes: file_vtpool_proto_depIdxs, + EnumInfos: file_vtpool_proto_enumTypes, + ExtensionInfos: file_vtpool_proto_extTypes, + }.Build() + File_vtpool_proto = out.File + file_vtpool_proto_rawDesc = nil + file_vtpool_proto_goTypes = nil + file_vtpool_proto_depIdxs = nil +} diff --git a/scripts/genproto.sh b/scripts/genproto.sh index 419ed678809..4003c5f08a3 100755 --- a/scripts/genproto.sh +++ b/scripts/genproto.sh @@ -9,6 +9,10 @@ PROTOC_VERSION=${PROTOC_VERSION:-3.20.1} PROTOC_BIN=${PROTOC_BIN:-protoc} GOIMPORTS_BIN=${GOIMPORTS_BIN:-goimports} PROTOC_GEN_GOGOFAST_BIN=${PROTOC_GEN_GOGOFAST_BIN:-protoc-gen-gogofast} +PROTOC_GEN_GO_BIN=${PROTOC_GEN_GO_BIN:-protoc-gen-go} +PROTOC_GEN_GO_GRPC_BIN=${PROTOC_GEN_GO_GRPC_BIN:-protoc-gen-go-grpc} +PROTOC_GEN_GO_VTPROTO_BIN=${PROTOC_GEN_GO_VTPROTO_BIN:-protoc-gen-go-vtproto} +PROTOC_GEN_GOTAG_BIN=${PROTOC_GEN_GOTAG_BIN:-protoc-gen-gotag} if ! [[ "scripts/genproto.sh" =~ $0 ]]; then echo "must be run from repository root" @@ -22,31 +26,128 @@ fi mkdir -p /tmp/protobin/ cp ${PROTOC_GEN_GOGOFAST_BIN} /tmp/protobin/protoc-gen-gogofast +cp ${PROTOC_GEN_GO_BIN} /tmp/protobin/protoc-gen-go +cp ${PROTOC_GEN_GO_GRPC_BIN} /tmp/protobin/protoc-gen-go-grpc +cp ${PROTOC_GEN_GO_VTPROTO_BIN} /tmp/protobin/protoc-gen-go-vtproto +cp ${PROTOC_GEN_GOTAG_BIN} /tmp/protobin/protoc-gen-gotag +echo ">> building protoc-gen-go-grpc-vtpool from source" +go build -o /tmp/protobin/protoc-gen-go-grpc-vtpool ./pkg/vtproto/gen/ PATH=${PATH}:/tmp/protobin +VTPOOL_PROTO_DIR="$(pwd)/pkg/vtproto/gen" GOGOPROTO_ROOT="$(GO111MODULE=on go list -modfile=.bingo/protoc-gen-gogofast.mod -f '{{ .Dir }}' -m github.com/gogo/protobuf)" GOGOPROTO_PATH="${GOGOPROTO_ROOT}:${GOGOPROTO_ROOT}/protobuf" +GOOGLE_PROTO_PATH="${GOGOPROTO_ROOT}/protobuf" +VTPROTO_ROOT="$(GO111MODULE=on go list -modfile=.bingo/protoc-gen-go-vtproto.mod -f '{{ .Dir }}' -m github.com/planetscale/vtprotobuf)" +VTPROTO_INCLUDE="${VTPROTO_ROOT}/include" +GOTAG_ROOT="$(GO111MODULE=on go list -modfile=.bingo/protoc-gen-gotag.mod -f '{{ .Dir }}' -m github.com/srikrsna/protoc-gen-gotag)" + +# M-overrides for well-known types whose go_package in the gogo bundle +# is not a valid full import path (protoc-gen-go requires one). +WKT_GO_OPT="--go_opt=Mgoogle/protobuf/any.proto=google.golang.org/protobuf/types/known/anypb" +WKT_GO_OPT="${WKT_GO_OPT} --go_opt=Mgoogle/protobuf/duration.proto=google.golang.org/protobuf/types/known/durationpb" +WKT_GO_OPT="${WKT_GO_OPT} --go_opt=Mgoogle/protobuf/timestamp.proto=google.golang.org/protobuf/types/known/timestamppb" +WKT_GO_OPT="${WKT_GO_OPT} --go_opt=Mgoogle/protobuf/wrappers.proto=google.golang.org/protobuf/types/known/wrapperspb" +WKT_GO_OPT="${WKT_GO_OPT} --go_opt=Mgoogle/protobuf/struct.proto=google.golang.org/protobuf/types/known/structpb" +WKT_GO_OPT="${WKT_GO_OPT} --go_opt=Mgoogle/protobuf/empty.proto=google.golang.org/protobuf/types/known/emptypb" +WKT_GO_OPT="${WKT_GO_OPT} --go_opt=Mgoogle/protobuf/descriptor.proto=google.golang.org/protobuf/types/descriptorpb" +WKT_VTPROTO_OPT="--go-vtproto_opt=Mgoogle/protobuf/any.proto=google.golang.org/protobuf/types/known/anypb" +WKT_VTPROTO_OPT="${WKT_VTPROTO_OPT} --go-vtproto_opt=Mgoogle/protobuf/descriptor.proto=google.golang.org/protobuf/types/descriptorpb" +WKT_VTPROTO_OPT="${WKT_VTPROTO_OPT} --go-vtproto_opt=Mgoogle/protobuf/duration.proto=google.golang.org/protobuf/types/known/durationpb" +WKT_VTPROTO_OPT="${WKT_VTPROTO_OPT} --go-vtproto_opt=Mgoogle/protobuf/timestamp.proto=google.golang.org/protobuf/types/known/timestamppb" +WKT_GRPC_OPT="--go-grpc_opt=Mgoogle/protobuf/any.proto=google.golang.org/protobuf/types/known/anypb" +WKT_GRPC_OPT="${WKT_GRPC_OPT} --go-grpc_opt=Mgoogle/protobuf/descriptor.proto=google.golang.org/protobuf/types/descriptorpb" +WKT_GRPC_OPT="${WKT_GRPC_OPT} --go-grpc_opt=Mgoogle/protobuf/duration.proto=google.golang.org/protobuf/types/known/durationpb" +WKT_GRPC_OPT="${WKT_GRPC_OPT} --go-grpc_opt=Mgoogle/protobuf/timestamp.proto=google.golang.org/protobuf/types/known/timestamppb" +WKT_VTPOOL_OPT="--go-grpc-vtpool_opt=Mgoogle/protobuf/any.proto=google.golang.org/protobuf/types/known/anypb" +WKT_VTPOOL_OPT="${WKT_VTPOOL_OPT} --go-grpc-vtpool_opt=Mgoogle/protobuf/descriptor.proto=google.golang.org/protobuf/types/descriptorpb" +WKT_VTPOOL_OPT="${WKT_VTPOOL_OPT} --go-grpc-vtpool_opt=Mgoogle/protobuf/duration.proto=google.golang.org/protobuf/types/known/durationpb" +WKT_VTPOOL_OPT="${WKT_VTPOOL_OPT} --go-grpc-vtpool_opt=Mgoogle/protobuf/timestamp.proto=google.golang.org/protobuf/types/known/timestamppb" -DIRS="store/storepb/ store/storepb/prompb/ store/labelpb rules/rulespb targets/targetspb store/hintspb queryfrontend metadata/metadatapb exemplars/exemplarspb info/infopb api/query/querypb" echo "generating code" pushd "pkg" -for dir in ${DIRS}; do - ${PROTOC_BIN} --gogofast_out=Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,plugins=grpc:. \ + +# --------------------------------------------------------------------------- +# Directories migrated to protoc-gen-go + vtprotobuf. +# --------------------------------------------------------------------------- +VT_DIRS="store/labelpb store/storepb/prompb store/storepb info/infopb exemplars/exemplarspb rules/rulespb targets/targetspb store/hintspb queryfrontend metadata/metadatapb api/query/querypb" +GRPC_DIRS="store/storepb info/infopb exemplars/exemplarspb rules/rulespb targets/targetspb metadata/metadatapb api/query/querypb" + +# Directories that get gotag post-processing to rewrite Go json struct tags +# to lowerCamelCase (without omitempty). +GOTAG_DIRS="${VT_DIRS}" + +VT_FEATURES="marshal+unmarshal+size+pool+equal+clone" + +echo "generating vtproto code" +for dir in ${VT_DIRS}; do + echo " ${dir}" + + GRPC_FLAGS="" + VTPOOL_FLAGS="" + if echo " ${GRPC_DIRS} " | grep -q " ${dir} "; then + GRPC_FLAGS="--go-grpc_out=. --go-grpc_opt=paths=source_relative ${WKT_GRPC_OPT}" + VTPOOL_FLAGS="--go-grpc-vtpool_out=. --go-grpc-vtpool_opt=paths=source_relative ${WKT_VTPOOL_OPT}" + fi + + ${PROTOC_BIN} \ + --go_out=. --go_opt=paths=source_relative ${WKT_GO_OPT} \ + ${GRPC_FLAGS} \ + ${VTPOOL_FLAGS} \ + --go-vtproto_out=. \ + --go-vtproto_opt=paths=source_relative,features=${VT_FEATURES} \ + --go-vtproto_opt=ignoreUnknownFields=** \ + ${WKT_VTPROTO_OPT} \ -I=. \ - -I="${GOGOPROTO_PATH}" \ + -I="${GOOGLE_PROTO_PATH}" \ + -I="${VTPROTO_INCLUDE}" \ + -I="${GOTAG_ROOT}" \ + -I="${VTPOOL_PROTO_DIR}" \ ${dir}/*.proto pushd ${dir} - sed -i.bak -E 's/import _ \"gogoproto\"//g' *.pb.go - sed -i.bak -E 's/_ \"google\/protobuf\"//g' *.pb.go - # We cannot do Mstore/storepb/types.proto=github.com/thanos-io/thanos/pkg/store/storepb,\ due to protobuf v1 bug. - # TODO(bwplotka): Consider removing in v2. - sed -i.bak -E 's/\"store\/storepb\"/\"github.com\/thanos-io\/thanos\/pkg\/store\/storepb\"/g' *.pb.go - sed -i.bak -E 's/\"store\/labelpb\"/\"github.com\/thanos-io\/thanos\/pkg\/store\/labelpb\"/g' *.pb.go - sed -i.bak -E 's/\"store\/storepb\/prompb\"/\"github.com\/thanos-io\/thanos\/pkg\/store\/storepb\/prompb\"/g' *.pb.go - rm -f *.bak ${GOIMPORTS_BIN} -w *.pb.go popd done + +# This is a requirement to get the most performance out of string interning. +# If we use the stdlib unique package, string interning tends to deadlock +# and increase latency considerably. +echo "replacing stdlib unique with pkg/unique in vtproto generated code" +for dir in ${VT_DIRS}; do + for f in ${dir}/*_vtproto.pb.go; do + [ -f "$f" ] || continue + if grep -q 'unique "unique"' "$f"; then + echo " ${f}" + sed -i.bak \ + -e 's|unique "unique"|unique "github.com/thanos-io/thanos/pkg/unique"|' \ + -e 's|unique\.Make\[string\](\(.*\))\.Value()|unique.Make(\1).Value()|g' \ + "$f" + rm -f "${f}.bak" + fi + done +done + +# Re-run goimports to clean up any unused imports after the unique rewrite. +for dir in ${VT_DIRS}; do + pushd ${dir} + ${GOIMPORTS_BIN} -w *_vtproto.pb.go 2>/dev/null || true + popd +done + +echo "rewriting json struct tags (gotag)" +for dir in ${GOTAG_DIRS}; do + echo " ${dir}" + ${PROTOC_BIN} \ + --gotag_out=:. \ + --gotag_opt=paths=source_relative \ + -I=. \ + -I="${GOOGLE_PROTO_PATH}" \ + -I="${VTPROTO_INCLUDE}" \ + -I="${GOTAG_ROOT}" \ + -I="${VTPOOL_PROTO_DIR}" \ + ${dir}/*.proto +done + popd # Generate vendored Cortex protobufs. @@ -56,6 +157,8 @@ for dir in ${CORTEX_DIRS}; do ${PROTOC_BIN} --gogofast_out=Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,plugins=grpc:. \ -I=../pkg \ -I="${GOGOPROTO_PATH}" \ + -I="${VTPROTO_INCLUDE}" \ + -I="${GOTAG_ROOT}" \ -I=. \ ${dir}/*.proto diff --git a/test/e2e/exemplars_api_test.go b/test/e2e/exemplars_api_test.go index 60c423f6670..5992a98199f 100644 --- a/test/e2e/exemplars_api_test.go +++ b/test/e2e/exemplars_api_test.go @@ -17,7 +17,6 @@ import ( "github.com/efficientgo/core/testutil" "github.com/thanos-io/thanos/pkg/exemplars/exemplarspb" - "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/test/e2e/e2ethanos" ) @@ -131,21 +130,18 @@ func exemplarsOnExpectedSeries(requiredSeriesLabels map[string]string) func(data } // Compare series labels. - seriesLabels := labelpb.ZLabelSetsToPromLabelSets(data[0].SeriesLabels) - for _, lbls := range seriesLabels { - for k, v := range requiredSeriesLabels { - if lbls.Get(k) != v { - return errors.Errorf("unexpected labels in result, expected %v, got: %v", requiredSeriesLabels, seriesLabels) - } + seriesLabels := data[0].GetSeriesLabels().PromLabels() + for k, v := range requiredSeriesLabels { + if seriesLabels.Get(k) != v { + return errors.Errorf("unexpected labels in result, expected %v, got: %v", requiredSeriesLabels, seriesLabels) } } // Make sure the exemplar contains the correct traceID label. for _, exemplar := range data[0].Exemplars { - for _, lbls := range labelpb.ZLabelSetsToPromLabelSets(exemplar.Labels) { - if !lbls.Has(traceIDLabel) { - return errors.Errorf("unexpected labels in exemplar, expected %v, got: %v", traceIDLabel, exemplar.Labels) - } + lbls := exemplar.GetLabels().PromLabels() + if !lbls.Has(traceIDLabel) { + return errors.Errorf("unexpected labels in exemplar, expected %v, got: %v", traceIDLabel, exemplar.Labels) } } return nil diff --git a/test/e2e/info_api_test.go b/test/e2e/info_api_test.go index ef36ed23afa..a6127ce8fe0 100644 --- a/test/e2e/info_api_test.go +++ b/test/e2e/info_api_test.go @@ -14,9 +14,8 @@ import ( "time" "github.com/efficientgo/e2e" - "github.com/prometheus/prometheus/model/labels" - "github.com/thanos-io/objstore/client" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/efficientgo/core/testutil" e2edb "github.com/efficientgo/e2e/db" @@ -75,48 +74,27 @@ func TestInfo(t *testing.T) { "sidecar": { { Name: "e2e-test-info-sidecar-alone1:9091", - LabelSets: []labels.Labels{{ - { - Name: "prometheus", - Value: "prom-alone1", - }, - { - Name: "replica", - Value: "0", - }, - }}, + LabelSets: []labelpb.Labels{ + labelpb.FromStrings("prometheus", "prom-alone1", "replica", "0"), + }, }, { Name: "e2e-test-info-sidecar-alone2:9091", - LabelSets: []labels.Labels{{ - { - Name: "prometheus", - Value: "prom-alone2", - }, - { - Name: "replica", - Value: "0", - }, - }}, + LabelSets: []labelpb.Labels{ + labelpb.FromStrings("prometheus", "prom-alone2", "replica", "0"), + }, }, { Name: "e2e-test-info-sidecar-alone3:9091", - LabelSets: []labels.Labels{{ - { - Name: "prometheus", - Value: "prom-alone3", - }, - { - Name: "replica", - Value: "0", - }, - }}, + LabelSets: []labelpb.Labels{ + labelpb.FromStrings("prometheus", "prom-alone3", "replica", "0"), + }, }, }, "store": { { Name: "e2e-test-info-store-gw-1:9091", - LabelSets: []labels.Labels{}, + LabelSets: []labelpb.Labels{}, }, }, } diff --git a/test/e2e/metadata_api_test.go b/test/e2e/metadata_api_test.go index f966379790e..b2e9abd7f91 100644 --- a/test/e2e/metadata_api_test.go +++ b/test/e2e/metadata_api_test.go @@ -58,7 +58,7 @@ func TestMetadataAPI_Fanout(t *testing.T) { testutil.Ok(t, q.WaitSumMetricsWithOptions(e2emon.Equals(2), []string{"thanos_store_nodes_grpc_connections"}, e2emon.WaitMissingMetrics())) testutil.Ok(t, q.WaitSumMetricsWithOptions(e2emon.Equals(2), []string{"thanos_query_metadata_apis_dns_provider_results"}, e2emon.WaitMissingMetrics())) - var promMeta map[string][]metadatapb.Meta + var promMeta map[string][]*metadatapb.Meta // Wait metadata response to be ready as Prometheus gets metadata after scrape. testutil.Ok(t, runutil.Retry(5*time.Second, ctx.Done(), func() error { promMeta, err = promclient.NewDefaultClient().MetricMetadataInGRPC(ctx, urlParse(t, "http://"+prom1.Endpoint("http")), "", -1) @@ -71,7 +71,7 @@ func TestMetadataAPI_Fanout(t *testing.T) { return fmt.Errorf("empty metadata response from Prometheus") })) - var thanosMeta map[string][]metadatapb.Meta + var thanosMeta map[string][]*metadatapb.Meta // Retry until length of metadata response is the same as Prometheus. testutil.Ok(t, runutil.Retry(5*time.Second, ctx.Done(), func() error { thanosMeta, err = promclient.NewDefaultClient().MetricMetadataInGRPC(ctx, urlParse(t, "http://"+q.Endpoint("http")), "", -1) @@ -111,7 +111,7 @@ func TestMetadataAPI_Fanout(t *testing.T) { testutil.Assert(t, len(thanosMeta) == 1 && len(thanosMeta["prometheus_build_info"]) > 0, "expected one prometheus_build_info metadata from Thanos, got %v", thanosMeta) } -func metadataEqual(t *testing.T, meta1, meta2 map[string][]metadatapb.Meta) { +func metadataEqual(t *testing.T, meta1, meta2 map[string][]*metadatapb.Meta) { // The two responses should have equal # of entries. testutil.Equals(t, len(meta1), len(meta2)) diff --git a/test/e2e/rule_test.go b/test/e2e/rule_test.go index 4f918a0c5f0..b25bf62d77c 100644 --- a/test/e2e/rule_test.go +++ b/test/e2e/rule_test.go @@ -272,7 +272,7 @@ func rulegroupCorrectData(t *testing.T, ctx context.Context, endpoint string) { for _, g := range data.Data.Groups { testutil.Assert(t, g.EvaluationDurationSeconds > 0, "expected it to take more than zero seconds to evaluate") - testutil.Assert(t, !g.LastEvaluation.IsZero(), "expected the rule group to be evaluated at least once") + testutil.Assert(t, g.LastEvaluation != nil && !g.LastEvaluation.AsTime().IsZero(), "expected the rule group to be evaluated at least once") } } @@ -831,7 +831,7 @@ func TestStatelessRulerAlertStateRestore(t *testing.T) { if alerts[0].State == rulespb.AlertState_FIRING { // The second ruler alert's active at time is the same as the previous one, // which means the alert state is restored successfully. - if alertActiveAt.Unix() == alerts[0].ActiveAt.Unix() { + if alertActiveAt.AsTime().Unix() == alerts[0].ActiveAt.AsTime().Unix() { return nil } else { return fmt.Errorf("alert active time is not restored") diff --git a/test/e2e/rules_api_test.go b/test/e2e/rules_api_test.go index 2b5670a5982..8d5d32fbfe0 100644 --- a/test/e2e/rules_api_test.go +++ b/test/e2e/rules_api_test.go @@ -8,7 +8,6 @@ import ( "fmt" "os" "path/filepath" - "reflect" "sort" "testing" "time" @@ -16,8 +15,11 @@ import ( "github.com/efficientgo/e2e" e2emon "github.com/efficientgo/e2e/monitoring" "github.com/go-kit/log" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" "github.com/pkg/errors" "github.com/prometheus/prometheus/rules" + "google.golang.org/protobuf/testing/protocmp" "github.com/efficientgo/core/testutil" "github.com/thanos-io/thanos/pkg/clientconfig" @@ -101,13 +103,10 @@ func TestRulesAPI_Fanout(t *testing.T) { File: q.Dir() + "/rules/rules.yaml", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "TestAlert_AbortOnPartialResponse", - State: rulespb.AlertState_FIRING, - Query: "absent(some_metric)", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "prometheus", Value: "ha"}, - {Name: "severity", Value: "page"}, - }}, + Name: "TestAlert_AbortOnPartialResponse", + State: rulespb.AlertState_FIRING, + Query: "absent(some_metric)", + Labels: labelpb.LabelSetFromStrings("prometheus", "ha", "severity", "page"), Health: string(rules.HealthGood), }), }, @@ -117,12 +116,10 @@ func TestRulesAPI_Fanout(t *testing.T) { File: q.Dir() + "/thanos-rules/rules-0.yaml", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "TestAlert_AbortOnPartialResponse", - State: rulespb.AlertState_FIRING, - Query: "absent(some_metric)", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "severity", Value: "page"}, - }}, + Name: "TestAlert_AbortOnPartialResponse", + State: rulespb.AlertState_FIRING, + Query: "absent(some_metric)", + Labels: labelpb.LabelSetFromStrings("severity", "page"), Health: string(rules.HealthGood), }), }, @@ -132,12 +129,10 @@ func TestRulesAPI_Fanout(t *testing.T) { File: q.Dir() + "/thanos-rules/rules-1.yaml", Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "TestAlert_WarnOnPartialResponse", - State: rulespb.AlertState_FIRING, - Query: "absent(some_metric)", - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "severity", Value: "page"}, - }}, + Name: "TestAlert_WarnOnPartialResponse", + State: rulespb.AlertState_FIRING, + Query: "absent(some_metric)", + Labels: labelpb.LabelSetFromStrings("severity", "page"), Health: string(rules.HealthGood), }), }, @@ -148,12 +143,10 @@ func TestRulesAPI_Fanout(t *testing.T) { Limit: 1, Rules: []*rulespb.Rule{ rulespb.NewAlertingRule(&rulespb.Alert{ - Name: "TestAlert_WithLimit", - State: rulespb.AlertState_INACTIVE, - Query: `promhttp_metric_handler_requests_total`, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "severity", Value: "page"}, - }}, + Name: "TestAlert_WithLimit", + State: rulespb.AlertState_INACTIVE, + Query: `promhttp_metric_handler_requests_total`, + Labels: labelpb.LabelSetFromStrings("severity", "page"), Health: string(rules.HealthBad), }), }, @@ -184,7 +177,7 @@ func ruleAndAssert(t *testing.T, ctx context.Context, addr, typ string, want []* } for ig, g := range res { - res[ig].LastEvaluation = time.Time{} + res[ig].LastEvaluation = nil res[ig].EvaluationDurationSeconds = 0 res[ig].Interval = 0 res[ig].PartialResponseStrategy = 0 @@ -211,8 +204,8 @@ func ruleAndAssert(t *testing.T, ctx context.Context, addr, typ string, want []* } } - if !reflect.DeepEqual(want, res) { - return errors.Errorf("unexpected result\nwant %v\ngot: %v", want, res) + if diff := cmp.Diff(want, res, protocmp.Transform(), cmpopts.EquateEmpty()); diff != "" { + return errors.Errorf("unexpected result (-want +got):\n%s", diff) } return nil diff --git a/test/e2e/targets_api_test.go b/test/e2e/targets_api_test.go index 803f7f1d0d7..5b8bade0101 100644 --- a/test/e2e/targets_api_test.go +++ b/test/e2e/targets_api_test.go @@ -64,20 +64,20 @@ func TestTargetsAPI_Fanout(t *testing.T) { targetAndAssert(t, ctx, q.Endpoint("http"), "", &targetspb.TargetDiscovery{ ActiveTargets: []*targetspb.ActiveTarget{ { - DiscoveredLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__address__", Value: "localhost:9090"}, - {Name: "__metrics_path__", Value: "/metrics"}, - {Name: "__scheme__", Value: "http"}, - {Name: "__scrape_interval__", Value: "1s"}, - {Name: "__scrape_timeout__", Value: "1s"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - }}, - Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "instance", Value: "localhost:9090"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - }}, + DiscoveredLabels: labelpb.LabelSetFromStrings( + "__address__", "localhost:9090", + "__metrics_path__", "/metrics", + "__scheme__", "http", + "__scrape_interval__", "1s", + "__scrape_timeout__", "1s", + "job", "myself", + "prometheus", "ha", + ), + Labels: labelpb.LabelSetFromStrings( + "instance", "localhost:9090", + "job", "myself", + "prometheus", "ha", + ), ScrapePool: "myself", ScrapeUrl: "http://localhost:9090/metrics", Health: targetspb.TargetHealth_UP, @@ -85,15 +85,15 @@ func TestTargetsAPI_Fanout(t *testing.T) { }, DroppedTargets: []*targetspb.DroppedTarget{ { - DiscoveredLabels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ - {Name: "__address__", Value: "localhost:80"}, - {Name: "__metrics_path__", Value: "/metrics"}, - {Name: "__scheme__", Value: "http"}, - {Name: "__scrape_interval__", Value: "1s"}, - {Name: "__scrape_timeout__", Value: "1s"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "ha"}, - }}, + DiscoveredLabels: labelpb.LabelSetFromStrings( + "__address__", "localhost:80", + "__metrics_path__", "/metrics", + "__scheme__", "http", + "__scrape_interval__", "1s", + "__scrape_timeout__", "1s", + "job", "myself", + "prometheus", "ha", + ), }, }, }) @@ -120,7 +120,7 @@ func targetAndAssert(t *testing.T, ctx context.Context, addr, state string, want } for it := range res.ActiveTargets { - res.ActiveTargets[it].LastScrape = time.Time{} + res.ActiveTargets[it].LastScrape = nil res.ActiveTargets[it].LastScrapeDuration = 0 res.ActiveTargets[it].GlobalUrl = "" }