metrics

package
v0.0.0-...-36f27ca Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelHandler     = "handler"
	LabelHTTPStatus  = "status_code"
	LabelOrigin      = "origin"
	LabelProcessName = "process_name"
	LabelAppCode     = "app_code"
	LabelHost        = "host"
)
View Source
const (
	Namespace = "mon"
)
View Source
const (
	SelectedRoutePath string = "SelectedRoutePath"
)

Variables

This section is empty.

Functions

func Register

func Register() prometheus.Registerer

Types

type Option

type Option func(s *Service)

func ProcessInstance

func ProcessInstance(instance string) Option

ProcessInstance 进程实例ip:port

func ProcessName

func ProcessName(name string) Option

ProcessName 进程实例名称

type Service

type Service struct {
	ProcessName     string
	ProcessInstance string
	// contains filtered or unexported fields
}

func NewServer

func NewServer(opts ...Option) *Service

func (*Service) HTTPMiddleware

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

func (*Service) Registry

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

func (*Service) RestfulMiddleWare

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

func (*Service) RestfulWebService

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

RestfulWebService is the http WebService for go-restful framework

func (*Service) ServerHTTP

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

Jump to

Keyboard shortcuts

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