Skip to content

Commit e4e0cb6

Browse files
authored
Introduce ability to specify strategies for target allocation (#1079)
* Cribbed from another branch * Refactor part 2 * Fix tests * Remove deadlocking problem * Update based on comments * Unexported some fields, added blocker and comments about invariants * Comments and imports fixed
1 parent 408fc82 commit e4e0cb6

24 files changed

+800
-622
lines changed

apis/v1alpha1/opentelemetrycollector_types.go

+2
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ type OpenTelemetryCollectorSpec struct {
108108

109109
// OpenTelemetryTargetAllocator defines the configurations for the Prometheus target allocator.
110110
type OpenTelemetryTargetAllocator struct {
111+
// AllocationStrategy determines which strategy the target allocator should use for allocation
112+
AllocationStrategy string `json:"allocationStrategy,omitempty"`
111113
// ServiceAccount indicates the name of an existing service account to use with this instance.
112114
// +optional
113115
ServiceAccount string `json:"serviceAccount,omitempty"`

apis/v1alpha1/zz_generated.deepcopy.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle/manifests/opentelemetry.io_opentelemetrycollectors.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,10 @@ spec:
683683
description: TargetAllocator indicates a value which determines whether
684684
to spawn a target allocation resource or not.
685685
properties:
686+
allocationStrategy:
687+
description: AllocationStrategy determines which strategy the
688+
target allocator should use for allocation
689+
type: string
686690
enabled:
687691
description: Enabled indicates whether to use a target allocation
688692
mechanism for Prometheus targets or not.

cmd/otel-allocator/allocation/allocator.go

-237
This file was deleted.

0 commit comments

Comments
 (0)