Skip to content

Commit

Permalink
remove default endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Yash Sharma <[email protected]>
  • Loading branch information
yashrsharma44 committed May 20, 2021
1 parent 51d6791 commit 939748e
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions cmd/thanos/receive.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ package main
import (
"context"
"io/ioutil"
"net"
"os"
"path"
"strings"
"time"

"github.com/go-kit/kit/log"
Expand Down Expand Up @@ -78,18 +76,6 @@ func registerReceive(app *extkingpin.App) {
// otherwise run receiver in distributor mode.
enableIngestion := conf.endpoint != "" || (conf.hashringsFileContent == "" && conf.hashringsFilePath == "")

// If endpoint and hashrings are empty, so try to generate a local endpoint
// based on the hostname and the listening port.
if conf.endpoint == "" && (conf.hashringsFileContent == "" && conf.hashringsFilePath == "") {
hostname, err := os.Hostname()
if hostname == "" || err != nil {
return errors.New("--receive.local-endpoint is empty and host could not be determined.")
}
parts := strings.Split(*conf.grpcBindAddr, ":")
port := parts[len(parts)-1]
conf.endpoint = net.JoinHostPort(hostname, port)
}

return runReceive(
g,
logger,
Expand Down Expand Up @@ -219,7 +205,7 @@ func runReceive(
// initial config and mark ourselves as ready after it completed.

// reloadGRPCServer signals when - (1)TSDB is ready and the Store gRPC server can start.
// (2) The Hashring files have changed.
// (2) The Hashring files have changed if tsdb ingestion is disabled.
reloadGRPCServer := make(chan struct{}, 1)
// hashringChangedChan signals when TSDB needs to be flushed and updated due to hashring config change.
hashringChangedChan := make(chan struct{}, 1)
Expand Down

0 comments on commit 939748e

Please sign in to comment.