MCPcopy
hub / github.com/grafana/tempo / RegisterFlagsAndApplyDefaults

Method RegisterFlagsAndApplyDefaults

pkg/ring/config.go:34–50  ·  view source on GitHub ↗
(prefix string, f *flag.FlagSet)

Source from the content-addressed store, hash-verified

32}
33
34func (cfg *Config) RegisterFlagsAndApplyDefaults(prefix string, f *flag.FlagSet) {
35 cfg.KVStore.RegisterFlagsWithPrefix(prefix, "collectors/", f)
36 cfg.KVStore.Store = "memberlist"
37
38 cfg.HeartbeatPeriod = 5 * time.Second
39 cfg.HeartbeatTimeout = 1 * time.Minute
40
41 hostname, err := os.Hostname()
42 if err != nil {
43 level.Error(log.Logger).Log("msg", "failed to get hostname", "err", err)
44 os.Exit(1)
45 }
46 cfg.InstanceID = hostname
47 cfg.InstanceInterfaceNames = []string{"eth0", "en0"}
48
49 f.StringVar(&cfg.InstanceZone, prefix+".instance-availability-zone", "", "Define Availability Zone in which this instance is running.")
50}
51
52func (cfg *Config) ToRingConfig() ring.Config {
53 rc := ring.Config{}

Callers

nothing calls this directly

Calls 3

LogMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected