Documentation ¶
Index ¶
- func CounterAdd(name string, val float64, labels map[string]string) error
- func CounterValue(name string, labels map[string]string) float64
- func CreateCounter(opts CounterOpts) error
- func CreateGauge(opts GaugeOpts) error
- func CreateHistogram(opts HistogramOpts) error
- func CreateSummary(opts SummaryOpts) error
- func EnableRunTimeMetrics()
- func GaugeAdd(name string, val float64, labels map[string]string) error
- func GaugeSet(name string, val float64, labels map[string]string) error
- func GaugeValue(name string, labels map[string]string) float64
- func GetSystemPrometheusRegistry() *prometheus.Registry
- func HistogramObserve(name string, val float64, labels map[string]string) error
- func Init() error
- func InstallPlugin(name string, f NewRegistry)
- func Reset(name string) error
- func Split(key string) (string, string, string)
- func SummaryObserve(name string, val float64, labels map[string]string) error
- func SummaryValue(name string, labels map[string]string) (uint64, float64)
- 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) CounterValue(name string, labels map[string]string) float64
- 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) GaugeAdd(name string, val float64, labels map[string]string) error
- func (c *PrometheusExporter) GaugeSet(name string, val float64, labels map[string]string) error
- func (c *PrometheusExporter) GaugeValue(name string, labels map[string]string) float64
- func (c *PrometheusExporter) HistogramObserve(name string, val float64, labels map[string]string) error
- func (c *PrometheusExporter) Reset(name string) error
- func (c *PrometheusExporter) SummaryObserve(name string, val float64, labels map[string]string) error
- func (c *PrometheusExporter) SummaryValue(name string, labels map[string]string) (uint64, float64)
- type Registry
- type SummaryOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CounterAdd ¶
CounterAdd increase value of a collector
func CounterValue ¶ added in v2.7.0
func CreateCounter ¶
func CreateCounter(opts CounterOpts) error
CreateCounter init a new counter type
func CreateHistogram ¶
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 GetSystemPrometheusRegistry ¶
func GetSystemPrometheusRegistry() *prometheus.Registry
GetSystemPrometheusRegistry return prometheus registry which go chassis use
func HistogramObserve ¶
HistogramObserve gives a value to histogram collector
func InstallPlugin ¶
func InstallPlugin(name string, f NewRegistry)
InstallPlugin install metrics registry
func SummaryObserve ¶
SummaryObserve gives a value to summary collector
Types ¶
type CounterOpts ¶
type CounterOpts struct { // Key is the key set joining with '_', Name will be ignored when Key is not empty Key string Name string Help string Labels []string }
CounterOpts is options to create a counter options
type HistogramOpts ¶
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) CounterValue ¶ added in v2.7.0
func (c *PrometheusExporter) CounterValue(name string, labels map[string]string) float64
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 ¶
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) GaugeValue ¶ added in v2.7.0
func (c *PrometheusExporter) GaugeValue(name string, labels map[string]string) float64
func (*PrometheusExporter) HistogramObserve ¶
func (c *PrometheusExporter) HistogramObserve(name string, val float64, labels map[string]string) error
HistogramObserve set value
func (*PrometheusExporter) Reset ¶ added in v2.3.0
func (c *PrometheusExporter) Reset(name string) error
Reset reset a collector metrics
func (*PrometheusExporter) SummaryObserve ¶
func (c *PrometheusExporter) SummaryObserve(name string, val float64, labels map[string]string) error
SummaryObserve set value
func (*PrometheusExporter) SummaryValue ¶ added in v2.7.0
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 GaugeAdd(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 GaugeValue(name string, labels map[string]string) float64 CounterValue(name string, labels map[string]string) float64 SummaryValue(name string, labels map[string]string) (uint64, float64) Reset(name 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