metrics

package
v0.0.0-...-cb472e6 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelHandler     = "handler"
	LabelHTTPStatus  = "status_code"
	LabelOrigin      = "origin"
	LabelProcessName = "process_name"
	LabelHost        = "host"
	LabelAppCode     = "app_code"
	LabelUser        = "user"
	LabelRealIP      = "real_ip"
)

labels

View Source
const (
	KeySelectedRoutePath string = "SelectedRoutePath"
)

labels

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ProcessName     string
	ProcessInstance string
}

Config metrics config

type Gauge

type Gauge struct {
	// contains filtered or unexported fields
}

func NewGauge

func NewGauge(opt prometheus.GaugeOpts) *Gauge

func (*Gauge) Add

func (g *Gauge) Add(val float64) uint64

func (*Gauge) Collect

func (g *Gauge) Collect(ch chan<- prometheus.Metric)

func (*Gauge) Dec

func (g *Gauge) Dec()

func (*Gauge) Describe

func (g *Gauge) Describe(ch chan<- *prometheus.Desc)

func (*Gauge) Inc

func (g *Gauge) Inc()

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service an http service

func NewService

func NewService(conf Config) *Service

NewService returns new metrics service

func (*Service) HTTPMiddleware

func (s *Service) HTTPMiddleware(next http.Handler) http.Handler

HTTPMiddleware is the http middleware for go-restful framework

func (*Service) Registry

func (s *Service) Registry() prometheus.Registerer

Registry returns the prometheus.Registerer

func (*Service) RestfulMiddleWare

func (s *Service) RestfulMiddleWare(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)

RestfulMiddleWare is the http middleware for go-restful framework

func (*Service) RestfulWebService

func (s *Service) RestfulWebService() *restful.WebService

RestfulWebService is the http WebService for go-restful framework

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(resp http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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