Documentation ¶
Index ¶
- Constants
- func GetOrCreateRegistry(name string) metrics.Registry
- func GetSystemPrometheusRegistry() *prometheus.Registry
- func GetSystemRegistry() metrics.Registry
- func Init() error
- func MetricsHandleFunc(req *restful.Request, rep *restful.Response)
- func ReportMetricsToOpenTSDB(r metrics.Registry)
- func ReportMetricsToPrometheus(r metrics.Registry)
- type PrometheusSinker
Constants ¶
const ( //HeaderUserName is a variable of type string HeaderUserName = "x-user-name" HeaderDomainName = "x-domain-name" ContentType = "Content-Type" Name = "monitor" // Metrics is the constant string Metrics = "PrometheusMetrics" )
constants for header parameters
Variables ¶
This section is empty.
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 MetricsHandleFunc ¶
func MetricsHandleFunc(req *restful.Request, rep *restful.Response)
MetricsHandleFunc is a restful handler which can expose metrics in http server
func ReportMetricsToOpenTSDB ¶
func ReportMetricsToOpenTSDB(r metrics.Registry)
ReportMetricsToOpenTSDB use go-metrics reporter to send metrics to opentsdb
func ReportMetricsToPrometheus ¶
func ReportMetricsToPrometheus(r metrics.Registry)
ReportMetricsToPrometheus report metrics to prometheus registry, you can use GetSystemPrometheusRegistry to get prometheus registry. by default chassis will report system metrics to prometheus
Types ¶
type PrometheusSinker ¶
type PrometheusSinker struct { Registry metrics.Registry // Registry to be exported PromRegistry prometheus.Registerer //Prometheus registry FlushInterval time.Duration //interval to update prom metrics // contains filtered or unexported fields }
PrometheusSinker is the struct for prometheus configuration parameters
var DefaultPrometheusSinker *PrometheusSinker
DefaultPrometheusSinker variable for default prometheus configurations
func GetPrometheusSinker ¶
func GetPrometheusSinker(mr metrics.Registry, pr *prometheus.Registry) *PrometheusSinker
GetPrometheusSinker get prometheus configurations
func NewPrometheusProvider ¶
func NewPrometheusProvider(r metrics.Registry, promRegistry prometheus.Registerer, FlushInterval time.Duration) *PrometheusSinker
NewPrometheusProvider returns the object of prometheus configurations
func (*PrometheusSinker) EnableRunTimeMetrics ¶
func (c *PrometheusSinker) EnableRunTimeMetrics()
EnableRunTimeMetrics enable runtime metrics
func (*PrometheusSinker) UpdatePrometheusMetrics ¶
func (c *PrometheusSinker) UpdatePrometheusMetrics()
UpdatePrometheusMetrics update prometheus metrics
func (*PrometheusSinker) UpdatePrometheusMetricsOnce ¶
func (c *PrometheusSinker) UpdatePrometheusMetricsOnce() error
UpdatePrometheusMetricsOnce update prometheus metrics once