Documentation ¶
Index ¶
- func CounterAdd(name string, val float64, labels map[string]string) error
- func CreateCounter(opts CounterOpts) error
- func CreateGauge(opts GaugeOpts) error
- func CreateHistogram(opts HistogramOpts) error
- func CreateSummary(opts SummaryOpts) error
- func EnableRunTimeMetrics()
- func GaugeSet(name string, val float64, labels map[string]string) error
- func GetSystemPrometheusRegistry() *prometheus.Registry
- func HTTPHandleFunc(req *restful.Request, rep *restful.Response)
- func HistogramObserve(name string, val float64, labels map[string]string) error
- func Init() error
- func InstallPlugin(name string, f NewRegistry)
- func SummaryObserve(name string, val float64, labels map[string]string) error
- type CounterOpts
- type GaugeOpts
- type HistogramOpts
- type NewRegistry
- type Options
- type PrometheusExporter
- func (c *PrometheusExporter) CounterAdd(name string, val float64, labels map[string]string) error
- func (c *PrometheusExporter) CreateCounter(opts CounterOpts) error
- func (c *PrometheusExporter) CreateGauge(opts GaugeOpts) error
- func (c *PrometheusExporter) CreateHistogram(opts HistogramOpts) error
- func (c *PrometheusExporter) CreateSummary(opts SummaryOpts) error
- func (c *PrometheusExporter) GaugeSet(name string, val float64, labels map[string]string) error
- func (c *PrometheusExporter) HistogramObserve(name string, val float64, labels map[string]string) error
- func (c *PrometheusExporter) SummaryObserve(name string, val float64, labels map[string]string) error
- type Registry
- type SummaryOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CounterAdd ¶
CounterAdd increase value of a collector
func CreateCounter ¶
func CreateCounter(opts CounterOpts) error
CreateCounter init a new counter type
func CreateHistogram ¶ added in v1.3.0
func CreateHistogram(opts HistogramOpts) error
CreateHistogram init a new summary type
func CreateSummary ¶
func CreateSummary(opts SummaryOpts) error
CreateSummary init a new summary type
func EnableRunTimeMetrics ¶ added in v1.7.2
func EnableRunTimeMetrics()
EnableRunTimeMetrics enable runtime metrics
func GetSystemPrometheusRegistry ¶
func GetSystemPrometheusRegistry() *prometheus.Registry
GetSystemPrometheusRegistry return prometheus registry which go chassis use
func HTTPHandleFunc ¶ added in v1.4.1
func HTTPHandleFunc(req *restful.Request, rep *restful.Response)
HTTPHandleFunc is a go-restful handler which can expose metrics in http server
func HistogramObserve ¶ added in v1.3.0
HistogramObserve gives a value to histogram collector
func InstallPlugin ¶
func InstallPlugin(name string, f NewRegistry)
InstallPlugin install metrics registry
Types ¶
type CounterOpts ¶
CounterOpts is options to create a counter options
type HistogramOpts ¶ added in v1.3.0
HistogramOpts is options to create histogram collector
type PrometheusExporter ¶
type PrometheusExporter struct { FlushInterval time.Duration // contains filtered or unexported fields }
PrometheusExporter is a prom exporter for go chassis
func (*PrometheusExporter) CounterAdd ¶
CounterAdd increase value
func (*PrometheusExporter) CreateCounter ¶
func (c *PrometheusExporter) CreateCounter(opts CounterOpts) error
CreateCounter create collector
func (*PrometheusExporter) CreateGauge ¶
func (c *PrometheusExporter) CreateGauge(opts GaugeOpts) error
CreateGauge create collector
func (*PrometheusExporter) CreateHistogram ¶ added in v1.3.0
func (c *PrometheusExporter) CreateHistogram(opts HistogramOpts) error
CreateHistogram create collector
func (*PrometheusExporter) CreateSummary ¶
func (c *PrometheusExporter) CreateSummary(opts SummaryOpts) error
CreateSummary create collector
func (*PrometheusExporter) HistogramObserve ¶ added in v1.3.0
func (c *PrometheusExporter) HistogramObserve(name string, val float64, labels map[string]string) error
HistogramObserve set value
func (*PrometheusExporter) SummaryObserve ¶
func (c *PrometheusExporter) SummaryObserve(name string, val float64, labels map[string]string) error
SummaryObserve set value
type Registry ¶
type Registry interface { CreateGauge(opts GaugeOpts) error CreateCounter(opts CounterOpts) error CreateSummary(opts SummaryOpts) error CreateHistogram(opts HistogramOpts) error GaugeSet(name string, val float64, labels map[string]string) error CounterAdd(name string, val float64, labels map[string]string) error SummaryObserve(name string, val float64, Labels map[string]string) error HistogramObserve(name string, val float64, labels map[string]string) error }
Registry holds all of metrics collectors name is a unique ID for different type of metrics
func NewPrometheusExporter ¶
NewPrometheusExporter create a prometheus exporter