From c5f190a5e4480ddc11e3e59e45ed9c99bbca910c Mon Sep 17 00:00:00 2001 From: Michael Hoffmann Date: Fri, 6 Sep 2024 15:19:03 +0200 Subject: [PATCH] *: get rid of store info api We support the Info gRPC api for 3 years now. We used to use Store API Info as fallback if we encounter an endpoint that does not implement Info gRPC but that should not happen now anymore. Signed-off-by: Michael Hoffmann --- CHANGELOG.md | 1 + cmd/thanos/query.go | 3 +- pkg/component/component.go | 56 +- pkg/query/endpointset.go | 112 +-- pkg/query/endpointset_test.go | 86 +-- .../test-storeset-pre-v0.8.0/storeset.go | 454 ----------- .../test-storeset-pre-v0.8.0/storeset_test.go | 228 ------ pkg/query/query_test.go | 16 - pkg/receive/multitsdb.go | 4 - pkg/store/bucket.go | 14 - pkg/store/bucket_test.go | 49 -- pkg/store/local.go | 27 +- pkg/store/prometheus.go | 25 - pkg/store/prometheus_test.go | 21 - pkg/store/proxy.go | 56 -- pkg/store/proxy_test.go | 27 - pkg/store/storepb/inprocess.go | 4 - pkg/store/storepb/inprocess_test.go | 44 +- pkg/store/storepb/rpc.pb.go | 703 +++--------------- pkg/store/storepb/rpc.proto | 32 - pkg/store/tsdb.go | 25 - pkg/store/tsdb_test.go | 34 - pkg/tenancy/tenancy_test.go | 6 - test/e2e/query_test.go | 193 ----- 24 files changed, 131 insertions(+), 2089 deletions(-) delete mode 100644 pkg/query/internal/test-storeset-pre-v0.8.0/storeset.go delete mode 100644 pkg/query/internal/test-storeset-pre-v0.8.0/storeset_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 3541f6174e..59f7330aef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#7494](https://github.com/thanos-io/thanos/pull/7494) Ruler: remove trailing period from SRV records returned by discovery `dnsnosrva` lookups - [#7567](https://github.com/thanos-io/thanos/pull/7565) Query: Use thanos resolver for endpoint groups. +- [#7704](https://github.com/thanos-io/thanos/pull/7704) *: *breaking :warning:* remove Store gRPC Info function. This has been deprecated for 3 years, its time to remove it. ### Removed diff --git a/cmd/thanos/query.go b/cmd/thanos/query.go index 5cf431ca2f..113518767a 100644 --- a/cmd/thanos/query.go +++ b/cmd/thanos/query.go @@ -355,7 +355,6 @@ func registerQuery(app *extkingpin.App) { *webDisableCORS, *alertQueryURL, *grpcProxyStrategy, - component.Query, *queryTelemetryDurationQuantiles, *queryTelemetrySamplesQuantiles, *queryTelemetrySeriesQuantiles, @@ -437,7 +436,6 @@ func runQuery( disableCORS bool, alertQueryURL string, grpcProxyStrategy string, - comp component.Component, queryTelemetryDurationQuantiles []float64, queryTelemetrySamplesQuantiles []float64, queryTelemetrySeriesQuantiles []float64, @@ -452,6 +450,7 @@ func runQuery( enforceTenancy bool, tenantLabel string, ) error { + comp := component.Query if alertQueryURL == "" { lastColon := strings.LastIndex(httpBindAddr, ":") if lastColon != -1 { diff --git a/pkg/component/component.go b/pkg/component/component.go index dfbae08289..6c52aef138 100644 --- a/pkg/component/component.go +++ b/pkg/component/component.go @@ -3,12 +3,6 @@ package component -import ( - "strings" - - "github.com/thanos-io/thanos/pkg/store/storepb" -) - // Component is a generic component interface. type Component interface { String() string @@ -18,7 +12,6 @@ type Component interface { type StoreAPI interface { implementsStoreAPI() String() string - ToProto() storepb.StoreType } // Source is a Thanos component that produce blocks of metrics. @@ -33,7 +26,6 @@ type SourceStoreAPI interface { implementsStoreAPI() producesBlocks() String() string - ToProto() storepb.StoreType } type component struct { @@ -48,14 +40,6 @@ type storeAPI struct { func (storeAPI) implementsStoreAPI() {} -func (s sourceStoreAPI) ToProto() storepb.StoreType { - return storepb.StoreType(storepb.StoreType_value[strings.ToUpper(s.String())]) -} - -func (s storeAPI) ToProto() storepb.StoreType { - return storepb.StoreType(storepb.StoreType_value[strings.ToUpper(s.String())]) -} - type source struct { component } @@ -68,26 +52,6 @@ type sourceStoreAPI struct { storeAPI } -// FromProto converts from a gRPC StoreType to StoreAPI. -func FromProto(storeType storepb.StoreType) StoreAPI { - switch storeType { - case storepb.StoreType_QUERY: - return Query - case storepb.StoreType_RULE: - return Rule - case storepb.StoreType_SIDECAR: - return Sidecar - case storepb.StoreType_STORE: - return Store - case storepb.StoreType_RECEIVE: - return Receive - case storepb.StoreType_DEBUG: - return Debug - default: - return UnknownStoreAPI - } -} - func FromString(storeType string) StoreAPI { switch storeType { case "query": @@ -125,4 +89,24 @@ var ( Store = storeAPI{component: component{name: "store"}} UnknownStoreAPI = storeAPI{component: component{name: "unknown-store-api"}} Query = storeAPI{component: component{name: "query"}} + + All = []Component{ + Bucket, + Cleanup, + Mark, + Upload, + Rewrite, + Retention, + Compact, + Downsample, + Replicate, + QueryFrontend, + Debug, + Receive, + Rule, + Sidecar, + Store, + UnknownStoreAPI, + Query, + } ) diff --git a/pkg/query/endpointset.go b/pkg/query/endpointset.go index 0f304b945a..39c9041e43 100644 --- a/pkg/query/endpointset.go +++ b/pkg/query/endpointset.go @@ -83,91 +83,9 @@ func (es *endpointRef) Metadata(ctx context.Context, infoClient infopb.InfoClien return &endpointMetadata{resp}, nil } } - - // Call Info method of StoreAPI, this way querier will be able to discovery old components not exposing InfoAPI. - if storeClient != nil { - metadata, err := es.getMetadataUsingStoreAPI(ctx, storeClient) - if err != nil { - return nil, errors.Wrapf(err, "fallback fetching info from %s", es.addr) - } - return metadata, nil - } - return nil, errors.New(noMetadataEndpointMessage) } -func (es *endpointRef) getMetadataUsingStoreAPI(ctx context.Context, client storepb.StoreClient) (*endpointMetadata, error) { - resp, err := client.Info(ctx, &storepb.InfoRequest{}) - if err != nil { - return nil, err - } - - infoResp := fillExpectedAPIs(component.FromProto(resp.StoreType), resp.MinTime, resp.MaxTime) - infoResp.LabelSets = resp.LabelSets - infoResp.ComponentType = component.FromProto(resp.StoreType).String() - - return &endpointMetadata{ - &infoResp, - }, nil -} - -func fillExpectedAPIs(componentType component.Component, mintime, maxTime int64) infopb.InfoResponse { - switch componentType { - case component.Sidecar: - return infopb.InfoResponse{ - Store: &infopb.StoreInfo{ - MinTime: mintime, - MaxTime: maxTime, - }, - Rules: &infopb.RulesInfo{}, - Targets: &infopb.TargetsInfo{}, - MetricMetadata: &infopb.MetricMetadataInfo{}, - Exemplars: &infopb.ExemplarsInfo{}, - } - case component.Query: - { - return infopb.InfoResponse{ - Store: &infopb.StoreInfo{ - MinTime: mintime, - MaxTime: maxTime, - }, - Rules: &infopb.RulesInfo{}, - Targets: &infopb.TargetsInfo{}, - MetricMetadata: &infopb.MetricMetadataInfo{}, - Exemplars: &infopb.ExemplarsInfo{}, - Query: &infopb.QueryAPIInfo{}, - } - } - case component.Receive: - { - return infopb.InfoResponse{ - Store: &infopb.StoreInfo{ - MinTime: mintime, - MaxTime: maxTime, - }, - Exemplars: &infopb.ExemplarsInfo{}, - } - } - case component.Store: - return infopb.InfoResponse{ - Store: &infopb.StoreInfo{ - MinTime: mintime, - MaxTime: maxTime, - }, - } - case component.Rule: - return infopb.InfoResponse{ - Store: &infopb.StoreInfo{ - MinTime: mintime, - MaxTime: maxTime, - }, - Rules: &infopb.RulesInfo{}, - } - default: - return infopb.InfoResponse{} - } -} - // stringError forces the error to be a string // when marshaled into a JSON. type stringError struct { @@ -199,7 +117,7 @@ type EndpointStatus struct { // TODO(hitanshu-mehta) Currently,only collecting metrics of storeEndpoints. Make this struct generic. type endpointSetNodeCollector struct { mtx sync.Mutex - storeNodes map[component.Component]map[string]int + storeNodes map[string]map[string]int storePerExtLset map[string]int logger log.Logger @@ -213,7 +131,7 @@ func newEndpointSetNodeCollector(logger log.Logger, labels ...string) *endpointS } return &endpointSetNodeCollector{ logger: logger, - storeNodes: map[component.Component]map[string]int{}, + storeNodes: map[string]map[string]int{}, connectionsDesc: prometheus.NewDesc( "thanos_store_nodes_grpc_connections", "Number of gRPC connection to Store APIs. Opened connection means healthy store APIs available for Querier.", @@ -236,8 +154,8 @@ func truncateExtLabels(s string, threshold int) string { } return s } -func (c *endpointSetNodeCollector) Update(nodes map[component.Component]map[string]int) { - storeNodes := make(map[component.Component]map[string]int, len(nodes)) +func (c *endpointSetNodeCollector) Update(nodes map[string]map[string]int) { + storeNodes := make(map[string]map[string]int, len(nodes)) storePerExtLset := map[string]int{} for storeType, occurrencesPerExtLset := range nodes { @@ -263,12 +181,8 @@ func (c *endpointSetNodeCollector) Collect(ch chan<- prometheus.Metric) { c.mtx.Lock() defer c.mtx.Unlock() - for storeType, occurrencesPerExtLset := range c.storeNodes { + for k, occurrencesPerExtLset := range c.storeNodes { for externalLabels, occurrences := range occurrencesPerExtLset { - var storeTypeStr string - if storeType != nil { - storeTypeStr = storeType.String() - } // Select only required labels. lbls := []string{} for _, lbl := range c.labels { @@ -276,7 +190,7 @@ func (c *endpointSetNodeCollector) Collect(ch chan<- prometheus.Metric) { case string(ExternalLabels): lbls = append(lbls, externalLabels) case string(StoreType): - lbls = append(lbls, storeTypeStr) + lbls = append(lbls, k) } } select { @@ -454,12 +368,12 @@ func (e *EndpointSet) Update(ctx context.Context) { // 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) && - stats[component.Sidecar][extLset]+stats[component.Rule][extLset] > 0 { + stats[component.Sidecar.String()][extLset]+stats[component.Rule.String()][extLset] > 0 { level.Warn(e.logger).Log("msg", "found duplicate storeEndpoints producer (sidecar or ruler). This is not advices as it will malform data in in the same bucket", - "address", addr, "extLset", extLset, "duplicates", fmt.Sprintf("%v", stats[component.Sidecar][extLset]+stats[component.Rule][extLset]+1)) + "address", addr, "extLset", extLset, "duplicates", fmt.Sprintf("%v", stats[component.Sidecar.String()][extLset]+stats[component.Rule.String()][extLset]+1)) } - stats[er.ComponentType()][extLset]++ + stats[er.ComponentType().String()][extLset]++ } e.endpointsMetric.Update(stats) @@ -905,10 +819,10 @@ type endpointMetadata struct { *infopb.InfoResponse } -func newEndpointAPIStats() map[component.Component]map[string]int { - nodes := make(map[component.Component]map[string]int, len(storepb.StoreType_name)) - for i := range storepb.StoreType_name { - nodes[component.FromProto(storepb.StoreType(i))] = map[string]int{} +func newEndpointAPIStats() map[string]map[string]int { + nodes := make(map[string]map[string]int, len(component.All)) + for _, comp := range component.All { + nodes[comp.String()] = map[string]int{} } return nodes } diff --git a/pkg/query/endpointset_test.go b/pkg/query/endpointset_test.go index f057c99f2b..431bbeacbb 100644 --- a/pkg/query/endpointset_test.go +++ b/pkg/query/endpointset_test.go @@ -27,7 +27,6 @@ import ( "github.com/thanos-io/thanos/pkg/component" "github.com/thanos-io/thanos/pkg/info/infopb" "github.com/thanos-io/thanos/pkg/store/labelpb" - "github.com/thanos-io/thanos/pkg/store/storepb" ) var testGRPCOpts = []grpc.DialOption{ @@ -108,39 +107,6 @@ func (c *mockedEndpoint) Info(ctx context.Context, r *infopb.InfoRequest) (*info return &c.info, nil } -type mockedStoreSrv struct { - infoDelay time.Duration - info storepb.InfoResponse - err error -} - -func (s *mockedStoreSrv) setResponseError(err error) { - s.err = err -} - -func (s *mockedStoreSrv) Info(ctx context.Context, _ *storepb.InfoRequest) (*storepb.InfoResponse, error) { - if s.err != nil { - return nil, s.err - } - - select { - case <-ctx.Done(): - return nil, context.Canceled - case <-time.After(s.infoDelay): - } - - return &s.info, nil -} -func (s *mockedStoreSrv) Series(*storepb.SeriesRequest, storepb.Store_SeriesServer) error { - return nil -} -func (s *mockedStoreSrv) LabelNames(context.Context, *storepb.LabelNamesRequest) (*storepb.LabelNamesResponse, error) { - return nil, nil -} -func (s *mockedStoreSrv) LabelValues(context.Context, *storepb.LabelValuesRequest) (*storepb.LabelValuesResponse, error) { - return nil, nil -} - type APIs struct { store bool metricMetadata bool @@ -159,35 +125,14 @@ type testEndpointMeta struct { type testEndpoints struct { srvs map[string]*grpc.Server endpoints map[string]*mockedEndpoint - stores map[string]*mockedStoreSrv orderAddrs []string exposedAPIs map[string]*APIs } -func componentTypeToStoreType(componentType string) storepb.StoreType { - switch componentType { - case component.Query.String(): - return storepb.StoreType_QUERY - case component.Rule.String(): - return storepb.StoreType_RULE - case component.Sidecar.String(): - return storepb.StoreType_SIDECAR - case component.Store.String(): - return storepb.StoreType_STORE - case component.Receive.String(): - return storepb.StoreType_RECEIVE - case component.Debug.String(): - return storepb.StoreType_DEBUG - default: - return storepb.StoreType_STORE - } -} - func startTestEndpoints(testEndpointMeta []testEndpointMeta) (*testEndpoints, error) { e := &testEndpoints{ srvs: map[string]*grpc.Server{}, endpoints: map[string]*mockedEndpoint{}, - stores: map[string]*mockedStoreSrv{}, exposedAPIs: map[string]*APIs{}, } @@ -202,20 +147,6 @@ func startTestEndpoints(testEndpointMeta []testEndpointMeta) (*testEndpoints, er srv := grpc.NewServer() addr := listener.Addr().String() - storeSrv := &mockedStoreSrv{ - err: meta.err, - info: storepb.InfoResponse{ - LabelSets: meta.extlsetFn(listener.Addr().String()), - StoreType: componentTypeToStoreType(meta.ComponentType), - }, - infoDelay: meta.infoDelay, - } - - if meta.Store != nil { - storeSrv.info.MinTime = meta.Store.MinTime - storeSrv.info.MaxTime = meta.Store.MaxTime - } - endpointSrv := &mockedEndpoint{ err: meta.err, info: infopb.InfoResponse{ @@ -231,7 +162,6 @@ func startTestEndpoints(testEndpointMeta []testEndpointMeta) (*testEndpoints, er infoDelay: meta.infoDelay, } infopb.RegisterInfoServer(srv, endpointSrv) - storepb.RegisterStoreServer(srv, storeSrv) go func() { _ = srv.Serve(listener) }() @@ -239,7 +169,6 @@ func startTestEndpoints(testEndpointMeta []testEndpointMeta) (*testEndpoints, er e.exposedAPIs[addr] = exposedAPIs(meta.ComponentType) e.srvs[addr] = srv e.endpoints[addr] = endpointSrv - e.stores[addr] = storeSrv e.orderAddrs = append(e.orderAddrs, listener.Addr().String()) } @@ -657,7 +586,6 @@ func TestEndpointSetUpdate_PruneInactiveEndpoints(t *testing.T) { addr := discoveredEndpointAddr[0] endpoints.endpoints[addr].setResponseError(errors.New("failed info request")) - endpoints.stores[addr].setResponseError(errors.New("failed info request")) endpointSet.Update(context.Background()) updateTime = updateTime.Add(10 * time.Minute) @@ -799,7 +727,7 @@ func TestEndpointSetUpdate_AvailabilityScenarios(t *testing.T) { // Check stats. expected := newEndpointAPIStats() - expected[component.Sidecar] = map[string]int{ + expected[component.Sidecar.String()] = map[string]int{ fmt.Sprintf("{a=\"b\"},{addr=\"%s\"}", discoveredEndpointAddr[0]): 1, fmt.Sprintf("{a=\"b\"},{addr=\"%s\"}", discoveredEndpointAddr[1]): 1, } @@ -812,7 +740,7 @@ func TestEndpointSetUpdate_AvailabilityScenarios(t *testing.T) { testutil.Equals(t, 2, len(endpointSet.endpoints)) endpoints.CloseOne(discoveredEndpointAddr[0]) - delete(expected[component.Sidecar], fmt.Sprintf("{a=\"b\"},{addr=\"%s\"}", discoveredEndpointAddr[0])) + delete(expected[component.Sidecar.String()], fmt.Sprintf("{a=\"b\"},{addr=\"%s\"}", discoveredEndpointAddr[0])) // We expect Update to tear down store client for closed store server. endpointSet.Update(context.Background()) @@ -1060,22 +988,22 @@ func TestEndpointSetUpdate_AvailabilityScenarios(t *testing.T) { // Check stats. expected = newEndpointAPIStats() - expected[component.Query] = map[string]int{ + expected[component.Query.String()] = map[string]int{ "{l1=\"v2\", l2=\"v3\"}": 1, "{l1=\"v2\", l2=\"v3\"},{l3=\"v4\"}": 2, } - expected[component.Rule] = map[string]int{ + expected[component.Rule.String()] = map[string]int{ "{l1=\"v2\", l2=\"v3\"}": 2, } - expected[component.Sidecar] = map[string]int{ + expected[component.Sidecar.String()] = map[string]int{ fmt.Sprintf("{a=\"b\"},{addr=\"%s\"}", discoveredEndpointAddr[1]): 1, "{l1=\"v2\", l2=\"v3\"}": 2, } - expected[component.Store] = map[string]int{ + expected[component.Store.String()] = map[string]int{ "": 2, "{l1=\"v2\", l2=\"v3\"},{l3=\"v4\"}": 3, } - expected[component.Receive] = map[string]int{ + expected[component.Receive.String()] = map[string]int{ "{l1=\"v2\", l2=\"v3\"},{l3=\"v4\"}": 2, } testutil.Equals(t, expected, endpointSet.endpointsMetric.storeNodes) diff --git a/pkg/query/internal/test-storeset-pre-v0.8.0/storeset.go b/pkg/query/internal/test-storeset-pre-v0.8.0/storeset.go deleted file mode 100644 index 6b3f579e2a..0000000000 --- a/pkg/query/internal/test-storeset-pre-v0.8.0/storeset.go +++ /dev/null @@ -1,454 +0,0 @@ -// Copyright (c) The Thanos Authors. -// Licensed under the Apache License 2.0. - -/* -This package is for compatibility testing purposes. It is a code from v0.7.0 Querier. -*/ - -package testoldstoreset - -import ( - "context" - "fmt" - "sort" - "strings" - "sync" - "time" - - "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/prometheus/model/labels" - "google.golang.org/grpc" - - "github.com/thanos-io/thanos/pkg/component" - "github.com/thanos-io/thanos/pkg/info/infopb" - "github.com/thanos-io/thanos/pkg/runutil" - "github.com/thanos-io/thanos/pkg/store" - "github.com/thanos-io/thanos/pkg/store/labelpb" - "github.com/thanos-io/thanos/pkg/store/storepb" -) - -const ( - unhealthyStoreMessage = "removing store because it's unhealthy or does not exist" - droppingStoreMessage = "dropping store, external labels are not unique" -) - -type StoreSpec interface { - // Addr returns StoreAPI Address for the store spec. It is used as ID for store. - Addr() string - // Metadata returns current labels, store type and min, max ranges for store. - // It can change for every call for this method. - // If metadata call fails we assume that store is no longer accessible and we should not use it. - // NOTE: It is implementation responsibility to retry until context timeout, but a caller responsibility to manage - // given store connection. - Metadata(ctx context.Context, client storepb.StoreClient) (labelSets []labels.Labels, mint int64, maxt int64, err error) -} - -type StoreStatus struct { - Name string - LastCheck time.Time - LastError error - LabelSets []labels.Labels - StoreType component.StoreAPI - MinTime int64 - MaxTime int64 -} - -type grpcStoreSpec struct { - addr string -} - -// NewGRPCStoreSpec creates store pure gRPC spec. -// It uses Info gRPC call to get Metadata. -func NewGRPCStoreSpec(addr string) StoreSpec { - return &grpcStoreSpec{addr: addr} -} - -func (s *grpcStoreSpec) Addr() string { - // API addr should not change between state changes. - return s.addr -} - -// Metadata method for gRPC store API tries to reach host Info method until context timeout. If we are unable to get metadata after -// that time, we assume that the host is unhealthy and return error. -func (s *grpcStoreSpec) Metadata(ctx context.Context, client storepb.StoreClient) (labelSets []labels.Labels, mint, maxt int64, err error) { - resp, err := client.Info(ctx, &storepb.InfoRequest{}, grpc.WaitForReady(true)) - if err != nil { - return nil, 0, 0, errors.Wrapf(err, "fetching store info from %s", s.addr) - } - if len(resp.LabelSets) == 0 && len(resp.Labels) > 0 { - resp.LabelSets = []labelpb.LabelSet{{Labels: resp.Labels}} - } - - return labelpb.LabelpbLabelSetsToPromLabels(resp.LabelSets...), resp.MinTime, resp.MaxTime, nil -} - -// StoreSet maintains a set of active stores. It is backed up by Store Specifications that are dynamically fetched on -// every Update() call. -type StoreSet struct { - logger log.Logger - - // Store specifications can change dynamically. If some store is missing from the list, we assuming it is no longer - // accessible and we close gRPC client for it. - storeSpecs func() []StoreSpec - dialOpts []grpc.DialOption - gRPCInfoCallTimeout time.Duration - - mtx sync.RWMutex - storesStatusesMtx sync.RWMutex - stores map[string]*storeRef - storeNodeConnections prometheus.Gauge - externalLabelOccurrencesInStores map[string]int - storeStatuses map[string]*StoreStatus - unhealthyStoreTimeout time.Duration -} - -type storeSetNodeCollector struct { - externalLabelOccurrences func() map[string]int -} - -var nodeInfoDesc = prometheus.NewDesc( - "thanos_store_node_info", - "Number of nodes with the same external labels identified by their hash. If any time-series is larger than 1, external label uniqueness is not true", - []string{"external_labels"}, nil, -) - -func (c *storeSetNodeCollector) Describe(ch chan<- *prometheus.Desc) { - ch <- nodeInfoDesc -} - -func (c *storeSetNodeCollector) Collect(ch chan<- prometheus.Metric) { - externalLabelOccurrences := c.externalLabelOccurrences() - for externalLabels, occurrences := range externalLabelOccurrences { - ch <- prometheus.MustNewConstMetric(nodeInfoDesc, prometheus.GaugeValue, float64(occurrences), externalLabels) - } -} - -// NewStoreSet returns a new set of stores from cluster peers and statically configured ones. -func NewStoreSet( - logger log.Logger, - reg prometheus.Registerer, - storeSpecs func() []StoreSpec, - dialOpts []grpc.DialOption, - unhealthyStoreTimeout time.Duration, -) *StoreSet { - storeNodeConnections := promauto.With(reg).NewGauge(prometheus.GaugeOpts{ - Name: "thanos_store_nodes_grpc_connections", - Help: "Number indicating current number of gRPC connection to store nodes. This indicates also to how many stores query node have access to.", - }) - - if logger == nil { - logger = log.NewNopLogger() - } - if storeSpecs == nil { - storeSpecs = func() []StoreSpec { return nil } - } - - ss := &StoreSet{ - logger: log.With(logger, "component", "storeset"), - storeSpecs: storeSpecs, - dialOpts: dialOpts, - storeNodeConnections: storeNodeConnections, - gRPCInfoCallTimeout: 10 * time.Second, - externalLabelOccurrencesInStores: map[string]int{}, - stores: make(map[string]*storeRef), - storeStatuses: make(map[string]*StoreStatus), - unhealthyStoreTimeout: unhealthyStoreTimeout, - } - - storeNodeCollector := &storeSetNodeCollector{externalLabelOccurrences: ss.externalLabelOccurrences} - if reg != nil { - reg.MustRegister(storeNodeCollector) - } - - return ss -} - -type storeRef struct { - storepb.StoreClient - - mtx sync.RWMutex - cc *grpc.ClientConn - addr string - - // Meta (can change during runtime). - labelSets []labels.Labels - storeType component.StoreAPI - minTime int64 - maxTime int64 - - logger log.Logger -} - -func (s *storeRef) Update(labelSets []labels.Labels, minTime, maxTime int64) { - s.mtx.Lock() - defer s.mtx.Unlock() - - s.labelSets = labelSets - s.minTime = minTime - s.maxTime = maxTime -} - -func (s *storeRef) LabelSets() []labels.Labels { - s.mtx.RLock() - defer s.mtx.RUnlock() - return s.labelSets -} - -func (s *storeRef) TSDBInfos() []infopb.TSDBInfo { return nil } - -func (s *storeRef) TimeRange() (int64, int64) { - s.mtx.RLock() - defer s.mtx.RUnlock() - - return s.minTime, s.maxTime -} - -func (s *storeRef) SupportsSharding() bool { - return false -} - -func (s *storeRef) SupportsWithoutReplicaLabels() bool { - return false -} - -func (s *storeRef) String() string { - mint, maxt := s.TimeRange() - return fmt.Sprintf( - "Addr: %s LabelSets: %v MinTime: %d MaxTime: %d", - s.addr, labelpb.PromLabelSetsToString(s.LabelSets()), mint, maxt, - ) -} - -func (s *storeRef) Addr() (string, bool) { - return s.addr, false -} - -func (s *storeRef) close() { - runutil.CloseWithLogOnErr(s.logger, s.cc, fmt.Sprintf("store %v connection close", s.addr)) -} - -// Update updates the store set. It fetches current list of store specs from function and updates the fresh metadata -// from all stores. -func (s *StoreSet) Update(ctx context.Context) { - healthyStores := s.getHealthyStores(ctx) - - // Record the number of occurrences of external label combinations for current store slice. - externalLabelOccurrencesInStores := map[string]int{} - for _, st := range healthyStores { - externalLabelOccurrencesInStores[externalLabelsFromStore(st)]++ - } - level.Debug(s.logger).Log("msg", "updating healthy stores", "externalLabelOccurrencesInStores", fmt.Sprintf("%#+v", externalLabelOccurrencesInStores)) - - s.mtx.Lock() - defer s.mtx.Unlock() - - // Close stores that where not healthy this time (are not in healthy stores map). - for addr, store := range s.stores { - if _, ok := healthyStores[addr]; ok { - continue - } - - // Peer does not exists anymore. - store.close() - delete(s.stores, addr) - s.updateStoreStatus(store, errors.New(unhealthyStoreMessage)) - level.Info(s.logger).Log("msg", unhealthyStoreMessage, "address", addr) - } - - // Add stores that are not yet in s.stores. - for addr, store := range healthyStores { - if _, ok := s.stores[addr]; ok { - s.updateStoreStatus(store, nil) - continue - } - - externalLabels := externalLabelsFromStore(store) - if len(store.LabelSets()) > 0 && - externalLabelOccurrencesInStores[externalLabels] != 1 { - store.close() - s.updateStoreStatus(store, errors.New(droppingStoreMessage)) - level.Warn(s.logger).Log("msg", droppingStoreMessage, "address", addr, "extLset", externalLabels, "duplicates", externalLabelOccurrencesInStores[externalLabels]) - // We don't want to block all of them. Leave one to not disrupt in terms of migration. - externalLabelOccurrencesInStores[externalLabels]-- - continue - } - - s.stores[addr] = store - s.updateStoreStatus(store, nil) - level.Info(s.logger).Log("msg", "adding new store to query storeset", "address", addr) - } - - s.externalLabelOccurrencesInStores = externalLabelOccurrencesInStores - s.storeNodeConnections.Set(float64(len(s.stores))) - s.cleanUpStoreStatuses() -} - -func (s *StoreSet) getHealthyStores(ctx context.Context) map[string]*storeRef { - var ( - unique = make(map[string]struct{}) - - healthyStores = make(map[string]*storeRef, len(s.stores)) - mtx sync.Mutex - wg sync.WaitGroup - ) - - // Gather healthy stores map concurrently. Build new store if does not exist already. - for _, storeSpec := range s.storeSpecs() { - if _, ok := unique[storeSpec.Addr()]; ok { - level.Warn(s.logger).Log("msg", "duplicated address in store nodes", "address", storeSpec.Addr()) - continue - } - unique[storeSpec.Addr()] = struct{}{} - - wg.Add(1) - go func(spec StoreSpec) { - defer wg.Done() - - addr := spec.Addr() - - ctx, cancel := context.WithTimeout(ctx, s.gRPCInfoCallTimeout) - defer cancel() - - store, ok := s.stores[addr] - if ok { - // Check existing store. Is it healthy? What are current metadata? - labelSets, minTime, maxTime, err := spec.Metadata(ctx, store.StoreClient) - if err != nil { - // Peer unhealthy. Do not include in healthy stores. - s.updateStoreStatus(store, err) - level.Warn(s.logger).Log("msg", "update of store node failed", "err", err, "address", addr) - return - } - store.Update(labelSets, minTime, maxTime) - } else { - // New store or was unhealthy and was removed in the past - create new one. - conn, err := grpc.NewClient(addr, s.dialOpts...) - if err != nil { - s.updateStoreStatus(&storeRef{addr: addr}, err) - level.Warn(s.logger).Log("msg", "update of store node failed", "err", errors.Wrap(err, "dialing connection"), "address", addr) - return - } - store = &storeRef{StoreClient: storepb.NewStoreClient(conn), cc: conn, addr: addr, logger: s.logger} - - // Initial info call for all types of stores to check gRPC StoreAPI. - resp, err := store.StoreClient.Info(ctx, &storepb.InfoRequest{}, grpc.WaitForReady(true)) - if err != nil { - store.close() - s.updateStoreStatus(store, err) - level.Warn(s.logger).Log("msg", "update of store node failed", "err", errors.Wrap(err, "initial store client info fetch"), "address", addr) - return - } - if len(resp.LabelSets) == 0 && len(resp.Labels) > 0 { - resp.LabelSets = []labelpb.LabelSet{{Labels: resp.Labels}} - } - store.storeType = component.FromProto(resp.StoreType) - store.Update(labelpb.LabelpbLabelSetsToPromLabels(resp.LabelSets...), resp.MinTime, resp.MaxTime) - } - - mtx.Lock() - defer mtx.Unlock() - - healthyStores[addr] = store - }(storeSpec) - } - - wg.Wait() - - return healthyStores -} - -func externalLabelsFromStore(store *storeRef) string { - tsdbLabelSetStrings := make([]string, 0, len(store.labelSets)) - for _, ls := range store.labelSets { - sort.Sort(ls) - tsdbLabelSetStrings = append(tsdbLabelSetStrings, ls.String()) - } - sort.Strings(tsdbLabelSetStrings) - return strings.Join(tsdbLabelSetStrings, ",") -} - -func (s *StoreSet) updateStoreStatus(store *storeRef, err error) { - s.storesStatusesMtx.Lock() - defer s.storesStatusesMtx.Unlock() - - status := StoreStatus{Name: store.addr} - prev, ok := s.storeStatuses[store.addr] - if ok { - status = *prev - } - - status.LastError = err - status.LastCheck = time.Now() - - if err == nil { - status.LabelSets = store.labelSets - status.StoreType = store.storeType - status.MinTime = store.minTime - status.MaxTime = store.maxTime - } - - s.storeStatuses[store.addr] = &status -} - -func (s *StoreSet) GetStoreStatus() []StoreStatus { - s.storesStatusesMtx.RLock() - defer s.storesStatusesMtx.RUnlock() - - statuses := make([]StoreStatus, 0, len(s.storeStatuses)) - for _, v := range s.storeStatuses { - statuses = append(statuses, *v) - } - - sort.Slice(statuses, func(i, j int) bool { - return statuses[i].Name < statuses[j].Name - }) - return statuses -} - -func (s *StoreSet) externalLabelOccurrences() map[string]int { - s.mtx.RLock() - defer s.mtx.RUnlock() - - r := make(map[string]int, len(s.externalLabelOccurrencesInStores)) - for k, v := range s.externalLabelOccurrencesInStores { - r[k] = v - } - - return r -} - -// Get returns a list of all active stores. -func (s *StoreSet) Get() []store.Client { - s.mtx.RLock() - defer s.mtx.RUnlock() - - stores := make([]store.Client, 0, len(s.stores)) - for _, st := range s.stores { - stores = append(stores, st) - } - return stores -} - -func (s *StoreSet) Close() { - for _, st := range s.stores { - st.close() - } -} - -func (s *StoreSet) cleanUpStoreStatuses() { - s.storesStatusesMtx.Lock() - defer s.storesStatusesMtx.Unlock() - - now := time.Now() - for addr, status := range s.storeStatuses { - if _, ok := s.stores[addr]; !ok { - if now.Sub(status.LastCheck) >= s.unhealthyStoreTimeout { - delete(s.storeStatuses, addr) - } - } - } -} diff --git a/pkg/query/internal/test-storeset-pre-v0.8.0/storeset_test.go b/pkg/query/internal/test-storeset-pre-v0.8.0/storeset_test.go deleted file mode 100644 index 95daa96e06..0000000000 --- a/pkg/query/internal/test-storeset-pre-v0.8.0/storeset_test.go +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) The Thanos Authors. -// Licensed under the Apache License 2.0. - -package testoldstoreset - -import ( - "context" - "fmt" - "math" - "net" - "os" - "sort" - "testing" - "time" - - "github.com/go-kit/log" - "github.com/go-kit/log/level" - "github.com/prometheus/prometheus/model/labels" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/credentials/insecure" - "google.golang.org/grpc/status" - - "github.com/efficientgo/core/testutil" - "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/testutil/custom" -) - -var testGRPCOpts = []grpc.DialOption{ - grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(math.MaxInt32)), - grpc.WithTransportCredentials(insecure.NewCredentials()), -} - -type testStore struct { - info storepb.InfoResponse -} - -func (s *testStore) Info(ctx context.Context, r *storepb.InfoRequest) (*storepb.InfoResponse, error) { - return &s.info, nil -} - -func (s *testStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesServer) error { - return status.Error(codes.Unimplemented, "not implemented") -} - -func (s *testStore) LabelNames(ctx context.Context, r *storepb.LabelNamesRequest) ( - *storepb.LabelNamesResponse, error, -) { - return nil, status.Error(codes.Unimplemented, "not implemented") -} - -func (s *testStore) LabelValues(ctx context.Context, r *storepb.LabelValuesRequest) ( - *storepb.LabelValuesResponse, error, -) { - return nil, status.Error(codes.Unimplemented, "not implemented") -} - -type testStoreMeta struct { - extlsetFn func(addr string) labelpb.LabelSets - storeType component.StoreAPI -} - -type testStores struct { - srvs map[string]*grpc.Server -} - -func startTestStores(stores []testStoreMeta) (*testStores, error) { - st := &testStores{ - srvs: map[string]*grpc.Server{}, - } - - for _, store := range stores { - listener, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - // Close so far started servers. - st.Close() - return nil, err - } - - srv := grpc.NewServer() - storepb.RegisterStoreServer(srv, &testStore{info: storepb.InfoResponse{LabelSets: store.extlsetFn(listener.Addr().String()), StoreType: store.storeType.ToProto()}}) - go func() { - _ = srv.Serve(listener) - }() - - st.srvs[listener.Addr().String()] = srv - } - - return st, nil -} - -func (s *testStores) StoreAddresses() []string { - var stores []string - for addr := range s.srvs { - stores = append(stores, addr) - } - return stores -} - -func (s *testStores) Close() { - for _, srv := range s.srvs { - srv.Stop() - } - s.srvs = nil -} - -func (s *testStores) CloseOne(addr string) { - srv, ok := s.srvs[addr] - if !ok { - return - } - - srv.Stop() - delete(s.srvs, addr) -} - -func specsFromAddrFunc(addrs []string) func() []StoreSpec { - return func() (specs []StoreSpec) { - for _, addr := range addrs { - specs = append(specs, NewGRPCStoreSpec(addr)) - } - return specs - } -} - -func TestMain(m *testing.M) { - custom.TolerantVerifyLeakMain(m) -} - -func TestPre0_8_0_StoreSet_AgainstNewStoreGW(t *testing.T) { - st, err := startTestStores([]testStoreMeta{ - { - storeType: component.Sidecar, - extlsetFn: func(addr string) labelpb.LabelSets { - return []labelpb.LabelSet{ - { - Labels: []labelpb.Label{ - {Name: "l1", Value: "v2"}, - {Name: "l2", Value: "v3"}, - }, - }, - } - }, - }, - { - storeType: component.Store, - extlsetFn: func(addr string) labelpb.LabelSets { - return []labelpb.LabelSet{ - { - Labels: []labelpb.Label{ - // This is the labelset exposed by store when having only one sidecar's data. - {Name: "l1", Value: "v2"}, - {Name: "l2", Value: "v3"}, - }, - }, - { - Labels: []labelpb.Label{{Name: store.CompatibilityTypeLabelName, Value: "store"}}, - }, - } - }, - }, - // We expect this to be duplicated. - { - storeType: component.Store, - extlsetFn: func(addr string) labelpb.LabelSets { - return []labelpb.LabelSet{ - { - Labels: []labelpb.Label{ - {Name: "l1", Value: "v2"}, - {Name: "l2", Value: "v3"}, - }, - }, - { - Labels: []labelpb.Label{{Name: store.CompatibilityTypeLabelName, Value: "store"}}, - }, - } - }, - }, - }) - testutil.Ok(t, err) - defer st.Close() - - logger := log.NewLogfmtLogger(log.NewSyncWriter(os.Stderr)) - logger = level.NewFilter(logger, level.AllowDebug()) - logger = log.With(logger, "ts", log.DefaultTimestampUTC, "caller", log.DefaultCaller) - storeSet := NewStoreSet(logger, nil, specsFromAddrFunc(st.StoreAddresses()), testGRPCOpts, time.Minute) - storeSet.gRPCInfoCallTimeout = 2 * time.Second - defer storeSet.Close() - - // Should not matter how many of these we run. - storeSet.Update(context.Background()) - storeSet.Update(context.Background()) - storeSet.Update(context.Background()) - storeSet.Update(context.Background()) - - testutil.Assert(t, len(storeSet.stores) == 2, fmt.Sprintf("all services should respond just fine, but we expect duplicates being blocked. Expected %d stores, got %d", 5, len(storeSet.stores))) - - // Sort result to be able to compare. - var existingStoreLabels [][]labels.Labels - for _, store := range storeSet.stores { - lset := append([]labels.Labels{}, store.LabelSets()...) - existingStoreLabels = append(existingStoreLabels, lset) - } - sort.Slice(existingStoreLabels, func(i, j int) bool { - return len(existingStoreLabels[i]) > len(existingStoreLabels[j]) - }) - - testutil.Equals(t, [][]labels.Labels{ - { - { - {Name: "l1", Value: "v2"}, - {Name: "l2", Value: "v3"}, - }, - { - {Name: store.CompatibilityTypeLabelName, Value: "store"}, - }, - }, - { - { - {Name: "l1", Value: "v2"}, - {Name: "l2", Value: "v3"}, - }, - }, - }, existingStoreLabels) -} diff --git a/pkg/query/query_test.go b/pkg/query/query_test.go index b490156e82..8d1df8593c 100644 --- a/pkg/query/query_test.go +++ b/pkg/query/query_test.go @@ -4,7 +4,6 @@ package query import ( - "context" "fmt" "os" "path/filepath" @@ -121,21 +120,6 @@ func selectedStore(wrapped storepb.StoreServer, matchers []storepb.LabelMatcher, } } -func (s *selectStore) Info(ctx context.Context, r *storepb.InfoRequest) (*storepb.InfoResponse, error) { - resp, err := s.StoreServer.Info(ctx, r) - if err != nil { - return nil, err - } - if resp.MinTime < s.mint { - resp.MinTime = s.mint - } - if resp.MaxTime > s.maxt { - resp.MaxTime = s.maxt - } - // TODO(bwplotka): Match labelsets and expose only those? - return resp, nil -} - func (s *selectStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesServer) error { if r.MinTime < s.mint { r.MinTime = s.mint diff --git a/pkg/receive/multitsdb.go b/pkg/receive/multitsdb.go index 1a0d0370c3..bbcc56fa60 100644 --- a/pkg/receive/multitsdb.go +++ b/pkg/receive/multitsdb.go @@ -153,10 +153,6 @@ func (m *seriesClientMapper) SendMsg(_ interface{}) error { return nil } -func (l *localClient) Info(ctx context.Context, in *storepb.InfoRequest, opts ...grpc.CallOption) (*storepb.InfoResponse, error) { - return l.store.Info(ctx, in) -} - func (l *localClient) Series(ctx context.Context, in *storepb.SeriesRequest, opts ...grpc.CallOption) (storepb.Store_SeriesClient, error) { return &seriesClientMapper{ctx: ctx, store: l.store, req: *in}, nil } diff --git a/pkg/store/bucket.go b/pkg/store/bucket.go index 0b50f78b96..2a6593d7fe 100644 --- a/pkg/store/bucket.go +++ b/pkg/store/bucket.go @@ -46,7 +46,6 @@ import ( "github.com/thanos-io/thanos/pkg/block/indexheader" "github.com/thanos-io/thanos/pkg/block/metadata" "github.com/thanos-io/thanos/pkg/compact/downsample" - "github.com/thanos-io/thanos/pkg/component" "github.com/thanos-io/thanos/pkg/extprom" "github.com/thanos-io/thanos/pkg/gate" "github.com/thanos-io/thanos/pkg/info/infopb" @@ -950,19 +949,6 @@ func (s *BucketStore) LabelSet() []labelpb.LabelSet { return labelSets } -// Info implements the storepb.StoreServer interface. -func (s *BucketStore) Info(context.Context, *storepb.InfoRequest) (*storepb.InfoResponse, error) { - mint, maxt := s.TimeRange() - res := &storepb.InfoResponse{ - StoreType: component.Store.ToProto(), - MinTime: mint, - MaxTime: maxt, - LabelSets: s.LabelSet(), - } - - return res, nil -} - func (s *BucketStore) limitMinTime(mint int64) int64 { if s.filterConfig == nil { return mint diff --git a/pkg/store/bucket_test.go b/pkg/store/bucket_test.go index 7806d72916..aee3c5d79a 100644 --- a/pkg/store/bucket_test.go +++ b/pkg/store/bucket_test.go @@ -735,47 +735,6 @@ func TestBucketStore_TSDBInfo(t *testing.T) { }) } -func TestBucketStore_Info(t *testing.T) { - defer custom.TolerantVerifyLeak(t) - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - dir := t.TempDir() - - chunkPool, err := NewDefaultChunkBytesPool(2e5) - testutil.Ok(t, err) - - bucketStore, err := NewBucketStore( - nil, - nil, - dir, - NewChunksLimiterFactory(0), - NewSeriesLimiterFactory(0), - NewBytesLimiterFactory(0), - NewGapBasedPartitioner(PartitionerMaxGapSize), - 20, - true, - DefaultPostingOffsetInMemorySampling, - false, - false, - 0, - WithChunkPool(chunkPool), - WithFilterConfig(allowAllFilterConf), - ) - testutil.Ok(t, err) - defer func() { testutil.Ok(t, bucketStore.Close()) }() - - resp, err := bucketStore.Info(ctx, &storepb.InfoRequest{}) - testutil.Ok(t, err) - - testutil.Equals(t, storepb.StoreType_STORE, resp.StoreType) - testutil.Equals(t, int64(math.MaxInt64), resp.MinTime) - testutil.Equals(t, int64(math.MinInt64), resp.MaxTime) - testutil.Equals(t, []labelpb.LabelSet(nil), resp.LabelSets) - testutil.Equals(t, []labelpb.Label(nil), resp.Labels) -} - type recorder struct { mtx sync.Mutex objstore.Bucket @@ -1022,14 +981,6 @@ func testSharding(t *testing.T, reuseDisk string, bkt objstore.Bucket, all ...ul }) testutil.Equals(t, sc.expectedIDs, ids) - // Check Info endpoint. - resp, err := bucketStore.Info(context.Background(), &storepb.InfoRequest{}) - testutil.Ok(t, err) - - testutil.Equals(t, storepb.StoreType_STORE, resp.StoreType) - testutil.Equals(t, []labelpb.Label(nil), resp.Labels) - testutil.Equals(t, sc.expectedAdvLabels, resp.LabelSets) - // Make sure we don't download files we did not expect to. // Regression test: https://github.com/thanos-io/thanos/issues/1664 diff --git a/pkg/store/local.go b/pkg/store/local.go index 7f0e80faa2..30a39c21a1 100644 --- a/pkg/store/local.go +++ b/pkg/store/local.go @@ -8,7 +8,6 @@ import ( "bytes" "context" "io" - "math" "sort" "github.com/go-kit/log" @@ -33,8 +32,7 @@ type LocalStore struct { logger log.Logger extLabels labels.Labels - info *storepb.InfoResponse - c io.Closer + c io.Closer // TODO(bwplotka): This is very naive in-memory DB. We can support much larger files, by // indexing labels, symbolizing strings and get chunk refs only without storing protobufs in memory. @@ -67,14 +65,6 @@ func NewLocalStoreFromJSONMmappableFile( logger: logger, extLabels: extLabels, c: f, - info: &storepb.InfoResponse{ - LabelSets: []labelpb.LabelSet{ - {Labels: labelpb.PromLabelsToLabelpbLabels(extLabels)}, - }, - StoreType: component.ToProto(), - MinTime: math.MaxInt64, - MaxTime: math.MinInt64, - }, } // Do quick pass for in-mem index. @@ -101,13 +91,7 @@ func NewLocalStoreFromJSONMmappableFile( } chks := make([]int, 0, len(series.Chunks)) // Sort chunks in separate slice by MinTime for easier lookup. Find global max and min. - for ci, c := range series.Chunks { - if s.info.MinTime > c.MinTime { - s.info.MinTime = c.MinTime - } - if s.info.MaxTime < c.MaxTime { - s.info.MaxTime = c.MaxTime - } + for ci := range series.Chunks { chks = append(chks, ci) } @@ -121,7 +105,7 @@ func NewLocalStoreFromJSONMmappableFile( if err := skanner.Err(); err != nil { return nil, errors.Wrapf(err, "scanning file %s", path) } - level.Info(logger).Log("msg", "loading JSON file succeeded", "file", path, "info", s.info.String(), "series", len(s.series)) + level.Info(logger).Log("msg", "loading JSON file succeeded", "file", path, "series", len(s.series)) return s, nil } @@ -143,11 +127,6 @@ func ScanGRPCCurlProtoStreamMessages(data []byte, atEOF bool) (advance int, toke return len(delim), nil, nil } -// Info returns store information about the Prometheus instance. -func (s *LocalStore) Info(_ context.Context, _ *storepb.InfoRequest) (*storepb.InfoResponse, error) { - return s.info, nil -} - // Series returns all series for a requested time range and label matcher. The returned data may // exceed the requested time bounds. func (s *LocalStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesServer) error { diff --git a/pkg/store/prometheus.go b/pkg/store/prometheus.go index 25168b4abc..3148738b12 100644 --- a/pkg/store/prometheus.go +++ b/pkg/store/prometheus.go @@ -109,31 +109,6 @@ func (p *PrometheusStore) labelCallsSupportMatchers() bool { return parseErr == nil && version.GTE(baseVer) } -// Info returns store information about the Prometheus instance. -// NOTE(bwplotka): MaxTime & MinTime are not accurate nor adjusted dynamically. -// This is fine for now, but might be needed in future. -func (p *PrometheusStore) Info(_ context.Context, _ *storepb.InfoRequest) (*storepb.InfoResponse, error) { - lset := p.externalLabelsFn() - mint, maxt := p.timestamps() - - res := &storepb.InfoResponse{ - Labels: labelpb.PromLabelsToLabelpbLabels(lset), - StoreType: p.component.ToProto(), - MinTime: mint, - MaxTime: maxt, - } - - // Until we deprecate the single labels in the reply, we just duplicate - // them here for migration/compatibility purposes. - res.LabelSets = []labelpb.LabelSet{} - if len(res.Labels) > 0 { - res.LabelSets = append(res.LabelSets, labelpb.LabelSet{ - Labels: res.Labels, - }) - } - return res, nil -} - func (p *PrometheusStore) getBuffer() *[]byte { b := p.buffers.Get() return b.(*[]byte) diff --git a/pkg/store/prometheus_test.go b/pkg/store/prometheus_test.go index 2e937758ce..5a31ccbf17 100644 --- a/pkg/store/prometheus_test.go +++ b/pkg/store/prometheus_test.go @@ -454,24 +454,3 @@ func TestPrometheusStore_Series_ChunkHashCalculation_Integration(t *testing.T) { testutil.Equals(t, want, got) } } - -func TestPrometheusStore_Info(t *testing.T) { - defer custom.TolerantVerifyLeak(t) - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - proxy, err := NewPrometheusStore(nil, nil, promclient.NewDefaultClient(), nil, component.Sidecar, - func() labels.Labels { return labels.FromStrings("region", "eu-west") }, - func() (int64, int64) { return 123, 456 }, - nil) - testutil.Ok(t, err) - - resp, err := proxy.Info(ctx, &storepb.InfoRequest{}) - testutil.Ok(t, err) - - testutil.Equals(t, []labelpb.Label{{Name: "region", Value: "eu-west"}}, resp.Labels) - testutil.Equals(t, storepb.StoreType_SIDECAR, resp.StoreType) - testutil.Equals(t, int64(123), resp.MinTime) - testutil.Equals(t, int64(456), resp.MaxTime) -} diff --git a/pkg/store/proxy.go b/pkg/store/proxy.go index 18f9ba41f7..ea0845f784 100644 --- a/pkg/store/proxy.go +++ b/pkg/store/proxy.go @@ -165,62 +165,6 @@ func NewProxyStore( return s } -// Info returns store information about the external labels this store have. -func (s *ProxyStore) Info(_ context.Context, _ *storepb.InfoRequest) (*storepb.InfoResponse, error) { - res := &storepb.InfoResponse{ - StoreType: s.component.ToProto(), - Labels: labelpb.PromLabelsToLabelpbLabels(s.selectorLabels), - } - - minTime := int64(math.MaxInt64) - maxTime := int64(0) - stores := s.stores() - - // Edge case: we have no data if there are no stores. - if len(stores) == 0 { - res.MaxTime = 0 - res.MinTime = 0 - - return res, nil - } - - for _, s := range stores { - mint, maxt := s.TimeRange() - if mint < minTime { - minTime = mint - } - if maxt > maxTime { - maxTime = maxt - } - } - - res.MaxTime = maxTime - res.MinTime = minTime - - labelSets := make(map[uint64]labelpb.LabelSet, len(stores)) - for _, st := range stores { - for _, lset := range st.LabelSets() { - mergedLabelSet := labelpb.ExtendSortedLabels(lset, s.selectorLabels) - labelSets[mergedLabelSet.Hash()] = labelpb.LabelSet{Labels: labelpb.PromLabelsToLabelpbLabels(mergedLabelSet)} - } - } - - res.LabelSets = make([]labelpb.LabelSet, 0, len(labelSets)) - for _, v := range labelSets { - res.LabelSets = append(res.LabelSets, v) - } - - // We always want to enforce announcing the subset of data that - // 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. - if len(res.LabelSets) == 0 && len(res.Labels) > 0 { - res.LabelSets = append(res.LabelSets, labelpb.LabelSet{Labels: res.Labels}) - } - - return res, nil -} - func (s *ProxyStore) LabelSet() []labelpb.LabelSet { stores := s.stores() if len(stores) == 0 { diff --git a/pkg/store/proxy_test.go b/pkg/store/proxy_test.go index 1943f15e78..c035c86d58 100644 --- a/pkg/store/proxy_test.go +++ b/pkg/store/proxy_test.go @@ -26,8 +26,6 @@ import ( "github.com/prometheus/prometheus/tsdb" "github.com/prometheus/prometheus/tsdb/chunkenc" "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" "github.com/efficientgo/core/testutil" @@ -59,27 +57,6 @@ type mockedStartTimeDB struct { func (db *mockedStartTimeDB) StartTime() (int64, error) { return db.startTime, nil } -func TestProxyStore_Info(t *testing.T) { - defer custom.TolerantVerifyLeak(t) - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - q := NewProxyStore(nil, - nil, - func() []Client { return nil }, - component.Query, - labels.EmptyLabels(), 0*time.Second, EagerRetrieval, - ) - - resp, err := q.Info(ctx, &storepb.InfoRequest{}) - testutil.Ok(t, err) - testutil.Equals(t, []labelpb.LabelSet(nil), resp.LabelSets) - testutil.Equals(t, storepb.StoreType_QUERY, resp.StoreType) - testutil.Equals(t, int64(0), resp.MinTime) - testutil.Equals(t, int64(0), resp.MaxTime) -} - func TestProxyStore_TSDBInfos(t *testing.T) { stores := []Client{ &storetestutil.TestClient{ @@ -2021,10 +1998,6 @@ type mockedStoreAPI struct { injectedErrorIndex int } -func (s *mockedStoreAPI) Info(context.Context, *storepb.InfoRequest, ...grpc.CallOption) (*storepb.InfoResponse, error) { - return nil, status.Error(codes.Unimplemented, "not implemented") -} - func (s *mockedStoreAPI) Series(ctx context.Context, req *storepb.SeriesRequest, _ ...grpc.CallOption) (storepb.Store_SeriesClient, error) { s.LastSeriesReq = req return &storetestutil.StoreSeriesClient{InjectedErrorIndex: s.injectedErrorIndex, InjectedError: s.injectedError, Ctx: ctx, RespSet: s.RespSeries, RespDur: s.RespDuration, SlowSeriesIndex: s.SlowSeriesIndex}, s.RespError diff --git a/pkg/store/storepb/inprocess.go b/pkg/store/storepb/inprocess.go index e09210d442..a7ccde2ec4 100644 --- a/pkg/store/storepb/inprocess.go +++ b/pkg/store/storepb/inprocess.go @@ -20,10 +20,6 @@ type serverAsClient struct { srv StoreServer } -func (s serverAsClient) Info(ctx context.Context, in *InfoRequest, _ ...grpc.CallOption) (*InfoResponse, error) { - return s.srv.Info(ctx, in) -} - func (s serverAsClient) LabelNames(ctx context.Context, in *LabelNamesRequest, _ ...grpc.CallOption) (*LabelNamesResponse, error) { return s.srv.LabelNames(ctx, in) } diff --git a/pkg/store/storepb/inprocess_test.go b/pkg/store/storepb/inprocess_test.go index 67c5d2c1ff..dab3f5548c 100644 --- a/pkg/store/storepb/inprocess_test.go +++ b/pkg/store/storepb/inprocess_test.go @@ -15,9 +15,6 @@ import ( ) type testStoreServer struct { - info *InfoResponse - infoLastReq *InfoRequest - series []*SeriesResponse seriesLastReq *SeriesRequest @@ -30,11 +27,6 @@ type testStoreServer struct { err error } -func (t *testStoreServer) Info(_ context.Context, r *InfoRequest) (*InfoResponse, error) { - t.infoLastReq = r - return t.info, t.err -} - func (t *testStoreServer) Series(r *SeriesRequest, server Store_SeriesServer) error { t.seriesLastReq = r for i, s := range t.series { @@ -62,34 +54,6 @@ func TestServerAsClient(t *testing.T) { ctx := context.Background() for _, bufferSize := range []int{0, 1, 20, 100} { t.Run(fmt.Sprintf("buffer=%v", bufferSize), func(t *testing.T) { - t.Run("Info", func(t *testing.T) { - s := &testStoreServer{ - info: &InfoResponse{ - LabelSets: []labelpb.LabelSet{{Labels: []labelpb.Label{{Name: "a", Value: "b"}}}}, - MinTime: -1, - MaxTime: 10, - StoreType: StoreType_DEBUG, - }} - t.Run("ok", func(t *testing.T) { - for i := 0; i < 20; i++ { - r := &InfoRequest{} - resp, err := ServerAsClient(s).Info(ctx, r) - testutil.Ok(t, err) - testutil.Equals(t, s.info, resp) - testutil.Equals(t, r, s.infoLastReq) - s.infoLastReq = nil - } - }) - t.Run("error", func(t *testing.T) { - s.err = errors.New("some error") - for i := 0; i < 20; i++ { - r := &InfoRequest{} - _, err := ServerAsClient(s).Info(ctx, r) - testutil.NotOk(t, err) - testutil.Equals(t, s.err, err) - } - }) - }) t.Run("Series", func(t *testing.T) { s := &testStoreServer{ series: []*SeriesResponse{ @@ -189,13 +153,7 @@ func TestServerAsClient(t *testing.T) { }) }) t.Run("LabelNames", func(t *testing.T) { - s := &testStoreServer{ - info: &InfoResponse{ - LabelSets: []labelpb.LabelSet{{Labels: []labelpb.Label{{Name: "a", Value: "b"}}}}, - MinTime: -1, - MaxTime: 10, - StoreType: StoreType_DEBUG, - }} + s := &testStoreServer{} t.Run("ok", func(t *testing.T) { for i := 0; i < 20; i++ { r := &LabelNamesRequest{ diff --git a/pkg/store/storepb/rpc.pb.go b/pkg/store/storepb/rpc.pb.go index 939f36d1ee..0c2d67dfb1 100644 --- a/pkg/store/storepb/rpc.pb.go +++ b/pkg/store/storepb/rpc.pb.go @@ -13,7 +13,6 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" types "github.com/gogo/protobuf/types" - labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" prompb "github.com/thanos-io/thanos/pkg/store/storepb/prompb" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -31,48 +30,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Deprecated. Use `thanos.info` instead. -type StoreType int32 - -const ( - StoreType_UNKNOWN StoreType = 0 - StoreType_QUERY StoreType = 1 - StoreType_RULE StoreType = 2 - StoreType_SIDECAR StoreType = 3 - StoreType_STORE StoreType = 4 - StoreType_RECEIVE StoreType = 5 - // DEBUG represents some debug StoreAPI components e.g. thanos tools store-api-serve. - StoreType_DEBUG StoreType = 6 -) - -var StoreType_name = map[int32]string{ - 0: "UNKNOWN", - 1: "QUERY", - 2: "RULE", - 3: "SIDECAR", - 4: "STORE", - 5: "RECEIVE", - 6: "DEBUG", -} - -var StoreType_value = map[string]int32{ - "UNKNOWN": 0, - "QUERY": 1, - "RULE": 2, - "SIDECAR": 3, - "STORE": 4, - "RECEIVE": 5, - "DEBUG": 6, -} - -func (x StoreType) String() string { - return proto.EnumName(StoreType_name, int32(x)) -} - -func (StoreType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{0} -} - type Aggr int32 const ( @@ -107,7 +64,7 @@ func (x Aggr) String() string { } func (Aggr) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{1} + return fileDescriptor_a938d55a388af629, []int{0} } type WriteResponse struct { @@ -185,87 +142,6 @@ func (m *WriteRequest) XXX_DiscardUnknown() { var xxx_messageInfo_WriteRequest proto.InternalMessageInfo -// Deprecated. Use `thanos.info` instead. -type InfoRequest struct { -} - -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_a938d55a388af629, []int{2} -} -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 (m *InfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_InfoRequest.Merge(m, src) -} -func (m *InfoRequest) XXX_Size() int { - return m.Size() -} -func (m *InfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_InfoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_InfoRequest proto.InternalMessageInfo - -// Deprecated. Use `thanos.info` instead. -type InfoResponse struct { - // Deprecated. Use label_sets instead. - Labels []labelpb.Label `protobuf:"bytes,1,rep,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"` - StoreType StoreType `protobuf:"varint,4,opt,name=storeType,proto3,enum=thanos.StoreType" json:"storeType,omitempty"` - // label_sets is an unsorted list of `LabelSet`s. - LabelSets []labelpb.LabelSet `protobuf:"bytes,5,rep,name=label_sets,json=labelSets,proto3" json:"label_sets"` -} - -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_a938d55a388af629, []int{3} -} -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 (m *InfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_InfoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_InfoResponse proto.InternalMessageInfo - 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"` @@ -312,7 +188,7 @@ 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{4} + return fileDescriptor_a938d55a388af629, []int{2} } func (m *SeriesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -360,7 +236,7 @@ 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{5} + return fileDescriptor_a938d55a388af629, []int{3} } func (m *QueryHints) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -405,7 +281,7 @@ 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{6} + return fileDescriptor_a938d55a388af629, []int{4} } func (m *ShardInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -443,7 +319,7 @@ 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{7} + return fileDescriptor_a938d55a388af629, []int{5} } func (m *Func) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -483,7 +359,7 @@ 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{8} + return fileDescriptor_a938d55a388af629, []int{6} } func (m *Grouping) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -520,7 +396,7 @@ 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{9} + return fileDescriptor_a938d55a388af629, []int{7} } func (m *Range) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -561,7 +437,7 @@ 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{10} + return fileDescriptor_a938d55a388af629, []int{8} } func (m *SeriesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -668,7 +544,7 @@ 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{11} + return fileDescriptor_a938d55a388af629, []int{9} } func (m *LabelNamesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -710,7 +586,7 @@ 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{12} + return fileDescriptor_a938d55a388af629, []int{10} } func (m *LabelNamesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -761,7 +637,7 @@ 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{13} + return fileDescriptor_a938d55a388af629, []int{11} } func (m *LabelValuesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -803,7 +679,7 @@ 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{14} + return fileDescriptor_a938d55a388af629, []int{12} } func (m *LabelValuesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -833,12 +709,9 @@ func (m *LabelValuesResponse) XXX_DiscardUnknown() { var xxx_messageInfo_LabelValuesResponse proto.InternalMessageInfo func init() { - proto.RegisterEnum("thanos.StoreType", StoreType_name, StoreType_value) proto.RegisterEnum("thanos.Aggr", Aggr_name, Aggr_value) proto.RegisterType((*WriteResponse)(nil), "thanos.WriteResponse") proto.RegisterType((*WriteRequest)(nil), "thanos.WriteRequest") - proto.RegisterType((*InfoRequest)(nil), "thanos.InfoRequest") - proto.RegisterType((*InfoResponse)(nil), "thanos.InfoResponse") proto.RegisterType((*SeriesRequest)(nil), "thanos.SeriesRequest") proto.RegisterType((*QueryHints)(nil), "thanos.QueryHints") proto.RegisterType((*ShardInfo)(nil), "thanos.ShardInfo") @@ -855,90 +728,79 @@ func init() { func init() { proto.RegisterFile("store/storepb/rpc.proto", fileDescriptor_a938d55a388af629) } var fileDescriptor_a938d55a388af629 = []byte{ - // 1313 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4b, 0x6f, 0xdb, 0x46, - 0x10, 0x16, 0x45, 0x51, 0x8f, 0x91, 0xad, 0x30, 0x1b, 0xc5, 0xa1, 0x15, 0x40, 0x56, 0x55, 0x14, - 0x10, 0xd2, 0xc0, 0x4e, 0x95, 0xb6, 0x40, 0x8b, 0x5e, 0x6c, 0x47, 0x89, 0x8d, 0xc6, 0x4a, 0xb3, - 0xb2, 0xe3, 0x3e, 0x50, 0x08, 0x94, 0xb4, 0xa6, 0x88, 0x50, 0x24, 0xc3, 0x5d, 0xd6, 0xd6, 0xb5, - 0xed, 0xb9, 0xe8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 0xe6, 0x7a, 0xe4, 0x8c, 0x68, 0x90, 0x12, - 0x4d, 0x96, 0xe8, 0x53, 0x58, 0x3b, 0x75, 0xd9, 0x38, 0x88, 0x59, 0x5f, 0xb5, 0x55, 0x5f, 0xf5, - 0x4c, 0xa5, 0xa1, 0xb7, 0x4a, 0xb8, 0xaa, 0x58, 0x2c, 0xc9, 0xfb, 0xb2, 0x59, 0xaa, 0x60, 0x78, - 0xee, 0xc4, 0x65, 0xd6, 0x25, 0x99, 0xb2, 0x30, 0x9a, 0x4f, 0x35, 0x80, 0x79, 0x62, 0xa2, 0x70, - 0x8c, 0x84, 0xfd, 0x89, 0xeb, 0x79, 0x2e, 0x55, 0x22, 0x05, 0x0e, 0x1d, 0x08, 0x04, 0x35, 0x20, - 0x77, 0x12, 0xfb, 0x43, 0xa1, 0xd1, 0xf2, 0x5c, 0x1a, 0x77, 0x63, 0x7f, 0x88, 0x05, 0x83, 0x6e, - 0x42, 0xd1, 0x89, 0x82, 0x38, 0x74, 0x7d, 0x47, 0x28, 0x6d, 0xa1, 0x57, 0xee, 0x29, 0x1c, 0xcf, - 0x3c, 0xd0, 0x87, 0x49, 0x21, 0x0d, 0xe1, 0x3a, 0x6b, 0x77, 0xcc, 0x41, 0x55, 0xd7, 0xe6, 0x29, - 0x94, 0x66, 0x85, 0x10, 0x29, 0xaa, 0x7a, 0x8d, 0xc8, 0xd9, 0x2c, 0x45, 0xc9, 0x8f, 0xc8, 0x19, - 0xfa, 0x00, 0x56, 0x58, 0xc0, 0x6c, 0xaf, 0x2f, 0x30, 0xaa, 0xda, 0xa9, 0x2c, 0x30, 0x11, 0x86, - 0xa2, 0x0a, 0x64, 0x07, 0x53, 0x31, 0x17, 0x8a, 0x38, 0x3b, 0x98, 0xf2, 0x39, 0xa6, 0x2a, 0x98, - 0x13, 0x15, 0x54, 0x56, 0xb3, 0x06, 0x39, 0x7e, 0x33, 0x2e, 0x01, 0xdf, 0x56, 0x4d, 0x5b, 0xc2, - 0x62, 0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0xf8, 0x97, 0x71, 0x25, 0x79, - 0x9d, 0x85, 0x4f, 0xcf, 0x5a, 0x35, 0x0d, 0xaa, 0xfa, 0x7d, 0x01, 0x79, 0x39, 0x57, 0xd1, 0xd5, - 0xf4, 0x9c, 0x4d, 0xb6, 0xad, 0x9d, 0x87, 0xe5, 0xc6, 0x5b, 0x1a, 0xda, 0x05, 0x98, 0xf7, 0x28, - 0x5a, 0x4f, 0x29, 0x62, 0x71, 0x7a, 0xd6, 0x6a, 0xcb, 0x28, 0x75, 0xfe, 0x5d, 0x28, 0x2f, 0x3c, - 0x2b, 0x4a, 0xbb, 0xa6, 0x1a, 0xb1, 0x76, 0x7d, 0x29, 0x27, 0xe3, 0xb4, 0xbb, 0x50, 0x11, 0x1f, - 0xfb, 0xbc, 0xc3, 0x64, 0x31, 0xbe, 0x82, 0x32, 0x26, 0x93, 0x80, 0x11, 0x81, 0xa3, 0xd9, 0xf5, - 0x17, 0x7f, 0x13, 0xd4, 0xae, 0x9e, 0x43, 0xd5, 0x6f, 0x87, 0xcc, 0xce, 0x47, 0xcf, 0xfe, 0xad, - 0x67, 0x9e, 0xbd, 0xa8, 0x6b, 0xcf, 0x5f, 0xd4, 0xb5, 0x7f, 0x5e, 0xd4, 0xb5, 0xdf, 0x5f, 0xd6, - 0x33, 0xcf, 0x5f, 0xd6, 0x33, 0x7f, 0xbe, 0xac, 0x67, 0xbe, 0x2f, 0xa8, 0x9f, 0x2f, 0x83, 0xbc, - 0xd0, 0xcc, 0xed, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x67, 0xe9, 0xef, 0x06, 0x28, 0x0d, 0x00, - 0x00, + // 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,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, + 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, 0xc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d, 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. @@ -953,10 +815,6 @@ const _ = grpc.SupportPackageIsVersion4 // // 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 { - /// Info returns meta information about a store e.g labels that makes that store unique as well as time range that is - /// available. - /// Deprecated. Use `thanos.info` instead. - Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) /// 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 @@ -981,15 +839,6 @@ func NewStoreClient(cc *grpc.ClientConn) StoreClient { return &storeClient{cc} } -func (c *storeClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) { - out := new(InfoResponse) - err := c.cc.Invoke(ctx, "/thanos.Store/Info", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - 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 { @@ -1042,10 +891,6 @@ func (c *storeClient) LabelValues(ctx context.Context, in *LabelValuesRequest, o // StoreServer is the server API for Store service. type StoreServer interface { - /// Info returns meta information about a store e.g labels that makes that store unique as well as time range that is - /// available. - /// Deprecated. Use `thanos.info` instead. - Info(context.Context, *InfoRequest) (*InfoResponse, error) /// 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 @@ -1066,9 +911,6 @@ type StoreServer interface { type UnimplementedStoreServer struct { } -func (*UnimplementedStoreServer) Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") -} func (*UnimplementedStoreServer) Series(req *SeriesRequest, srv Store_SeriesServer) error { return status.Errorf(codes.Unimplemented, "method Series not implemented") } @@ -1083,24 +925,6 @@ func RegisterStoreServer(s *grpc.Server, srv StoreServer) { s.RegisterService(&_Store_serviceDesc, srv) } -func _Store_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.(StoreServer).Info(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/thanos.Store/Info", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreServer).Info(ctx, req.(*InfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Store_Series_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(SeriesRequest) if err := stream.RecvMsg(m); err != nil { @@ -1162,10 +986,6 @@ var _Store_serviceDesc = grpc.ServiceDesc{ ServiceName: "thanos.Store", HandlerType: (*StoreServer)(nil), Methods: []grpc.MethodDesc{ - { - MethodName: "Info", - Handler: _Store_Info_Handler, - }, { MethodName: "LabelNames", Handler: _Store_LabelNames_Handler, @@ -1331,95 +1151,6 @@ func (m *WriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -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 - } - return dAtA[:n], nil -} - -func (m *InfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -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 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] = 0x2a - } - } - if m.StoreType != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.StoreType)) - i-- - dAtA[i] = 0x20 - } - 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 - } - 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 = 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) @@ -2210,45 +1941,6 @@ func (m *WriteRequest) Size() (n int) { return n } -func (m *InfoRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *InfoResponse) 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 + sovRpc(uint64(l)) - } - } - if m.MinTime != 0 { - n += 1 + sovRpc(uint64(m.MinTime)) - } - if m.MaxTime != 0 { - n += 1 + sovRpc(uint64(m.MaxTime)) - } - if m.StoreType != 0 { - n += 1 + sovRpc(uint64(m.StoreType)) - } - if len(m.LabelSets) > 0 { - for _, e := range m.LabelSets { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - func (m *SeriesRequest) Size() (n int) { if m == nil { return 0 @@ -2778,231 +2470,6 @@ func (m *WriteRequest) Unmarshal(dAtA []byte) error { } return nil } -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 - } - } - - 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 - } - } - 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 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 - } - m.Labels = append(m.Labels, labelpb.Label{}) - if err := m.Labels[len(m.Labels)-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 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 - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StoreType", wireType) - } - m.StoreType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StoreType |= StoreType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - 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.LabelSet{}) - if err := m.LabelSets[len(m.LabelSets)-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 *SeriesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/pkg/store/storepb/rpc.proto b/pkg/store/storepb/rpc.proto index abceb59db6..2a6313ec02 100644 --- a/pkg/store/storepb/rpc.proto +++ b/pkg/store/storepb/rpc.proto @@ -7,7 +7,6 @@ package thanos; import "store/storepb/types.proto"; import "gogoproto/gogo.proto"; import "store/storepb/prompb/types.proto"; -import "store/labelpb/types.proto"; import "google/protobuf/any.proto"; option go_package = "storepb"; @@ -25,11 +24,6 @@ option (gogoproto.goproto_sizecache_all) = false; /// Store represents API against instance that stores XOR encoded values with label set metadata (e.g Prometheus metrics). service Store { - /// Info returns meta information about a store e.g labels that makes that store unique as well as time range that is - /// available. - /// Deprecated. Use `thanos.info` instead. - rpc Info(InfoRequest) returns (InfoResponse); - /// 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 @@ -63,32 +57,6 @@ message WriteRequest { int64 replica = 3; } -// Deprecated. Use `thanos.info` instead. -message InfoRequest {} - -// Deprecated. Use `thanos.info` instead. -enum StoreType { - UNKNOWN = 0; - QUERY = 1; - RULE = 2; - SIDECAR = 3; - STORE = 4; - RECEIVE = 5; - // DEBUG represents some debug StoreAPI components e.g. thanos tools store-api-serve. - DEBUG = 6; -} - -// Deprecated. Use `thanos.info` instead. -message InfoResponse { - // Deprecated. Use label_sets instead. - repeated Label labels = 1 [(gogoproto.nullable) = false]; - int64 min_time = 2; - int64 max_time = 3; - StoreType storeType = 4; - // label_sets is an unsorted list of `LabelSet`s. - repeated LabelSet label_sets = 5 [(gogoproto.nullable) = false]; -} - message SeriesRequest { int64 min_time = 1; int64 max_time = 2; diff --git a/pkg/store/tsdb.go b/pkg/store/tsdb.go index 197c02eb10..589c05fc5c 100644 --- a/pkg/store/tsdb.go +++ b/pkg/store/tsdb.go @@ -93,31 +93,6 @@ func (s *TSDBStore) getExtLset() labels.Labels { return s.extLset } -// Info returns store information about the Prometheus instance. -func (s *TSDBStore) Info(_ context.Context, _ *storepb.InfoRequest) (*storepb.InfoResponse, error) { - minTime, err := s.db.StartTime() - if err != nil { - return nil, errors.Wrap(err, "TSDB min Time") - } - - res := &storepb.InfoResponse{ - Labels: labelpb.PromLabelsToLabelpbLabels(s.getExtLset()), - StoreType: s.component.ToProto(), - MinTime: minTime, - MaxTime: math.MaxInt64, - } - - // Until we deprecate the single labels in the reply, we just duplicate - // them here for migration/compatibility purposes. - res.LabelSets = []labelpb.LabelSet{} - if len(res.Labels) > 0 { - res.LabelSets = append(res.LabelSets, labelpb.LabelSet{ - Labels: res.Labels, - }) - } - return res, nil -} - func (s *TSDBStore) LabelSet() []labelpb.LabelSet { labels := labelpb.PromLabelsToLabelpbLabels(s.getExtLset()) labelSets := []labelpb.LabelSet{} diff --git a/pkg/store/tsdb_test.go b/pkg/store/tsdb_test.go index b556ec631b..784e4cf04a 100644 --- a/pkg/store/tsdb_test.go +++ b/pkg/store/tsdb_test.go @@ -29,40 +29,6 @@ import ( const skipMessage = "Chunk behavior changed due to https://github.com/prometheus/prometheus/pull/8723. Skip for now." -func TestTSDBStore_Info(t *testing.T) { - defer custom.TolerantVerifyLeak(t) - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - db, err := e2eutil.NewTSDB() - defer func() { testutil.Ok(t, db.Close()) }() - testutil.Ok(t, err) - - tsdbStore := NewTSDBStore(nil, db, component.Rule, labels.FromStrings("region", "eu-west")) - - resp, err := tsdbStore.Info(ctx, &storepb.InfoRequest{}) - testutil.Ok(t, err) - - testutil.Equals(t, []labelpb.Label{{Name: "region", Value: "eu-west"}}, resp.Labels) - testutil.Equals(t, storepb.StoreType_RULE, resp.StoreType) - testutil.Equals(t, int64(math.MaxInt64), resp.MinTime) - testutil.Equals(t, int64(math.MaxInt64), resp.MaxTime) - - app := db.Appender(context.Background()) - _, err = app.Append(0, labels.FromStrings("a", "a"), 12, 0.1) - testutil.Ok(t, err) - testutil.Ok(t, app.Commit()) - - resp, err = tsdbStore.Info(ctx, &storepb.InfoRequest{}) - testutil.Ok(t, err) - - testutil.Equals(t, []labelpb.Label{{Name: "region", Value: "eu-west"}}, resp.Labels) - testutil.Equals(t, storepb.StoreType_RULE, resp.StoreType) - testutil.Equals(t, int64(12), resp.MinTime) - testutil.Equals(t, int64(math.MaxInt64), resp.MaxTime) -} - func TestTSDBStore_Series_ChunkChecksum(t *testing.T) { defer custom.TolerantVerifyLeak(t) diff --git a/pkg/tenancy/tenancy_test.go b/pkg/tenancy/tenancy_test.go index ca41793346..4418fa36e4 100644 --- a/pkg/tenancy/tenancy_test.go +++ b/pkg/tenancy/tenancy_test.go @@ -15,9 +15,7 @@ import ( "github.com/thanos-io/thanos/pkg/store/storepb" "github.com/thanos-io/thanos/pkg/tenancy" "google.golang.org/grpc" - "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" storetestutil "github.com/thanos-io/thanos/pkg/store/storepb/testutil" ) @@ -61,10 +59,6 @@ func getAndAssertTenant(ctx context.Context, t *testing.T) { testutil.Assert(t, tenant == testTenant) } -func (s *mockedStoreAPI) Info(context.Context, *storepb.InfoRequest, ...grpc.CallOption) (*storepb.InfoResponse, error) { - return nil, status.Error(codes.Unimplemented, "not implemented") -} - func (s *mockedStoreAPI) Series(ctx context.Context, req *storepb.SeriesRequest, _ ...grpc.CallOption) (storepb.Store_SeriesClient, error) { getAndAssertTenant(ctx, s.t) diff --git a/test/e2e/query_test.go b/test/e2e/query_test.go index cc9f34a7b0..0284bee160 100644 --- a/test/e2e/query_test.go +++ b/test/e2e/query_test.go @@ -592,199 +592,6 @@ func TestQueryWithAuthorizedSidecar(t *testing.T) { }) } -func TestQueryCompatibilityWithPreInfoAPI(t *testing.T) { - t.Parallel() - if runtime.GOARCH != "amd64" { - t.Skip("Skip pre-info API test because of lack of multi-arch image for Thanos v0.22.0.") - } - - for i, tcase := range []struct { - queryImage string - sidecarImage string - }{ - { - queryImage: e2ethanos.DefaultImage(), - sidecarImage: "quay.io/thanos/thanos:v0.22.0", // Thanos components from version before 0.23 does not have new InfoAPI. - }, - { - queryImage: "quay.io/thanos/thanos:v0.22.0", // Thanos querier from version before 0.23 did not know about InfoAPI. - sidecarImage: e2ethanos.DefaultImage(), - }, - } { - i := i - t.Run(fmt.Sprintf("%+v", tcase), func(t *testing.T) { - e, err := e2e.NewDockerEnvironment(fmt.Sprintf("query-comp-%d", i)) - testutil.Ok(t, err) - t.Cleanup(e2ethanos.CleanScenario(t, e)) - - qBuilder := e2ethanos.NewQuerierBuilder(e, "1") - - // Use qBuilder work dir to share rules. - promRulesSubDir := "rules" - testutil.Ok(t, os.MkdirAll(filepath.Join(qBuilder.Dir(), promRulesSubDir), os.ModePerm)) - // Create the abort_on_partial_response alert for Prometheus. - // We don't create the warn_on_partial_response alert as Prometheus has strict yaml unmarshalling. - createRuleFile(t, filepath.Join(qBuilder.Dir(), promRulesSubDir, "rules.yaml"), testAlertRuleAbortOnPartialResponse) - - p1, s1 := e2ethanos.NewPrometheusWithSidecarCustomImage( - e, - "p1", - e2ethanos.DefaultPromConfig("p1", 0, "", filepath.Join(qBuilder.InternalDir(), promRulesSubDir, "*.yaml"), e2ethanos.LocalPrometheusTarget, qBuilder.InternalEndpoint("http")), - "", - e2ethanos.DefaultPrometheusImage(), - "", - tcase.sidecarImage, - e2ethanos.FeatureExemplarStorage, - ) - testutil.Ok(t, e2e.StartAndWaitReady(p1, s1)) - - // Newest querier with old --rules --meta etc flags. - q := qBuilder. - WithStoreAddresses(s1.InternalEndpoint("grpc")). - WithMetadataAddresses(s1.InternalEndpoint("grpc")). - WithExemplarAddresses(s1.InternalEndpoint("grpc")). - WithTargetAddresses(s1.InternalEndpoint("grpc")). - WithRuleAddresses(s1.InternalEndpoint("grpc")). - WithTracingConfig(fmt.Sprintf(`type: JAEGER -config: - sampler_type: const - sampler_param: 1 - service_name: %s`, qBuilder.Name())). // Use fake tracing config to trigger exemplar. - WithImage(tcase.queryImage). - Init() - testutil.Ok(t, e2e.StartAndWaitReady(q)) - - ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute) - t.Cleanup(cancel) - - // We should have single TCP connection, since all APIs are against the same server. - testutil.Ok(t, q.WaitSumMetricsWithOptions(e2emon.Equals(1), []string{"thanos_store_nodes_grpc_connections"}, e2emon.WaitMissingMetrics())) - - queryAndAssertSeries(t, ctx, q.Endpoint("http"), e2ethanos.QueryUpWithoutInstance, time.Now, promclient.QueryOptions{ - Deduplicate: false, - }, []model.Metric{ - { - "job": "myself", - "prometheus": "p1", - "replica": "0", - }, - }) - - // We expect rule and other APIs to work. - - // Metadata. - { - var promMeta map[string][]metadatapb.Meta - // Wait metadata response to be ready as Prometheus gets metadata after scrape. - testutil.Ok(t, runutil.Retry(3*time.Second, ctx.Done(), func() error { - promMeta, err = promclient.NewDefaultClient().MetricMetadataInGRPC(ctx, urlParse(t, "http://"+p1.Endpoint("http")), "", -1) - testutil.Ok(t, err) - if len(promMeta) > 0 { - return nil - } - return fmt.Errorf("empty metadata response from Prometheus") - })) - - thanosMeta, err := promclient.NewDefaultClient().MetricMetadataInGRPC(ctx, urlParse(t, "http://"+q.Endpoint("http")), "", -1) - testutil.Ok(t, err) - testutil.Assert(t, len(thanosMeta) > 0, "got empty metadata response from Thanos") - - // Metadata response from Prometheus and Thanos Querier should be the same after deduplication. - metadataEqual(t, thanosMeta, promMeta) - } - - // Exemplars. - { - now := time.Now() - start := timestamp.FromTime(now.Add(-time.Hour)) - end := timestamp.FromTime(now.Add(time.Hour)) - - // Send HTTP requests to thanos query to trigger exemplars. - labelNames(t, ctx, q.Endpoint("http"), nil, start, end, 0, func(res []string) bool { - return true - }) - - queryExemplars(t, ctx, q.Endpoint("http"), `http_request_duration_seconds_bucket{handler="label_names"}`, start, end, exemplarsOnExpectedSeries(map[string]string{ - "__name__": "http_request_duration_seconds_bucket", - "handler": "label_names", - "job": "myself", - "method": "get", - "prometheus": "p1", - })) - } - - // Targets. - { - targetAndAssert(t, ctx, q.Endpoint("http"), "", &targetspb.TargetDiscovery{ - ActiveTargets: []*targetspb.ActiveTarget{ - { - DiscoveredLabels: labelpb.LabelSet{Labels: []labelpb.Label{ - {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: "p1"}, - }}, - Labels: labelpb.LabelSet{Labels: []labelpb.Label{ - {Name: "instance", Value: "localhost:9090"}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "p1"}, - }}, - ScrapePool: "myself", - ScrapeUrl: "http://localhost:9090/metrics", - Health: targetspb.TargetHealth_UP, - }, - { - DiscoveredLabels: labelpb.LabelSet{Labels: []labelpb.Label{ - {Name: "__address__", Value: fmt.Sprintf("query-comp-%d-querier-1:8080", i)}, - {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: "p1"}, - }}, - Labels: labelpb.LabelSet{Labels: []labelpb.Label{ - {Name: "instance", Value: fmt.Sprintf("query-comp-%d-querier-1:8080", i)}, - {Name: "job", Value: "myself"}, - {Name: "prometheus", Value: "p1"}, - }}, - ScrapePool: "myself", - ScrapeUrl: fmt.Sprintf("http://query-comp-%d-querier-1:8080/metrics", i), - Health: targetspb.TargetHealth_UP, - }, - }, - DroppedTargets: []*targetspb.DroppedTarget{}, - }) - } - - // Rules. - { - ruleAndAssert(t, ctx, q.Endpoint("http"), "", []*rulespb.RuleGroup{ - { - Name: "example_abort", - 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.LabelSet{Labels: []labelpb.Label{ - {Name: "prometheus", Value: "p1"}, - {Name: "severity", Value: "page"}, - }}, - Health: string(rules.HealthGood), - }), - }, - }, - }) - } - }) - } -} - type fakeMetricSample struct { label string value int64