prome

package
v0.5.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

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

func PrometheusHttpHandler() http.Handler

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL