Skip to content

Commit 758630b

Browse files
committed
chore: adjust and add unit test
Signed-off-by: mike9421 <[email protected]>
1 parent a21acd2 commit 758630b

File tree

2 files changed

+522
-1
lines changed

2 files changed

+522
-1
lines changed

cmd/otel-allocator/prehook/relabel_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,14 @@ func makeNNewTargets(rCfgs []relabelConfigObj, n int, numCollectors int, startin
180180
{Name: "total", Value: strconv.Itoa(n + startingIndex)},
181181
}
182182
jobName := fmt.Sprintf("test-job-%d", i)
183-
newTarget := target.NewItem(jobName, "test-url", label, collector)
184183
// add a single replace, drop, or keep action as relabel_config for targets
185184
var index int
186185
ind, _ := rand.Int(rand.Reader, big.NewInt(int64(len(relabelConfigs))))
187186

188187
index = int(ind.Int64())
189188

190189
relabelConfig[jobName] = rCfgs[index].cfg
190+
newTarget := target.NewItem(jobName, "test-url", label, collector, relabelConfig[jobName]...)
191191

192192
targetKey := newTarget.Hash()
193193
if relabelConfigs[index].isDrop {

0 commit comments

Comments
 (0)