frontend

package
v0.0.0-...-2ecc15d Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitFrontend

func InitFrontend(
	cfg CombinedFrontendConfig,
	v1Limits v1.Limits,
	v2Limits v2.Limits,
	grpcListenPort int,
	log log.Logger,
	reg prometheus.Registerer,
	codec querymiddleware.Codec,
) (http.RoundTripper, *v1.Frontend, *v2.Frontend, error)

InitFrontend initializes frontend (either V1 -- without scheduler, or V2 -- with scheduler) or no frontend at all if downstream Prometheus URL is used instead.

Returned RoundTripper can be wrapped in more round-tripper middlewares, and then eventually registered into HTTP server using the Handler from this package. Returned RoundTripper is always non-nil (if there are no errors), and it uses the returned frontend (if any).

func NewDownstreamRoundTripper

func NewDownstreamRoundTripper(downstreamURL string) (http.RoundTripper, error)

Types

type CombinedFrontendConfig

type CombinedFrontendConfig struct {
	Handler    transport.HandlerConfig `yaml:",inline"`
	FrontendV1 v1.Config               `yaml:",inline"`
	FrontendV2 v2.Config               `yaml:",inline"`

	QueryMiddleware querymiddleware.Config `yaml:",inline"`

	DownstreamURL string `yaml:"downstream_url" category:"advanced"`
}

CombinedFrontendConfig combines several configuration options together to preserve backwards compatibility.

func (*CombinedFrontendConfig) RegisterFlags

func (cfg *CombinedFrontendConfig) RegisterFlags(f *flag.FlagSet, logger log.Logger)

func (*CombinedFrontendConfig) Validate

func (cfg *CombinedFrontendConfig) Validate() error

Directories

Path Synopsis
v1
v2

Jump to

Keyboard shortcuts

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