generator

package
v0.0.0-...-39c03fc Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: AGPL-3.0 Imports: 29 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 (
	ErrUnconfigured = errors.New("no metrics_generator.storage.path configured, metrics generator will be disabled")
	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"`
	// MetricsIngestionSlack is the max amount of time passed since a span's start time
	// for the span to be considered in metrics generation
	MetricsIngestionSlack time.Duration `yaml:"metrics_ingestion_time_range_slack"`
}

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
	deeppb.UnimplementedMetricsGeneratorServer
	// 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(*ring.BasicLifecycler, *ring.Desc, *ring.InstanceDesc)

OnRingInstanceHeartbeat implements ring.BasicLifecyclerDelegate

func (*Generator) OnRingInstanceRegister

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

OnRingInstanceRegister implements ring.BasicLifecyclerDelegate

func (*Generator) OnRingInstanceStopping

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

OnRingInstanceStopping implements ring.BasicLifecyclerDelegate

func (*Generator) OnRingInstanceTokens

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

OnRingInstanceTokens implements ring.BasicLifecyclerDelegate

func (*Generator) PushSnapshot

type ProcessorConfig

type ProcessorConfig struct {
	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