code: func getLabelsForDatapoint(dimensions producers.Dimensions, tags map[string]string) string {
  	allDimensions := map[string]string{}
  	if dimensions.Labels != nil {
  		allDimensions = dimensions.Labels
  	}
  
  	allDimensions["mesos_id"] = dimensions.MesosID
  	allDimensions["cluster_id"] = dimensions.ClusterID
  	allDimensions["container_id"] = dimensions.ContainerID
  	allDimensions["framework_name"] = dimensions.FrameworkName
  	allDimensions["framework_id"] = dimensions.FrameworkID
  	allDimensions["framework_role"] = dimensions.FrameworkRole
  	allDimensions["framework_principal"] = dimensions.FrameworkPrincipal
  	allDimensions["task_name"] = dimensions.TaskName
  	allDimensions["task_id"] = dimensions.TaskID
  	allDimensions["hostname"] = dimensions.Hostname
  
  	labels := []string{}
  	for k, v := range allDimensions {
  		if len(v) > 0 {
  			labels = append(labels, fmt.Sprintf("%s=%q", k, v))
  		}
  	}
  	// Sorting tags ensures consistent order
  	for _, pair := range prodHelpers.SortTags(tags) {
  		k, v := pair[0], pair[1]
  		labels = append(labels, fmt.Sprintf("%s=%q", sanitizeName(k), v))
  	}
  
  	if len(labels) > 0 {
  		return "{" + strings.Join(labels, ",") + "}"
  	}
  	return ""
  }
docs: // getLabelsForDatapoint returns prometheus-formatted labels from a
  // datapoint's dimensions and tags