read_path

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

func Query[Req, Resp any](
	ctx context.Context,
	router *Router,
	req *connect.Request[Req],
	sanitize func(a, b *Req),
	aggregate func(a, b *Resp) (*Resp, error),
) (*connect.Response[Resp], error)

Query routes a query to the appropriate query frontend. Before the call to the frontend is made, the requests are sanitized: any of the arguments can be nil, but not both. If the query was split, the responses are aggregated.

Types

type Config

type Config struct {
	EnableQueryBackend     bool      `yaml:"enable_query_backend" json:"enable_query_backend" doc:"hidden"`
	EnableQueryBackendFrom time.Time `yaml:"enable_query_backend_from" json:"enable_query_backend_from" doc:"hidden"`
}

func (*Config) RegisterFlags

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

type Overrides

type Overrides interface {
	ReadPathOverrides(tenantID string) Config
}

type Router

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

Router is a proxy that routes queries to the query frontend.

If the query backend is enabled, it routes queries to the new query frontend, otherwise it routes queries to the old query frontend.

If the query targets a time range that spans the enablement of the new query backend, it splits the query into two parts and sends them to the old and new query frontends.

func NewRouter

func NewRouter(
	logger log.Logger,
	overrides Overrides,
	oldFrontend querierv1connect.QuerierServiceClient,
	newFrontend querierv1connect.QuerierServiceClient,
) *Router

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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