func MetricWithPrefix(prefix, name string, tags map[string]string) string {
	buf := bufPool.Get().(*bytes.Buffer)
	buf.Reset()

	if prefix != "" {
		buf.WriteString(prefix)
	}
	buf.WriteString(name)

	addKeys := make([]string, 0, 5)
	switch {
	case strings.HasPrefix(name, "outbound"):
		addKeys = append(addKeys, "service", "target-service", "target-endpoint")
		if strings.HasPrefix(name, "outbound.calls.retries") {
			addKeys = append(addKeys, "retry-count")
		}
	case strings.HasPrefix(name, "inbound"):
		addKeys = append(addKeys, "calling-service", "service", "endpoint")
	}

	for _, k := range addKeys {
		buf.WriteByte('.')
		v, ok := tags[k]
		if ok {
			writeClean(buf, v)
		} else {
			buf.WriteString("no-")
			buf.WriteString(k)
		}
	}

	m := buf.String()
	bufPool.Put(buf)
	return m
}
func MetricWithPrefix(prefix, name string, tags map[string]string) string {
	buf := bufPool.Get().(*bytes.Buffer)
	buf.Reset()

	if prefix != "" {
		buf.WriteString(prefix)
	}
	buf.WriteString(name)

	addKeys := make([]string, 0, 5)
	switch {
	case strings.HasPrefix(name, "outbound"):
		addKeys = append(addKeys, "service", "target-service", "target-endpoint")
		if strings.HasPrefix(name, "outbound.calls.retries") {
			addKeys = append(addKeys, "retry-count")
		}
	case strings.HasPrefix(name, "inbound"):
		addKeys = append(addKeys, "calling-service", "service", "endpoint")
	}

	for _, k := range addKeys {
		buf.WriteByte('.')
		v, ok := tags[k]
		if ok {
			writeClean(buf, v)
		} else {
			buf.WriteString("no-")
			buf.WriteString(k)
		}
	}

	m := buf.String()
	bufPool.Put(buf)
	return m
}
func MetricWithPrefix ( prefix , name string , tags map [ string ] string ) string { buf := bufPool . Get ( ) . ( * bytes . Buffer ) buf . Reset ( ) if prefix != " " { buf . WriteString ( prefix ) } buf . WriteString ( name ) addKeys := make ( [ ] string , 0 , 5 ) switch { case strings . HasPrefix ( name , " " ) : addKeys = append ( addKeys , " " , " " , " " ) if strings . HasPrefix ( name , " " ) { addKeys = append ( addKeys , " " ) } case strings . HasPrefix ( name , " " ) : addKeys = append ( addKeys , " " , " " , " " ) } for _ , k := range addKeys { buf . WriteByte ( '.' ) v , ok := tags [ k ] if ok { writeClean ( buf , v ) } else { buf . WriteString ( " " ) buf . WriteString ( k ) } } m := buf . String ( ) bufPool . Put ( buf ) return m }
// MetricWithPrefix is the default mapping for metrics to statsd keys.
MetricWithPrefix is the default mapping for metrics to statsd keys .