tenantfederation

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMergeQueryable added in v1.10.0

func NewMergeQueryable(idLabelName string, callback MergeQuerierCallback, byPassWithSingleQuerier bool) storage.Queryable

NewMergeQueryable returns a queryable that merges results from multiple underlying Queryables. The underlying queryables and its label values to be considered are returned by a MergeQuerierCallback. By setting byPassWithSingleQuerier to true the mergeQuerier gets by-passed and results for request with a single querier will not contain the id label. This allows a smoother transition, when enabling tenant federation in a cluster. Results contain a label `idLabelName` to identify the underlying queryable that it originally resulted from. If the label `idLabelName` is already existing, its value is overwritten and the previous value is exposed through a new label prefixed with "original_". This behaviour is not implemented recursively.

func NewQueryable

func NewQueryable(upstream storage.Queryable, byPassWithSingleQuerier bool) storage.Queryable

NewQueryable returns a queryable that iterates through all the tenant IDs that are part of the request and aggregates the results from each tenant's Querier by sending of subsequent requests. By setting byPassWithSingleQuerier to true the mergeQuerier gets by-passed and results for request with a single querier will not contain the "__tenant_id__" label. This allows a smoother transition, when enabling tenant federation in a cluster. The result contains a label "__tenant_id__" to identify the tenant ID that it originally resulted from. If the label "__tenant_id__" is already existing, its value is overwritten by the tenant ID and the previous value is exposed through a new label prefixed with "original_". This behaviour is not implemented recursively.

Types

type Config

type Config struct {
	// Enabled switches on support for multi tenant query federation
	Enabled bool `yaml:"enabled"`
}

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

type MergeQuerierCallback added in v1.10.0

type MergeQuerierCallback func(ctx context.Context, mint int64, maxt int64) (ids []string, queriers []storage.Querier, err error)

MergeQuerierCallback returns the underlying queriers and their IDs relevant for the query.

Jump to

Keyboard shortcuts

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