code: func pattern(in string) string {
  	mode := rand.Intn(3)
  	if mode == 0 {
  		// in this mode, replaces a node with a wildcard
  		parts := strings.Split(in, ".")
  		parts[rand.Intn(len(parts))] = "*"
  		return strings.Join(parts, ".")
  	} else if mode == 1 {
  		// randomly replace chars with a *
  		// note that in 1/5 cases, nothing happens
  		// and otherwise, sometimes valid patterns are produced,
  		// but it's also possible to produce patterns that won't match anything (if '.' was taken out)
  		if len(in) < 5 {
  			log.Fatalf("metric %q too short for pattern replacement", in)
  		}
  		chars := rand.Intn(5)
  		pos := rand.Intn(len(in) - chars)
  		return in[0:pos] + "*" + in[pos+chars:]
  	}
  	// mode 3: do nothing :)
  	return in
  }
docs: // random choice between replacing a node with a wildcard, a char with a wildcard, and passthrough