Skip to content

Commit 4c86ce3

Browse files
authored
Unify TA types into a single file (open-telemetry#2894)
Signed-off-by: Pavol Loffay <[email protected]>
1 parent 7516a99 commit 4c86ce3

File tree

2 files changed

+23
-38
lines changed

2 files changed

+23
-38
lines changed

apis/v1beta1/allocation_strategy.go

-38
This file was deleted.

apis/v1beta1/targetallocator_types.go

+23
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,26 @@ type TargetAllocatorPrometheusCR struct {
114114
// +optional
115115
ServiceMonitorSelector *metav1.LabelSelector `json:"serviceMonitorSelector,omitempty"`
116116
}
117+
118+
type (
119+
// TargetAllocatorAllocationStrategy represent a strategy Target Allocator uses to distribute targets to each collector
120+
// +kubebuilder:validation:Enum=least-weighted;consistent-hashing;per-node
121+
TargetAllocatorAllocationStrategy string
122+
// TargetAllocatorFilterStrategy represent a filtering strategy for targets before they are assigned to collectors
123+
// +kubebuilder:validation:Enum="";relabel-config
124+
TargetAllocatorFilterStrategy string
125+
)
126+
127+
const (
128+
// TargetAllocatorAllocationStrategyLeastWeighted targets will be distributed to collector with fewer targets currently assigned.
129+
TargetAllocatorAllocationStrategyLeastWeighted TargetAllocatorAllocationStrategy = "least-weighted"
130+
131+
// TargetAllocatorAllocationStrategyConsistentHashing targets will be consistently added to collectors, which allows a high-availability setup.
132+
TargetAllocatorAllocationStrategyConsistentHashing TargetAllocatorAllocationStrategy = "consistent-hashing"
133+
134+
// TargetAllocatorAllocationStrategyPerNode targets will be assigned to the collector on the node they reside on (use only with daemon set).
135+
TargetAllocatorAllocationStrategyPerNode TargetAllocatorAllocationStrategy = "per-node"
136+
137+
// TargetAllocatorFilterStrategyRelabelConfig targets will be consistently drops targets based on the relabel_config.
138+
TargetAllocatorFilterStrategyRelabelConfig TargetAllocatorFilterStrategy = "relabel-config"
139+
)

0 commit comments

Comments
 (0)