proxystorage

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2018 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BooleanFinder

type BooleanFinder struct {
	Func  func(promql.Node) bool
	Found bool
}

Use given func to determine if something is in there or notret := &promql.VectorSelector{Offset: offset}

func (*BooleanFinder) Visit

func (f *BooleanFinder) Visit(node promql.Node, _ []promql.Node) (w promql.Visitor)

type OffsetFinder

type OffsetFinder struct {
	Found  bool
	Offset time.Duration
	Error  error
}

func (*OffsetFinder) Visit

func (o *OffsetFinder) Visit(node promql.Node, _ []promql.Node) (w promql.Visitor)

type OffsetRemover

type OffsetRemover struct{}

When we send the queries below, we want to actually *remove* the offset.

func (*OffsetRemover) Visit

func (o *OffsetRemover) Visit(node promql.Node, _ []promql.Node) (w promql.Visitor)

type ProxyStorage

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

TODO: rename?

func NewProxyStorage

func NewProxyStorage() (*ProxyStorage, error)

func (*ProxyStorage) Appender added in v0.0.2

func (p *ProxyStorage) Appender() (storage.Appender, error)

func (*ProxyStorage) ApplyConfig

func (p *ProxyStorage) ApplyConfig(c *proxyconfig.Config) error

func (*ProxyStorage) Close added in v0.0.2

func (p *ProxyStorage) Close() error

TODO: actually close things?

func (*ProxyStorage) GetState

func (p *ProxyStorage) GetState() *proxyStorageState

func (*ProxyStorage) NodeReplacer

func (p *ProxyStorage) NodeReplacer(ctx context.Context, s *promql.EvalStmt, node promql.Node) (promql.Node, error)

This replaces promql Nodes with more efficient-to-fetch ones. This works by taking lower-layer chunks of the query, farming them out to prometheus hosts, then stitching the results back together. An example would be a sum, we can sum multiple sums and come up with the same result -- so we do. There are a few ground rules for this:

  • Children cannot be AggregateExpr: aggregates have their own combining logic, so its not safe to send a subquery with additional aggregations
  • offsets within the subtree must match: if they don't then we'll get mismatched data, so we wait until we are far enough down the tree that they converge
  • Don't reduce accuracy/granularity: the intention of this is to get the correct data faster, meaning correctness overrules speed.

func (*ProxyStorage) ProxyHandler

func (p *ProxyStorage) ProxyHandler(w http.ResponseWriter, r *http.Request)

Handler to proxy requests to *a* server in serverGroups

func (*ProxyStorage) Querier

func (p *ProxyStorage) Querier(ctx context.Context, mint, maxt int64) (storage.Querier, error)

func (*ProxyStorage) StartTime added in v0.0.2

func (p *ProxyStorage) StartTime() (int64, error)

Jump to

Keyboard shortcuts

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