metrics.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2015 CoreOS, Inc.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package etcdserver
  15. import "github.com/coreos/etcd/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus"
  16. var (
  17. // TODO: with label in v3?
  18. proposeDurations = prometheus.NewSummary(prometheus.SummaryOpts{
  19. Name: "etcdserver_proposal_durations_milliseconds",
  20. Help: "The latency distributions of committing proposal.",
  21. })
  22. proposePending = prometheus.NewGauge(prometheus.GaugeOpts{
  23. Name: "etcdserver_pending_proposal_total",
  24. Help: "The total number of pending proposals.",
  25. })
  26. // This is number of proposal failed in client's view.
  27. // The proposal might be later got committed in raft.
  28. proposeFailed = prometheus.NewCounter(prometheus.CounterOpts{
  29. Name: "etcdserver_proposal_failed_total",
  30. Help: "The total number of failed proposals.",
  31. })
  32. )
  33. func init() {
  34. prometheus.MustRegister(proposeDurations)
  35. prometheus.MustRegister(proposePending)
  36. prometheus.MustRegister(proposeFailed)
  37. }