metrics

package
v2.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPrometheusHandler

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

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, error)

NewPrometheus creates registers collectors and starts metrics server.

func (*Prometheus) AddSkipMetricsURLFn

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) AppendCollectors added in v2.1.11

func (p *Prometheus) AppendCollectors(cs ...prometheus.Collector)

func (*Prometheus) GetRegistry

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

func (*Prometheus) HandlerFunc

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

func (*Prometheus) Init

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

func (*Prometheus) Register added in v2.1.2

func (p *Prometheus) Register(collector prometheus.Collector) error

Jump to

Keyboard shortcuts

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