code: func getVersion(lastSeenBinaryVersion *string) error {
  	// Create the get request for the etcd version endpoint.
  	req, err := http.NewRequest("GET", etcdVersionScrapeURI, nil)
  	if err != nil {
  		return fmt.Errorf("failed to create GET request for etcd version: %v", err)
  	}
  
  	// Send the get request and receive a response.
  	client := &http.Client{}
  	resp, err := client.Do(req)
  	if err != nil {
  		return fmt.Errorf("failed to receive GET response for etcd version: %v", err)
  	}
  	defer resp.Body.Close()
  
  	// Obtain EtcdVersion from the JSON response.
  	var version EtcdVersion
  	if err := json.NewDecoder(resp.Body).Decode(&version); err != nil {
  		return fmt.Errorf("failed to decode etcd version JSON: %v", err)
  	}
  
  	// Return without updating the version if it stayed the same since last time.
  	if *lastSeenBinaryVersion == version.BinaryVersion {
  		return nil
  	}
  
  	// Delete the metric for the previous version.
  	if *lastSeenBinaryVersion != "" {
  		deleted := etcdVersion.Delete(prometheus.Labels{"binary_version": *lastSeenBinaryVersion})
  		if !deleted {
  			return errors.New("failed to delete previous version's metric")
  		}
  	}
  
  	// Record the new version in a metric.
  	etcdVersion.With(prometheus.Labels{
  		"binary_version": version.BinaryVersion,
  	}).Set(0)
  	*lastSeenBinaryVersion = version.BinaryVersion
  	return nil
  }
docs: // Function for fetching etcd version info and feeding it to the prometheus metric.