public String getTagString(Iterable<MetricsTag> desiredTags) {
    /*
     * We don't return tags (even sourceName) if no tags available. Most likely,
     * when tags are empty - we don't need to distinguish services
     */
    if (desiredTags == null)
      return null;

    tagsListBuffer.setLength(0);
    tagsListBuffer.append("sourceName:").append(currentServiceName);
    String separator = ",";
    for (MetricsTag tag : desiredTags) {
      tagsListBuffer.append(separator);
      tagsListBuffer.append(tag.name());
      tagsListBuffer.append(":");
      tagsListBuffer.append(String.valueOf(tag.value()));
    }

    return tagsListBuffer.toString();
  }
This class stores published metrics to the SQL Server database.
contrib/ambari-scom/metrics-sink/src/main/java/org/apache/hadoop/metrics2/sink/SqlSink.java