More granular locking for scrapeLoop. (#8104)
More granular locking for scrapeLoop. (#8104)

Don't lock for all of Sync/stop/reload as that holds up /metrics and the
UI when they want a list of active/dropped targets. Instead take
advantage of the fact that Sync/stop/reload cannot be called
concurrently by the scrape Manager and lock just on the targets
themselves.

Signed-off-by: Brian Brazil <aadf89994a343dc176a47081f0c0bbea26f0a345@robustperception.io>
alileza/prometheus,keegancsmith/prometheus,GoogleCloudPlatform/prometheus,prometheus/prometheus,GoogleCloudPlatform/prometheus,prometheus/prometheus,keegancsmith/prometheus,prometheus/prometheus,prometheus/prometheus,keegancsmith/prometheus,keegancsmith/prometheus,prometheus/prometheus,GoogleCloudPlatform/prometheus,GoogleCloudPlatform/prometheus,alileza/prometheus,alileza/prometheus,keegancsmith/prometheus,alileza/prometheus,alileza/prometheus,GoogleCloudPlatform/prometheus