MCPcopy Create free account
hub / github.com/cortexproject/cortex / state

Struct state

pkg/alertmanager/state_replication.go:37–65  ·  view source on GitHub ↗

state represents the Alertmanager silences and notification log internal state.

Source from the content-addressed store, hash-verified

35
36// state represents the Alertmanager silences and notification log internal state.
37type state struct {
38 services.Service
39
40 userID string
41 logger log.Logger
42 reg prometheus.Registerer
43
44 settleReadTimeout time.Duration
45 storeReadTimeout time.Duration
46
47 mtx sync.Mutex
48 states map[string]cluster.State
49
50 replicationFactor int
51 replicator Replicator
52 store alertstore.AlertStore
53
54 partialStateMergesTotal *prometheus.CounterVec
55 partialStateMergesFailed *prometheus.CounterVec
56 stateReplicationTotal *prometheus.CounterVec
57 stateReplicationFailed *prometheus.CounterVec
58 fetchReplicaStateTotal prometheus.Counter
59 fetchReplicaStateFailed prometheus.Counter
60 initialSyncTotal prometheus.Counter
61 initialSyncCompleted *prometheus.CounterVec
62 initialSyncDuration prometheus.Histogram
63
64 msgc chan *clusterpb.Part
65}
66
67// newReplicatedStates creates a new state struct, which manages state to be replicated between alertmanagers.
68func newReplicatedStates(userID string, rf int, re Replicator, st alertstore.AlertStore, l log.Logger, r prometheus.Registerer) *state {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected