Help us shape the future of Go! Take the 2026 Go Developer Survey

proxystorage

package
v0.0.97 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 40 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProxyStorage

type ProxyStorage struct {
	NoStepSubqueryIntervalFn func(rangeMillis int64) int64
	// contains filtered or unexported fields
}

ProxyStorage implements prometheus' Storage interface

func NewProxyStorage

func NewProxyStorage(NoStepSubqueryIntervalFn func(rangeMillis int64) int64, localStoragePath string) (*ProxyStorage, error)

NewProxyStorage creates a new ProxyStorage. If localStoragePath is non-empty, it is used as the base directory for the remote_write WAL (durable across restarts); otherwise a temporary directory is created per remote_write configuration and removed on shutdown.

func (*ProxyStorage) Appender

func (p *ProxyStorage) Appender(ctx context.Context) storage.Appender

Appender returns a new appender against the storage. When remote_write is configured this is backed by the agent WAL (single-use, pooled appender), so a fresh appender is returned on every call rather than a shared instance.

func (*ProxyStorage) ApplyConfig

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

ApplyConfig updates the current state of this ProxyStorage

func (*ProxyStorage) ChunkQuerier added in v0.0.63

func (p *ProxyStorage) ChunkQuerier(mint, maxt int64) (storage.ChunkQuerier, error)

ChunkQuerier returns a new ChunkQuerier on the storage. Promxy has no native chunk source, so this reuses the sample-based querier and re-encodes the result into chunks (see proxyquerier.ProxyChunkQuerier). It backs promxy's own remote_read endpoint for the STREAMED_XOR_CHUNKS response type that a stock Prometheus remote_read client negotiates by default.

func (*ProxyStorage) CleanTombstones added in v0.0.68

func (p *ProxyStorage) CleanTombstones() (err error)

Implement web.LocalStorage

func (*ProxyStorage) Close

func (p *ProxyStorage) Close() error

Close releases the resources of the Querier.

func (*ProxyStorage) ConfigHandler added in v0.0.76

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

ConfigHandler is an implementation of the config handler within the prometheus API

func (*ProxyStorage) Delete added in v0.0.68

func (p *ProxyStorage) Delete(_ context.Context, mint, maxt int64, ms ...*labels.Matcher) error

func (*ProxyStorage) ExemplarQuerier added in v0.0.75

func (p *ProxyStorage) ExemplarQuerier(ctx context.Context) (storage.ExemplarQuerier, error)

ExemplarQuerier returns a new ExemplarQuerier on the storage.

func (*ProxyStorage) GetState

func (p *ProxyStorage) GetState() *proxyStorageState

GetState returns the current state of the ProxyStorage

func (*ProxyStorage) MetadataHandler added in v0.0.76

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

MetadataHandler is an implementation of the metadata handler within the prometheus API

func (*ProxyStorage) NodeReplacer

func (p *ProxyStorage) NodeReplacer(ctx context.Context, s *parser.EvalStmt, node parser.Node, path []parser.Node) (parser.Node, error)

NodeReplacer 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) Querier

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

Querier returns a new Querier on the storage.

func (*ProxyStorage) Snapshot added in v0.0.68

func (p *ProxyStorage) Snapshot(dir string, withHead bool) error

func (*ProxyStorage) StartTime

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

StartTime returns the oldest timestamp stored in the storage.

func (*ProxyStorage) Stats added in v0.0.68

func (p *ProxyStorage) Stats(statsByLabelName string, _ int) (*tsdb.Stats, error)

func (*ProxyStorage) WALReplayStatus added in v0.0.73

func (p *ProxyStorage) WALReplayStatus() (tsdb.WALReplayStatus, error)

Jump to

Keyboard shortcuts

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