query

package
v0.20.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2021 License: Apache-2.0 Imports: 45 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInProcessClient added in v0.19.0

func NewInProcessClient(t testing.TB, name string, client storepb.StoreClient, extLset labels.Labels) store.Client

func ParseEval added in v0.18.0

func ParseEval(lines []string, i int) (int, *evalCmd, error)

ParseEval parses eval statements.

func ParseLoad added in v0.18.0

func ParseLoad(lines []string, i int) (int, *loadCmd, error)

ParseLoad parses load statements.

func ParseStore added in v0.18.0

func ParseStore(lines []string, i int) (int, *storeCmd, error)

ParseStore parses store statements.

Types

type Config added in v0.11.0

type Config struct {
	HTTPClientConfig http_util.ClientConfig    `yaml:"http_config"`
	EndpointsConfig  http_util.EndpointsConfig `yaml:",inline"`
}

func BuildQueryConfig added in v0.12.0

func BuildQueryConfig(queryAddrs []string) ([]Config, error)

BuildQueryConfig returns a query client configuration from a static address.

func DefaultConfig added in v0.11.0

func DefaultConfig() Config

func LoadConfigs added in v0.11.0

func LoadConfigs(confYAML []byte) ([]Config, error)

LoadConfigs loads a list of Config from YAML data.

func (*Config) UnmarshalYAML added in v0.11.0

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type ExemplarSpec added in v0.20.0

type ExemplarSpec interface {
	// Addr returns ExemplarsAPI Address for the exemplars spec. It is used as its ID.
	Addr() string
}

type MetadataSpec added in v0.19.0

type MetadataSpec interface {
	// Addr returns MetadataAPI Address for the metadata spec. It is used as its ID.
	Addr() string
}

type QueryableCreator

type QueryableCreator func(deduplicate bool, replicaLabels []string, storeDebugMatchers [][]*labels.Matcher, maxResolutionMillis int64, partialResponse, skipChunks bool) storage.Queryable

QueryableCreator returns implementation of promql.Queryable that fetches data from the proxy store API endpoints. If deduplication is enabled, all data retrieved from it will be deduplicated along all replicaLabels by default. When the replicaLabels argument is not empty it overwrites the global replicaLabels flag. This allows specifying replicaLabels at query time. maxResolutionMillis controls downsampling resolution that is allowed (specified in milliseconds). partialResponse controls `partialResponseDisabled` option of StoreAPI and partial response behavior of proxy.

func NewQueryableCreator

func NewQueryableCreator(logger log.Logger, reg prometheus.Registerer, proxy storepb.StoreServer, maxConcurrentSelects int, selectTimeout time.Duration) QueryableCreator

NewQueryableCreator creates QueryableCreator.

type RuleSpec added in v0.14.0

type RuleSpec interface {
	// Addr returns RulesAPI Address for the rules spec. It is used as its ID.
	Addr() string
}

type StoreSet

type StoreSet struct {
	// contains filtered or unexported fields
}

StoreSet maintains a set of active stores. It is backed up by Store Specifications that are dynamically fetched on every Update() call.

func NewStoreSet

func NewStoreSet(
	logger log.Logger,
	reg *prometheus.Registry,
	storeSpecs func() []StoreSpec,
	ruleSpecs func() []RuleSpec,
	targetSpecs func() []TargetSpec,
	metadataSpecs func() []MetadataSpec,
	exemplarSpecs func() []ExemplarSpec,
	dialOpts []grpc.DialOption,
	unhealthyStoreTimeout time.Duration,
) *StoreSet

NewStoreSet returns a new set of store APIs and potentially Rules APIs from given specs.

func (*StoreSet) Close

func (s *StoreSet) Close()

func (*StoreSet) Get

func (s *StoreSet) Get() []store.Client

Get returns a list of all active stores.

func (*StoreSet) GetExemplarsStores added in v0.20.1

func (s *StoreSet) GetExemplarsStores() []*exemplarspb.ExemplarStore

GetExemplarsStores returns a list of all active exemplars stores.

func (*StoreSet) GetMetadataClients added in v0.19.0

func (s *StoreSet) GetMetadataClients() []metadatapb.MetadataClient

GetMetadataClients returns a list of all active metadata clients.

func (*StoreSet) GetRulesClients added in v0.14.0

func (s *StoreSet) GetRulesClients() []rulespb.RulesClient

GetRulesClients returns a list of all active rules clients.

func (*StoreSet) GetStoreStatus added in v0.2.1

func (s *StoreSet) GetStoreStatus() []StoreStatus

func (*StoreSet) GetTargetsClients added in v0.20.0

func (s *StoreSet) GetTargetsClients() []targetspb.TargetsClient

GetTargetsClients returns a list of all active targets clients.

func (*StoreSet) Update

func (s *StoreSet) Update(ctx context.Context)

Update updates the store set. It fetches current list of store specs from function and updates the fresh metadata from all stores. Keeps around statically defined nodes that were defined with the strict mode.

type StoreSpec

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, storeType component.StoreAPI, err error)

	// StrictStatic returns true if the StoreAPI has been statically defined and it is under a strict mode.
	StrictStatic() bool
}

func NewGRPCStoreSpec

func NewGRPCStoreSpec(addr string, strictstatic bool) StoreSpec

NewGRPCStoreSpec creates store pure gRPC spec. It uses Info gRPC call to get Metadata.

type StoreStatus added in v0.2.1

type StoreStatus struct {
	Name      string             `json:"name"`
	LastCheck time.Time          `json:"lastCheck"`
	LastError *stringError       `json:"lastError"`
	LabelSets []labels.Labels    `json:"labelSets"`
	StoreType component.StoreAPI `json:"-"`
	MinTime   int64              `json:"minTime"`
	MaxTime   int64              `json:"maxTime"`
}

type TargetSpec added in v0.20.0

type TargetSpec interface {
	// Addr returns TargetsAPI Address for the targets spec. It is used as its ID.
	Addr() string
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL