示例#1
0
func setupMetrics(listenAddr, enabledCollectors string) {
	if enabledCollectors == "" {
		enabledCollectors = sysmetrics.FilterAvailableCollectors(sysmetrics.DefaultCollectors)
	}
	collectors, err := sysmetrics.LoadCollectors(enabledCollectors)
	if err != nil {
		log.Fatalf("Couldn't load collectors: %s", err)
	}
	nodeCollector := sysmetrics.New(collectors)
	prometheus.MustRegister(nodeCollector)
	http.Handle("/metrics", prometheus.Handler())
	go http.ListenAndServe(listenAddr, nil)
}
示例#2
0
	"google.golang.org/grpc"
	"google.golang.org/grpc/credentials"

	"net"

	"github.com/BurntSushi/toml"
	log "github.com/Sirupsen/logrus"
	pb "github.com/pandemicsyn/syndicate/api/proto"
	"github.com/pandemicsyn/syndicate/syndicate"
	"github.com/pandemicsyn/syndicate/utils/sysmetrics"
	"github.com/prometheus/client_golang/prometheus"
)

var (
	printVersionInfo  = flag.Bool("version", false, "print version/build info")
	enabledCollectors = flag.String("collectors", sysmetrics.FilterAvailableCollectors(sysmetrics.DefaultCollectors), "Comma-separated list of collectors to use.")
)

var syndVersion string
var ringVersion string
var goVersion string
var buildDate string

/*
func newRingDistServer() *ringslave {
	s := new(ringslave)
	return s
}
*/

type RingSyndicate struct {