Documentation ¶
Index ¶
- Variables
- func GetRegisteredAllocatorNames() []string
- func MakeNCollectors(n int, startingIndex int) map[string]*Collector
- func MakeNNewTargets(n int, numCollectors int, startingIndex int) map[string]*target.Item
- func MakeNNewTargetsWithEmptyCollectors(n int, startingIndex int) map[string]*target.Item
- func RecordTargetsKept(targets map[string]*target.Item)
- func Register(name string, provider AllocatorProvider) error
- func RunForAllStrategies(t *testing.T, f func(t *testing.T, allocator Allocator))
- type AllocationOption
- type Allocator
- type AllocatorProvider
- type Collector
- type Filter
- type Strategy
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // TargetsPerCollector records how many targets have been assigned to each collector. // It is currently the responsibility of the strategy to track this information. TargetsPerCollector = promauto.NewGaugeVec(prometheus.GaugeOpts{ Name: "opentelemetry_allocator_targets_per_collector", Help: "The number of targets for each collector.", }, []string{"collector_name", "strategy"}) CollectorsAllocatable = promauto.NewGaugeVec(prometheus.GaugeOpts{ Name: "opentelemetry_allocator_collectors_allocatable", Help: "Number of collectors the allocator is able to allocate to.", }, []string{"strategy"}) TimeToAssign = promauto.NewHistogramVec(prometheus.HistogramOpts{ Name: "opentelemetry_allocator_time_to_allocate", Help: "The time it takes to allocate", }, []string{"method", "strategy"}) TargetsUnassigned = promauto.NewGauge(prometheus.GaugeOpts{ Name: "opentelemetry_allocator_targets_unassigned", Help: "Number of targets that could not be assigned due to missing node label.", }) )
Functions ¶
func GetRegisteredAllocatorNames ¶
func GetRegisteredAllocatorNames() []string
func MakeNNewTargets ¶
func RecordTargetsKept ¶
func Register ¶
func Register(name string, provider AllocatorProvider) error
Types ¶
type AllocationOption ¶
type AllocationOption func(Allocator)
func WithFilter ¶
func WithFilter(filter Filter) AllocationOption
type Allocator ¶
type AllocatorProvider ¶
type AllocatorProvider func(log logr.Logger, opts ...AllocationOption) Allocator
type Collector ¶
Collector Creates a struct that holds Collector information. This struct will be parsed into endpoint with Collector and jobs info. This struct can be extended with information like annotations and labels in the future.
func NewCollector ¶
type Strategy ¶ added in v0.100.1
type Strategy interface { GetCollectorForTarget(map[string]*Collector, *target.Item) (*Collector, error) // SetCollectors exists for strategies where changing the collector set is potentially an expensive operation. // The caller must guarantee that the collectors map passed in GetCollectorForTarget is consistent with the latest // SetCollectors call. Strategies which don't need this information can just ignore it. SetCollectors(map[string]*Collector) GetName() string }
Click to show internal directories.
Click to hide internal directories.