mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: add "etcd_server_slow_read_indexes_total"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
09843d5d90
commit
f46b4677c0
@ -65,6 +65,12 @@ var (
|
|||||||
Name: "proposals_failed_total",
|
Name: "proposals_failed_total",
|
||||||
Help: "The total number of failed proposals seen.",
|
Help: "The total number of failed proposals seen.",
|
||||||
})
|
})
|
||||||
|
slowReadIndex = prometheus.NewCounter(prometheus.CounterOpts{
|
||||||
|
Namespace: "etcd",
|
||||||
|
Subsystem: "server",
|
||||||
|
Name: "slow_read_indexes_total",
|
||||||
|
Help: "The total number of pending read indexes not in sync with leader's or timed out read index requests.",
|
||||||
|
})
|
||||||
currentVersion = prometheus.NewGaugeVec(prometheus.GaugeOpts{
|
currentVersion = prometheus.NewGaugeVec(prometheus.GaugeOpts{
|
||||||
Namespace: "etcd",
|
Namespace: "etcd",
|
||||||
Subsystem: "server",
|
Subsystem: "server",
|
||||||
@ -82,6 +88,7 @@ func init() {
|
|||||||
prometheus.MustRegister(proposalsApplied)
|
prometheus.MustRegister(proposalsApplied)
|
||||||
prometheus.MustRegister(proposalsPending)
|
prometheus.MustRegister(proposalsPending)
|
||||||
prometheus.MustRegister(proposalsFailed)
|
prometheus.MustRegister(proposalsFailed)
|
||||||
|
prometheus.MustRegister(slowReadIndex)
|
||||||
prometheus.MustRegister(currentVersion)
|
prometheus.MustRegister(currentVersion)
|
||||||
|
|
||||||
currentVersion.With(prometheus.Labels{
|
currentVersion.With(prometheus.Labels{
|
||||||
|
@ -770,12 +770,14 @@ func (s *EtcdServer) linearizableReadLoop() {
|
|||||||
id2 = binary.BigEndian.Uint64(rs.RequestCtx)
|
id2 = binary.BigEndian.Uint64(rs.RequestCtx)
|
||||||
}
|
}
|
||||||
plog.Warningf("ignored out-of-date read index response; local node read indexes queueing up and waiting to be in sync with leader (request ID want %d, got %d)", id1, id2)
|
plog.Warningf("ignored out-of-date read index response; local node read indexes queueing up and waiting to be in sync with leader (request ID want %d, got %d)", id1, id2)
|
||||||
|
slowReadIndex.Inc()
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-time.After(s.Cfg.ReqTimeout()):
|
case <-time.After(s.Cfg.ReqTimeout()):
|
||||||
plog.Warningf("timed out waiting for read index response")
|
plog.Warningf("timed out waiting for read index response")
|
||||||
nr.notify(ErrTimeout)
|
nr.notify(ErrTimeout)
|
||||||
timeout = true
|
timeout = true
|
||||||
|
slowReadIndex.Inc()
|
||||||
|
|
||||||
case <-s.stopping:
|
case <-s.stopping:
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user