prom

package
v0.0.0-...-e5f2c3d Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PromHandler

func PromHandler(handler http.Handler) gin.HandlerFunc

PromHandler wrappers the standard http.Handler to gin.HandlerFunc

func PromMiddleware

func PromMiddleware(promOpts *PromOpts) gin.HandlerFunc

PromMiddleware returns a gin.HandlerFunc for exporting some Web metrics

Types

type PromOpts

type PromOpts struct {
	ExcludeRegexStatus     string
	ExcludeRegexEndpoint   string
	ExcludeRegexMethod     string
	EndpointLabelMappingFn RequestLabelMappingFn
}

PromOpts represents the Prometheus middleware Options. It is used for filtering labels by regex.

func NewDefaultOpts

func NewDefaultOpts() *PromOpts

NewDefaultOpts return the default ProOpts

type RequestLabelMappingFn

type RequestLabelMappingFn func(c *gin.Context) string

Jump to

Keyboard shortcuts

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