exporter

package
v0.0.0-...-f8e07d0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: AGPL-3.0 Imports: 18 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"`
	EnabledMetrics flagext.StringSliceCSV `yaml:"enabled_metrics"`

	// This allows downstream projects to define their own metrics and expose them via the exporter.
	// Donwstream projects should be responsible for enabling/disabling their own metrics,
	// so these won't be checked against EnabledMetrics.
	ExtraMetrics []ExportedMetric `yaml:"-"`
}

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 ExportedMetric

type ExportedMetric struct {
	Name string
	Get  func(limits *validation.Limits) float64
}

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 a http.Handler that serves requests for the overrides-exporter ring status page

type RingConfig

type RingConfig struct {
	// Whether the ring is enabled for overrides-exporters.
	Enabled bool `yaml:"enabled"`

	// Use common config shared with other components' ring config.
	Common util.CommonRingConfig `yaml:",inline"`

	// 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) 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