code: func (ps *prometheusState) Collect(ch chan<- stdprometheus.Metric) {
  	ps.mtx.Lock()
  	defer ps.mtx.Unlock()
  
  	var outdatedKeys []string
  	for key, cs := range ps.state {
  		cs.collector.Collect(ch)
  
  		if ps.isOutdated(cs) {
  			outdatedKeys = append(outdatedKeys, key)
  		}
  	}
  
  	for _, key := range outdatedKeys {
  		ps.state[key].delete()
  		delete(ps.state, key)
  	}
  }
docs: // Collect implements prometheus.Collector. It calls the Collect
  // method of all metrics it received on the collectors channel.
  // It's also responsible to remove metrics that belong to an outdated configuration.
  // The removal happens only after their Collect method was called to ensure that
  // also those metrics will be exported on the current scrape.