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

Method RegisterFlags

modules/livestore/partition_ring.go:29–36  ·  view source on GitHub ↗

RegisterFlags adds the flags required to config this to the given FlagSet.

(prefix string, f *flag.FlagSet)

Source from the content-addressed store, hash-verified

27
28// RegisterFlags adds the flags required to config this to the given FlagSet.
29func (cfg *PartitionRingConfig) RegisterFlags(prefix string, f *flag.FlagSet) {
30 cfg.KVStore.Store = "memberlist" // Override default value.
31 cfg.KVStore.RegisterFlagsWithPrefix(prefix+".partition-ring.", "collectors/", f)
32
33 f.IntVar(&cfg.MinOwnersCount, prefix+".partition-ring.min-partition-owners-count", 1, "Minimum number of owners to wait before a PENDING partition gets switched to ACTIVE.")
34 f.DurationVar(&cfg.MinOwnersDuration, prefix+".partition-ring.min-partition-owners-duration", 10*time.Second, "How long the minimum number of owners are enforced before a PENDING partition gets switched to ACTIVE.")
35 f.DurationVar(&cfg.DeleteInactivePartitionAfter, prefix+".partition-ring.delete-inactive-partition-after", 13*time.Hour, "How long to wait before an INACTIVE partition is eligible for deletion. The partition is deleted only if it has been in INACTIVE state for at least the configured duration and it has no owners registered. A value of 0 disables partitions deletion.")
36}
37
38func (cfg *PartitionRingConfig) ToLifecyclerConfig(partitionID int32, instanceID string) ring.PartitionInstanceLifecyclerConfig {
39 return ring.PartitionInstanceLifecyclerConfig{

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected