Skip to content

Commit

Permalink
playground: fix metric targets will be overrided (#2324)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhebox authored Nov 30, 2023
1 parent c3e9fc5 commit c53895c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion components/playground/playground.go
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,12 @@ func (p *Playground) renderSDFile() error {
cid2targets := make(map[string]instance.MetricAddr)

_ = p.WalkInstances(func(cid string, inst instance.Instance) error {
cid2targets[cid] = inst.MetricAddr()
v := inst.MetricAddr()
t, ok := cid2targets[cid]
if ok {
v.Targets = append(v.Targets, t.Targets...)
}
cid2targets[cid] = v
return nil
})

Expand Down

0 comments on commit c53895c

Please sign in to comment.