generator

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RingKey is the key under which we store the metric-generator's ring in the KVStore.
	RingKey = "metrics-generator"
)

Variables

View Source
var ErrReadOnly = errors.New("metrics-generator is shutting down")

Functions

This section is empty.

Types

type Config

type Config struct {
	Ring      RingConfig      `yaml:"ring"`
	Processor ProcessorConfig `yaml:"processor"`
	Registry  registry.Config `yaml:"registry"`
	Storage   storage.Config  `yaml:"storage"`
}

Config for a generator.

func (*Config) RegisterFlagsAndApplyDefaults

func (cfg *Config) RegisterFlagsAndApplyDefaults(prefix string, f *flag.FlagSet)

RegisterFlagsAndApplyDefaults registers the flags.

type Generator

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

func New

func New(cfg *Config, overrides metricsGeneratorOverrides, reg prometheus.Registerer, logger log.Logger) (*Generator, error)

New makes a new Generator.

func (*Generator) CheckReady

func (g *Generator) CheckReady(_ context.Context) error

func (*Generator) OnRingInstanceHeartbeat

func (g *Generator) OnRingInstanceHeartbeat(lifecycler *ring.BasicLifecycler, ringDesc *ring.Desc, instanceDesc *ring.InstanceDesc)

OnRingInstanceHeartbeat implements ring.BasicLifecyclerDelegate

func (*Generator) OnRingInstanceRegister

func (g *Generator) OnRingInstanceRegister(lifecycler *ring.BasicLifecycler, ringDesc ring.Desc, instanceExists bool, instanceID string, instanceDesc ring.InstanceDesc) (ring.InstanceState, ring.Tokens)

OnRingInstanceRegister implements ring.BasicLifecyclerDelegate

func (*Generator) OnRingInstanceStopping

func (g *Generator) OnRingInstanceStopping(lifecycler *ring.BasicLifecycler)

OnRingInstanceStopping implements ring.BasicLifecyclerDelegate

func (*Generator) OnRingInstanceTokens

func (g *Generator) OnRingInstanceTokens(lifecycler *ring.BasicLifecycler, tokens ring.Tokens)

OnRingInstanceTokens implements ring.BasicLifecyclerDelegate

func (*Generator) PushSpans

type ProcessorConfig

type ProcessorConfig struct {
	ServiceGraphs servicegraphs.Config `yaml:"service_graphs"`
	SpanMetrics   spanmetrics.Config   `yaml:"span_metrics"`
}

func (*ProcessorConfig) RegisterFlagsAndApplyDefaults

func (cfg *ProcessorConfig) RegisterFlagsAndApplyDefaults(prefix string, f *flag.FlagSet)

type RingConfig

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

	InstanceID             string   `yaml:"instance_id"`
	InstanceInterfaceNames []string `yaml:"instance_interface_names"`
	InstanceAddr           string   `yaml:"instance_addr"`

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

func (*RingConfig) RegisterFlagsAndApplyDefaults

func (cfg *RingConfig) RegisterFlagsAndApplyDefaults(prefix string, f *flag.FlagSet)

func (*RingConfig) ToRingConfig

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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