Documentation ¶
Index ¶
Constants ¶
View Source
const ( CounterVec = "counter_vec" Counter = "counter" GaugeVec = "gauge_vec" Gauge = "gauge" HistogramVec = "histogram_vec" Histogram = "histogram" SummaryVec = "summary_vec" Summary = "summary" )
Variables ¶
This section is empty.
Functions ¶
func NewMetric ¶
func NewMetric(m *Metric, subsystem string) prometheus.Collector
NewMetric associates prometheus.Collector based on Metric.Type
func PrometheusHttpHandler ¶
PrometheusHandler metrics指标httpHandler
Types ¶
type Metric ¶
type Metric struct { MetricCollector prometheus.Collector ID string Name string Description string Type string Args []string }
Metric is a definition for the name, description, type, ID, and prometheus.Collector type (i.e. CounterVec, Summary, etc) of each metric
type Prometheus ¶
type Prometheus struct { ReqCnt *prometheus.CounterVec // 请求量指标 SrvErrCnt *prometheus.CounterVec // 服务异常指标 DurSummary *prometheus.SummaryVec // 耗时指标 MetricsList []*Metric MetricsPath string // contains filtered or unexported fields }
Prometheus contains the metrics gathered by the instance and its path
func NewPrometheus ¶
func NewPrometheus(subsystem string) *Prometheus
NewPrometheus generates a new set of metrics with a certain subsystem name
func PromeHandler ¶
func PromeHandler() *Prometheus
func (*Prometheus) PromeMetrics ¶
func (p *Prometheus) PromeMetrics(name string) prometheus.Collector
func (*Prometheus) RegisterCustomerMetrics ¶
func (p *Prometheus) RegisterCustomerMetrics(name string, Desc string, MetrixType string, Args []string) *Prometheus
Click to show internal directories.
Click to hide internal directories.