metrics

package
v1.4.12 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPrometheusHandler added in v1.3.2

func NewPrometheusHandler(p *Prometheus) http.Handler

NewPrometheusHandler creates http.Handler with Prometheus registry.

Types

type Prometheus

type Prometheus struct {
	ReqCntURLLabelMappingFn func(c *gin.Context) string
	SkipMetricsURLFn        func(c *gin.Context) bool
	// contains filtered or unexported fields
}

func New added in v1.3.2

func New(cs ...prometheus.Collector) *Prometheus

New creates Prometheus instance with given collectors. Before usage p.Init() must be called.

func NewPrometheus

func NewPrometheus(port int, cs ...prometheus.Collector) *Prometheus

NewPrometheus creates registers collectors and starts metrics server. Deprecated: This function will panic instead of returning error. Use metrics module instead.

func (*Prometheus) AddSkipMetricsURLFn added in v1.2.32

func (p *Prometheus) AddSkipMetricsURLFn(fn func(c *gin.Context) bool)

func (*Prometheus) AddURLMappingFn

func (p *Prometheus) AddURLMappingFn(fn func(c *gin.Context) string)

func (*Prometheus) GetRegistry added in v1.2.31

func (p *Prometheus) GetRegistry() *prometheus.Registry

func (*Prometheus) HandlerFunc

func (p *Prometheus) HandlerFunc() gin.HandlerFunc

func (*Prometheus) Init added in v1.3.2

func (p *Prometheus) Init() (err error)

Jump to

Keyboard shortcuts

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