tenantfederation

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExemplarQueryable added in v1.19.0

func NewExemplarQueryable(upstream storage.ExemplarQueryable, maxConcurrent int, byPassWithSingleQuerier bool, reg prometheus.Registerer) storage.ExemplarQueryable

NewExemplarQueryable returns a exemplarQueryable that iterates through all the tenant IDs that are part of the request and aggregates the results from each tenant's ExemplarQuerier by sending of subsequent requests. By setting byPassWithSingleQuerier to true the mergeExemplarQuerier gets by-passed and results for request with a single exemplar 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.

func NewMergeExemplarQueryable added in v1.19.0

func NewMergeExemplarQueryable(idLabelName string, maxConcurrent int, callback MergeExemplarQuerierCallback, byPassWithSingleQuerier bool, reg prometheus.Registerer) storage.ExemplarQueryable

NewMergeExemplarQueryable returns a queryable that merges results from multiple underlying ExemplarQueryables. By setting byPassWithSingleQuerier to true the mergeExemplarQuerier gets by-passed and results for request with a single exemplar querier will not contain the "__tenant_id__" label. This allows a smoother transition, when enabling tenant federation in a cluster. Results contain a label `idLabelName` to identify the underlying exemplar 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 NewMergeQueryable added in v1.10.0

func NewMergeQueryable(idLabelName string, maxConcurrent int, callback MergeQuerierCallback, byPassWithSingleQuerier bool, reg prometheus.Registerer) 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 NewMetadataQuerier added in v1.19.0

func NewMetadataQuerier(upstream querier.MetadataQuerier, maxConcurrent int, reg prometheus.Registerer) querier.MetadataQuerier

NewMetadataQuerier returns a MetadataQuerier that merges metric metadata for multiple tenants.

func NewQueryable

func NewQueryable(upstream storage.Queryable, maxConcurrent int, byPassWithSingleQuerier bool, reg prometheus.Registerer) 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"`
	// MaxConcurrent The number of workers used for processing federated query.
	MaxConcurrent int `yaml:"max_concurrent"`
	// MaxTenant A maximum number of tenants to query at once.
	MaxTenant int `yaml:"max_tenant"`
}

func (*Config) RegisterFlags

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

type MergeExemplarQuerierCallback added in v1.19.0

type MergeExemplarQuerierCallback func(ctx context.Context) (ids []string, queriers []storage.ExemplarQuerier, err error)

MergeExemplarQuerierCallback returns the underlying exemplar queriers and their IDs relevant for the query.

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