exporter

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Ring RingConfig `yaml:"ring"`
}

Config holds the configuration for an overrides-exporter

func (*Config) RegisterFlags

func (c *Config) RegisterFlags(f *flag.FlagSet, logger log.Logger)

RegisterFlags configs this instance to the given FlagSet

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration for an overrides-exporter.

type OverridesExporter

type OverridesExporter struct {
	services.Service
	// contains filtered or unexported fields
}

OverridesExporter exposes per-tenant resource limit overrides as Prometheus metrics

func NewOverridesExporter

func NewOverridesExporter(
	config Config,
	defaultLimits *validation.Limits,
	tenantLimits validation.TenantLimits,
	log log.Logger,
	registerer prometheus.Registerer,
) (*OverridesExporter, error)

NewOverridesExporter creates an OverridesExporter that reads updates to per-tenant limits using the provided function.

func (*OverridesExporter) Collect

func (oe *OverridesExporter) Collect(ch chan<- prometheus.Metric)

func (*OverridesExporter) Describe

func (oe *OverridesExporter) Describe(ch chan<- *prometheus.Desc)

func (*OverridesExporter) RingHandler

func (oe *OverridesExporter) RingHandler(w http.ResponseWriter, req *http.Request)

RingHandler is an http.Handler that serves requests for the overrides-exporter ring status page

type RingConfig

type RingConfig struct {
	KVStore          kv.Config     `yaml:"kvstore"`
	HeartbeatPeriod  time.Duration `yaml:"heartbeat_period"`
	HeartbeatTimeout time.Duration `yaml:"heartbeat_timeout"`

	// Instance details
	InstanceID             string   `yaml:"instance_id" doc:"default=<hostname>"`
	InstanceInterfaceNames []string `yaml:"instance_interface_names" doc:"default=[<private network interfaces>]"`
	InstancePort           int      `yaml:"instance_port" doc:"hidden"`
	InstanceAddr           string   `yaml:"instance_addr" doc:"hidden"`

	// Injected internally
	ListenPort int `yaml:"-"`

	// Ring stability (used to decrease token reshuffling on scale-up).
	WaitStabilityMinDuration time.Duration `yaml:"wait_stability_min_duration" category:"advanced"`
	WaitStabilityMaxDuration time.Duration `yaml:"wait_stability_max_duration" category:"advanced"`
}

RingConfig holds the configuration for the overrides-exporter ring.

func (*RingConfig) RegisterFlags

func (c *RingConfig) RegisterFlags(f *flag.FlagSet, logger log.Logger)

RegisterFlags configures this RingConfig to the given flag set and sets defaults.

func (*RingConfig) ToRingConfig

func (cfg *RingConfig) ToRingConfig() ring.Config

func (*RingConfig) Validate

func (c *RingConfig) Validate() error

Validate the Config.

Jump to

Keyboard shortcuts

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