proxyconfig

package
v0.0.96 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

View Source
const DefaultMaxSamplesPerSend = 100

DefaultMaxSamplesPerSend is promxy's default remote_write batch size when the user does not set queue_config.max_samples_per_send explicitly.

Upstream Prometheus defaults this to 2000. promxy historically (in its old vendored remote_write fork) used 100, and shipping recording-rule output with large/high-cardinality series in 2000-sample batches can decompress to more than the 32 MiB snappy limit that Prometheus 3.5.3+ enforces on the remote-write receiver (GHSA-8rm2-7qqf-34qm). When that happens the receiver rejects the request with "snappy: decoded length N exceeds limit 33554432" and the queue manager drops the batch. Restoring the historical default keeps promxy's requests comfortably under that limit. See issue #781.

Variables

View Source
var DefaultPromxyConfig = PromxyConfig{}

DefaultPromxyConfig is the default promxy config that the config file is loaded into

Functions

This section is empty.

Types

type ApplyConfigFunc

type ApplyConfigFunc struct {
	F func(*config.Config) error
}

ApplyConfigFunc is a struct that wraps a single function that Applys config into something that implements the `PromReloadable` interface

func (*ApplyConfigFunc) ApplyConfig

func (a *ApplyConfigFunc) ApplyConfig(cfg *config.Config) error

ApplyConfig applies new configuration

type Config

type Config struct {
	// Prometheus configs -- this includes configurations for
	// recording rules, alerting rules, etc.
	PromConfig config.Config `yaml:",inline"`

	// Promxy specific configuration -- under its own namespace
	PromxyConfig `yaml:"promxy"`

	WebConfig web.TLSConfig `yaml:"tls_server_config"`
}

Config is the entire config file. This includes both the Prometheus Config as well as the Promxy config. This is done by "inline-ing" the promxy config into the prometheus config under the "promxy" key

func ConfigFromBytes added in v0.0.94

func ConfigFromBytes(configBytes []byte) (*Config, error)

ConfigFromBytes loads a config from raw YAML bytes.

func ConfigFromFile

func ConfigFromFile(path string) (*Config, error)

ConfigFromFile loads a config file at path

func (*Config) String added in v0.0.76

func (c *Config) String() string

type PromReloadable

type PromReloadable interface {
	ApplyConfig(*config.Config) error
}

PromReloadable can apply a prometheus config

type PromReloadableWrap

type PromReloadableWrap struct {
	R PromReloadable
}

PromReloadableWrap wraps a PromReloadable into a Reloadable

func (*PromReloadableWrap) ApplyConfig

func (p *PromReloadableWrap) ApplyConfig(c *Config) error

ApplyConfig applies new configuration

type PromxyApplyConfigFunc added in v0.0.96

type PromxyApplyConfigFunc struct {
	F func(*Config) error
}

PromxyApplyConfigFunc wraps a single function that applies a promxy Config into something that implements the `Reloadable` interface. Unlike ApplyConfigFunc it receives the full promxy Config (including the promxy-only sections), not just the embedded prometheus config.

func (*PromxyApplyConfigFunc) ApplyConfig added in v0.0.96

func (a *PromxyApplyConfigFunc) ApplyConfig(cfg *Config) error

ApplyConfig applies new configuration

type PromxyConfig

type PromxyConfig struct {
	// Config for each of the server groups promxy is configured to aggregate
	ServerGroups []*servergroup.Config `yaml:"server_groups"`

	// AlertTemplates optionally configures Go templates for alert GeneratorURLs.
	// When unset, promxy emits its built-in Prometheus-style GeneratorURL.
	AlertTemplates alerttemplate.Config `yaml:"alert_templates,omitempty"`
}

PromxyConfig is the configuration for Promxy itself

type Reloadable

type Reloadable interface {
	ApplyConfig(*Config) error
}

Reloadable can apply a promxy config

func WrapPromReloadable

func WrapPromReloadable(p PromReloadable) Reloadable

WrapPromReloadable wraps a PromReloadable into a Reloadable

Jump to

Keyboard shortcuts

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