Merge pull request #2848 from xiang90/metrics

*: use namespace and subsystem in metrics
This commit is contained in:
Xiang Li 2015-05-26 14:44:54 -07:00
commit 42fe370b35
3 changed files with 32 additions and 16 deletions

View File

@ -25,23 +25,31 @@ import (
var ( var (
// TODO: with label in v3? // TODO: with label in v3?
proposeDurations = prometheus.NewSummary(prometheus.SummaryOpts{ proposeDurations = prometheus.NewSummary(prometheus.SummaryOpts{
Name: "etcdserver_proposal_durations_milliseconds", Namespace: "etcd",
Help: "The latency distributions of committing proposal.", Subsystem: "server",
Name: "proposal_durations_milliseconds",
Help: "The latency distributions of committing proposal.",
}) })
proposePending = prometheus.NewGauge(prometheus.GaugeOpts{ proposePending = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "etcdserver_pending_proposal_total", Namespace: "etcd",
Help: "The total number of pending proposals.", Subsystem: "server",
Name: "pending_proposal_total",
Help: "The total number of pending proposals.",
}) })
// This is number of proposal failed in client's view. // This is number of proposal failed in client's view.
// The proposal might be later got committed in raft. // The proposal might be later got committed in raft.
proposeFailed = prometheus.NewCounter(prometheus.CounterOpts{ proposeFailed = prometheus.NewCounter(prometheus.CounterOpts{
Name: "etcdserver_proposal_failed_total", Namespace: "etcd",
Help: "The total number of failed proposals.", Subsystem: "server",
Name: "proposal_failed_total",
Help: "The total number of failed proposals.",
}) })
fileDescriptorUsed = prometheus.NewGauge(prometheus.GaugeOpts{ fileDescriptorUsed = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "file_descriptors_used", Namespace: "etcd",
Help: "The number of file descriptors used", Subsystem: "server",
Name: "file_descriptors_used_totol",
Help: "The total number of file descriptors used.",
}) })
) )

View File

@ -25,15 +25,19 @@ import (
var ( var (
msgSentDuration = prometheus.NewSummaryVec( msgSentDuration = prometheus.NewSummaryVec(
prometheus.SummaryOpts{ prometheus.SummaryOpts{
Name: "rafthttp_message_sent_latency_microseconds", Namespace: "etcd",
Help: "message sent latency distributions.", Subsystem: "rafthttp",
Name: "message_sent_latency_microseconds",
Help: "message sent latency distributions.",
}, },
[]string{"channel", "remoteID", "msgType"}, []string{"channel", "remoteID", "msgType"},
) )
msgSentFailed = prometheus.NewCounterVec(prometheus.CounterOpts{ msgSentFailed = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "rafthttp_message_sent_failed_total", Namespace: "etcd",
Help: "The total number of failed messages sent.", Subsystem: "rafthttp",
Name: "message_sent_failed_total",
Help: "The total number of failed messages sent.",
}, },
[]string{"channel", "remoteID", "msgType"}, []string{"channel", "remoteID", "msgType"},
) )

View File

@ -18,12 +18,16 @@ import "github.com/coreos/etcd/Godeps/_workspace/src/github.com/prometheus/clien
var ( var (
syncDurations = prometheus.NewSummary(prometheus.SummaryOpts{ syncDurations = prometheus.NewSummary(prometheus.SummaryOpts{
Name: "wal_fsync_durations_microseconds", Namespace: "etcd",
Help: "The latency distributions of fsync called by wal.", Subsystem: "wal",
Name: "fsync_durations_microseconds",
Help: "The latency distributions of fsync called by wal.",
}) })
lastIndexSaved = prometheus.NewGauge(prometheus.GaugeOpts{ lastIndexSaved = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "wal_last_index_saved", Namespace: "etcd",
Help: "The index of the last entry saved by wal", Subsystem: "wal",
Name: "last_index_saved",
Help: "The index of the last entry saved by wal.",
}) })
) )