writepath

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IngesterPath specifies old write path the requests are sent to ingester.
	IngesterPath WritePath = "ingester"
	// SegmentWriterPath specifies the new write path: distributor sends
	// the request to segment writers before profile split, using the new
	// distribution algorithm and the segment-writer ring.
	SegmentWriterPath = "segment-writer"
	// CombinedPath specifies that each request should be sent to both write
	// paths. For each request we decide on how a failure is handled:
	//  * If the request is sent to ingester (regardless of anything),
	//    the response is returned to the client immediately after the old
	//    write path returns. Failure of the new write path should be logged
	//    and counted in metrics but NOT returned to the client.
	//  * If the request is sent to segment-writer exclusively: the response
	//    returns to the client only when the new write path returns.
	//    Failure of the new write is returned to the client.
	//    Failure of the old write path is NOT returned to the client.
	CombinedPath = "combined"
)

Variables

View Source
var ErrInvalidWritePath = errors.New("invalid write path")

Functions

This section is empty.

Types

type Config

type Config struct {
	WritePath           WritePath `yaml:"write_path" json:"write_path" doc:"hidden"`
	IngesterWeight      float64   `yaml:"write_path_ingester_weight" json:"write_path_ingester_weight" doc:"hidden"`
	SegmentWriterWeight float64   `yaml:"write_path_segment_writer_weight" json:"write_path_segment_writer_weight" doc:"hidden"`
}

func (*Config) RegisterFlags

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

type IngesterClient

type IngesterClient interface {
	Push(context.Context, *distributormodel.PushRequest) (*connect.Response[pushv1.PushResponse], error)
}

type Overrides

type Overrides interface {
	WritePathOverrides(tenantID string) Config
}

type Router

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

func NewRouter

func NewRouter(
	logger log.Logger,
	registerer prometheus.Registerer,
	overrides Overrides,
	ingester IngesterClient,
	segwriter SegmentWriterClient,
) *Router

func (*Router) Send

func (*Router) Service

func (m *Router) Service() services.Service

type SegmentWriterClient

type SegmentWriterClient interface {
	Push(context.Context, *segmentwriterv1.PushRequest) (*segmentwriterv1.PushResponse, error)
}

type WritePath

type WritePath string

WritePath controls the write path.

func (*WritePath) Set

func (m *WritePath) Set(text string) error

func (*WritePath) String

func (m *WritePath) String() string

Jump to

Keyboard shortcuts

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