Documentation ¶
Overview ¶
Package metrics bootstrap metrics reporter, and supply 2 metrics registry native prometheus registry and rcrowley/go-metrics registry system registry is the place where go-chassis feed metrics data to you can get system registry and report them to varies monitoring system
Index ¶
- Constants
- Variables
- func GetOrCreateRegistry(name string) metrics.Registry
- func GetSystemPrometheusRegistry() *prometheus.Registry
- func GetSystemRegistry() metrics.Registry
- func HTTPHandleFunc(req *restful.Request, rep *restful.Response)
- func Init() error
- func InstallReporter(name string, reporter Reporter) error
- type Reporter
Constants ¶
const (
// Metrics is the constant string
Metrics = "PrometheusMetrics"
)
constants for header parameters
Variables ¶
var ErrDuplicated = errors.New("duplicated reporter")
ErrDuplicated means you can not install reporter with same name
Functions ¶
func GetOrCreateRegistry ¶
func GetOrCreateRegistry(name string) metrics.Registry
GetOrCreateRegistry return a go-metrics registry which go chassis framework use to report metrics
func GetSystemPrometheusRegistry ¶
func GetSystemPrometheusRegistry() *prometheus.Registry
GetSystemPrometheusRegistry return prometheus registry which go chassis use
func GetSystemRegistry ¶
func GetSystemRegistry() metrics.Registry
GetSystemRegistry return metrics registry which go chassis use
func HTTPHandleFunc ¶
func HTTPHandleFunc(req *restful.Request, rep *restful.Response)
HTTPHandleFunc is a go-restful handler which can expose metrics in http server
func InstallReporter ¶
InstallReporter install reporter implementation