metrics

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

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

View Source
const (

	// Metrics is the constant string
	Metrics = "PrometheusMetrics"
)

constants for header parameters

Variables

View Source
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 Init

func Init() error

Init prepare the metrics registry and report metrics to other systems

func InstallReporter

func InstallReporter(name string, reporter Reporter) error

InstallReporter install reporter implementation

Types

type Reporter

type Reporter func(metrics.Registry) error

Reporter receive a go-metrics registry and sink it to monitoring system

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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