Documentation
¶
Overview ¶
Package whconfig is the webhooks: section of the platform configuration (#1870). Sources themselves are administrator-managed records in the database; this section only decides which replicas receive and which compact, and paces the compactor.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompactorConfig ¶
type CompactorConfig struct {
Enabled *bool `yaml:"enabled"`
// Poll is how long an idle compactor waits before looking for work.
Poll time.Duration `yaml:"poll"`
// Grace is how long after a window ends the compactor waits for segments
// still being written into it.
Grace time.Duration `yaml:"grace"`
// Lease is how long a claimed window is held from other replicas.
Lease time.Duration `yaml:"lease"`
// Batch is how many windows one pass claims.
Batch int `yaml:"batch"`
// RetryBackoff is how long a failed window is held back, multiplied by its
// attempts, up to an hour.
RetryBackoff time.Duration `yaml:"retry_backoff"`
// RetentionEvery is how often retention runs.
RetentionEvery time.Duration `yaml:"retention_every"`
// ExpiredWindowRetentionDays is how long the record of an expired
// window is kept (#1904). 0 takes 90; a negative value keeps them for as
// long as their source exists.
ExpiredWindowRetentionDays int `yaml:"expired_window_retention_days"`
// TelemetryRetentionDays is how long the webhooks page's history is kept
// (#2150): request counts by outcome and status, acknowledgement
// latency, each receiver's minutes and the compaction runs, per minute
// for 48 hours and per hour after. 0 takes 14.
TelemetryRetentionDays int `yaml:"telemetry_retention_days"`
// RollupCheckEvery and RollupDeleteDelay paced the open window's rollup,
// which deleted files a running query had listed and is gone (#2140).
// They are accepted so a configuration that sets them still starts, and
// RetiredKeys names them; nothing reads them.
RollupCheckEvery time.Duration `yaml:"rollup_check_every"`
RollupDeleteDelay time.Duration `yaml:"rollup_delete_delay"`
}
CompactorConfig decides whether this replica compacts and applies retention, and paces it.
type Config ¶
type Config struct {
Receiver ReceiverConfig `yaml:"receiver"`
Compactor CompactorConfig `yaml:"compactor"`
}
Config is the webhooks: section. Every field's zero value is its default, so a deployment sets nothing.
func (Config) CompactorEnabled ¶
CompactorEnabled reports whether this replica compacts.
func (Config) ReceiverEnabled ¶
ReceiverEnabled reports whether this replica serves /hooks/.
func (Config) RetiredKeys ¶ added in v1.146.2
RetiredKeys names the settings in the section that nothing reads any more, for the configuration warning that tells an operator to remove them.
func (Config) SpoolEnabled ¶ added in v1.146.0
SpoolEnabled reports whether this replica's receiver spools.
func (Config) WriteTimeout ¶
WriteTimeout is the receiver's segment write bound.
type ReceiverConfig ¶
type ReceiverConfig struct {
// Enabled defaults to on. A deployment that keeps bursts off the
// replicas serving MCP and the portal turns it off there and runs a
// receiver-only deployment of the same image behind its own Ingress.
Enabled *bool `yaml:"enabled"`
// Address, when set, also serves the receiver on a listener of its own,
// so it can sit behind its own Service. The main listener serves it
// either way.
Address string `yaml:"address"`
// WriteTimeout bounds writing one segment to object storage. A request
// whose segment has not been written by then is answered 503.
WriteTimeout time.Duration `yaml:"write_timeout"`
// Spool, when its directory is set, answers a request once its events
// are synced to this replica's disk and drains them to object storage
// behind the answer (#2121).
Spool SpoolConfig `yaml:"spool"`
}
ReceiverConfig decides whether this replica serves /hooks/.
type SpoolConfig ¶ added in v1.146.0
type SpoolConfig struct {
// Dir is the spool's directory, one per replica. An emptyDir keeps what
// it holds across a container restart; a volume of the replica's own
// (a StatefulSet's volumeClaimTemplates) keeps it across rescheduling.
Dir string `yaml:"dir"`
// MaxBytes bounds the bytes the spool holds. Past it a request is
// answered 503 with Retry-After. 0 takes 1 GiB.
MaxBytes int64 `yaml:"max_bytes"`
// MaxAge bounds how long the oldest event may wait to be drained. Past
// it a request is answered 503 with Retry-After. 0 takes an hour.
MaxAge time.Duration `yaml:"max_age"`
}
SpoolConfig is the receiver's local write-ahead spool. Off until Dir is set: the spool needs a writable volume, which a read-only root file system does not have.