api

package
v0.0.0-...-4e111a7 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RemoteEndpoints

type RemoteEndpoints interface {
	// Engines returns remote engines.
	//
	// If mint and/or maxt of the query is unknown, the caller must pass
	// math.MinInt64 and math.MaxInt64 respectively to retrieve unpruned engines.
	Engines(mint, maxt int64) []RemoteEngine
}

RemoteEndpoints returns remote engines.

Implementations should use mint and maxt to prune engine metadata (e.g., filter TSDBInfos to only those overlapping the time range), reducing unnecessary computations in subsequent calls to methods like RemoteEngine.LabelSets().

All available engines should be returned regardless of pruning.

func NewCachedEndpoints

func NewCachedEndpoints(endpoints RemoteEndpoints) RemoteEndpoints

NewCachedEndpoints returns an endpoints wrapper that resolves and caches engines on first access.

All subsequent Engines calls return cached engines, ignoring any query parameters.

func NewStaticEndpoints

func NewStaticEndpoints(engines []RemoteEngine) RemoteEndpoints

type RemoteEngine

type RemoteEngine interface {
	MaxT() int64
	MinT() int64

	// The external labels of the remote engine. These are used to limit fanout. The engine uses these to
	// not distribute into remote engines that would return empty responses because their labelset is not matching.
	LabelSets() []labels.Labels

	// The external labels of the remote engine that form a logical partition. This is expected to be
	// a subset of the result of "LabelSets()". The engine uses these to compute how to distribute a query.
	// It is important that, for a given set of remote engines, these labels do not overlap meaningfully.
	PartitionLabelSets() []labels.Labels

	NewRangeQuery(ctx context.Context, opts promql.QueryOpts, plan RemoteQuery, start, end time.Time, interval time.Duration) (promql.Query, error)
}

type RemoteQuery

type RemoteQuery interface {
	fmt.Stringer
}

Jump to

Keyboard shortcuts

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