func NewRoutingReceiver(e e2e.Environment, name string, replicationFactor int, hashring ...receive.HashringConfig) (*e2e.InstrumentedRunnable, error) {

	if len(hashring) == 0 {
		return nil, errors.New("hashring should not be empty for receive-distributor mode")
	}

	dir := filepath.Join(e.SharedDir(), "data", "receive", name)
	dataDir := filepath.Join(dir, "data")
	container := filepath.Join(ContainerSharedDir, "data", "receive", name)
	if err := os.MkdirAll(dataDir, 0750); err != nil {
		return nil, errors.Wrap(err, "create receive dir")
	}
	b, err := json.Marshal(hashring)
	if err != nil {
		return nil, errors.Wrapf(err, "generate hashring file: %v", hashring)
	}

	receiver := NewService(
		e,
		fmt.Sprintf("receive-%v", name),
		DefaultImage(),
		// TODO(bwplotka): BuildArgs should be interface.
		e2e.NewCommand("receive", e2e.BuildArgs(map[string]string{
			"--debug.name":                 fmt.Sprintf("receive-%v", name),
			"--grpc-address":               ":9091",
			"--grpc-grace-period":          "0s",
			"--http-address":               ":8080",
			"--remote-write.address":       ":8081",
			"--label":                      fmt.Sprintf(`receive="%s"`, name),
			"--tsdb.path":                  filepath.Join(container, "data"),
			"--log.level":                  infoLogLevel,
			"--receive.replication-factor": strconv.Itoa(replicationFactor),
			"--receive.hashrings":          string(b),
		})...),
		e2e.NewHTTPReadinessProbe("http", "/-/ready", 200, 200),
		8080,
		9091,
		Port{Name: "remote-write", PortNum: 8081},
	)

	return receiver, nil
}
// NewRoutingReceiver creates a Thanos Receive instance that is only configured to route to other receive instances. It has no local storage.
NewRoutingReceiver creates a Thanos Receive instance that is only configured to route to other receive instances. It has no local storage.
// NewRoutingReceiver creates a Thanos Receive instance that is only configured to route to other receive instances . It has no local storage .
func NewRoutingReceiver(e e2e.Environment, name string, replicationFactor int, hashring ...receive.HashringConfig) (*e2e.InstrumentedRunnable, error) {
	if len(hashring) == 0 {
		return nil, errors.New("hashring should not be empty for receive-distributor mode")
	}
	dir := filepath.Join(e.SharedDir(), "data", "receive", name)
	dataDir := filepath.Join(dir, "data")
	container := filepath.Join(ContainerSharedDir, "data", "receive", name)
	if err := os.MkdirAll(dataDir, 0750); err != nil {
		return nil, errors.Wrap(err, "create receive dir")
	}
	b, err := json.Marshal(hashring)
	if err != nil {
		return nil, errors.Wrapf(err, "generate hashring file: %v", hashring)
	}
	receiver := NewService(
		e,
		fmt.Sprintf("receive-%v", name),
		DefaultImage(),
		e2e.NewCommand("receive", e2e.BuildArgs(map[string]string{
			"--debug.name":                 fmt.Sprintf("receive-%v", name),
			"--grpc-address":               ":9091",
			"--grpc-grace-period":          "0s",
			"--http-address":               ":8080",
			"--remote-write.address":       ":8081",
			"--label":                      fmt.Sprintf(`receive="%s"`, name),
			"--tsdb.path":                  filepath.Join(container, "data"),
			"--log.level":                  infoLogLevel,
			"--receive.replication-factor": strconv.Itoa(replicationFactor),
			"--receive.hashrings":          string(b),
		})...),
		e2e.NewHTTPReadinessProbe("http", "/-/ready", 200, 200),
		8080,
		9091,
		Port{Name: "remote-write", PortNum: 8081},
	)
	return receiver, nil
}
func NewRoutingReceiver ( e e2e . Environment , name string , replicationFactor int , hashring ... receive . HashringConfig ) ( * e2e . InstrumentedRunnable , error ) { if len ( hashring ) == 0 { return nil , errors . New ( " " ) } dir := filepath . Join ( e . SharedDir ( ) , " " , " " , name ) dataDir := filepath . Join ( dir , " " ) container := filepath . Join ( ContainerSharedDir , " " , " " , name ) if err := os . MkdirAll ( dataDir , 0750 ) ; err != nil { return nil , errors . Wrap ( err , " " ) } b , err := json . Marshal ( hashring ) if err != nil { return nil , errors . Wrapf ( err , " " , hashring ) } receiver := NewService ( e , fmt . Sprintf ( " " , name ) , DefaultImage ( ) , e2e . NewCommand ( " " , e2e . BuildArgs ( map [ string ] string { " " : fmt . Sprintf ( " " , name ) , " " : " " , " " : " " , " " : " " , " " : " " , " " : fmt . Sprintf ( `receive="%s"` , name ) , " " : filepath . Join ( container , " " ) , " " : infoLogLevel , " " : strconv . Itoa ( replicationFactor ) , " " : string ( b ) , } ) ... ) , e2e . NewHTTPReadinessProbe ( " " , " " , 200 , 200 ) , 8080 , 9091 , Port { Name : " " , PortNum : 8081 } , ) return receiver , nil }
NewRoutingReceiver creates a Thanos Receive instance that is only configured to route to other receive instances.
NewRoutingReceiver creates a Thanos Receive instance that is only configured to route to other receive instances .
// TODO(bwplotka): BuildArgs should be interface.