Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
thampiotr committed May 13, 2024
1 parent 41c90f1 commit 888b993
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions internal/component/discovery/distributed_targets.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ func (dt *DistributedTargets) LocalTargets() []Target {
return dt.localTargets
}

// MovedToRemoteInstance returns targets that have been moved from this local node to another node, given the provided
// previous targets distribution. If a target has simply disappeared, it will not be returned. Previous targets
// distribution can be nil, in which case no targets will be returned.
// MovedToRemoteInstance returns the set of local targets from prev
// that are no longer local in dt, indicating an active target has moved.
// Only targets which exist in both prev and dt are returned. If prev
// contains an empty list of targets, no targets are returned.
func (dt *DistributedTargets) MovedToRemoteInstance(prev *DistributedTargets) []Target {
if prev == nil {
return nil
Expand Down
12 changes: 6 additions & 6 deletions internal/component/prometheus/scrape/scrape.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ type Component struct {
opts component.Options
cluster cluster.Cluster

reloadTargets chan struct{}

mut sync.RWMutex
args Arguments
scraper *scrape.Manager
appendable *prometheus.Fanout
reloadTargets chan struct{}
targetsGauge client_prometheus.Gauge
movedTargetsCounter client_prometheus.Counter

mut sync.RWMutex
args Arguments
scraper *scrape.Manager
appendable *prometheus.Fanout

dtMutex sync.Mutex
distributedTargets *discovery.DistributedTargets
}
Expand Down

0 comments on commit 888b993

Please sign in to comment.