query

package
v0.23.2-rc.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: Apache-2.0 Imports: 48 Imported by: 6

Documentation

Index

Constants

View Source
const (

	// Default minimum and maximum time values used by Prometheus when they are not passed as query parameter.
	MinTime = -9223309901257974
	MaxTime = 9223309901257974
)

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 EndpointSet added in v0.23.0

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

EndpointSet maintains a set of active Thanos endpoints. It is backed up by Endpoint Specifications that are dynamically fetched on every Update() call.

func NewEndpointSet added in v0.23.0

func NewEndpointSet(
	logger log.Logger,
	reg *prometheus.Registry,
	endpointSpecs func() []EndpointSpec,
	dialOpts []grpc.DialOption,
	unhealthyEndpointTimeout time.Duration,
) *EndpointSet

NewEndpointSet returns a new set of Thanos APIs.

func (*EndpointSet) Close added in v0.23.0

func (e *EndpointSet) Close()

func (*EndpointSet) GetEndpointStatus added in v0.23.0

func (e *EndpointSet) GetEndpointStatus() []EndpointStatus

func (*EndpointSet) GetExemplarsStores added in v0.23.0

func (e *EndpointSet) GetExemplarsStores() []*exemplarspb.ExemplarStore

GetExemplarsStores returns a list of all active exemplars stores.

func (*EndpointSet) GetMetricMetadataClients added in v0.23.0

func (e *EndpointSet) GetMetricMetadataClients() []metadatapb.MetadataClient

GetMetricMetadataClients returns a list of all active metadata clients.

func (*EndpointSet) GetRulesClients added in v0.23.0

func (e *EndpointSet) GetRulesClients() []rulespb.RulesClient

GetRulesClients returns a list of all active rules clients.

func (*EndpointSet) GetStoreClients added in v0.23.0

func (e *EndpointSet) GetStoreClients() []store.Client

GetStoreClients returns a list of all active stores.

func (*EndpointSet) GetTargetsClients added in v0.23.0

func (e *EndpointSet) GetTargetsClients() []targetspb.TargetsClient

GetTargetsClients returns a list of all active targets clients.

func (*EndpointSet) Update added in v0.23.0

func (e *EndpointSet) Update(ctx context.Context)

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

type EndpointSpec added in v0.23.0

type EndpointSpec interface {
	// Addr returns Thanos API Address for the endpoint spec. It is used as ID for endpoint.
	Addr() string
	// Metadata returns current labels, component 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 *endpointClients) (*endpointMetadata, error)

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

func NewGRPCEndpointSpec added in v0.23.0

func NewGRPCEndpointSpec(addr string, isStrictStatic bool) EndpointSpec

NewGRPCEndpointSpec creates gRPC endpoint spec. It uses InfoAPI to get Metadata.

type EndpointStatus added in v0.23.0

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

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.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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