Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var UseChineseHelpInfo = func() (yes bool) { if val, ok := os.LookupEnv("GINPROM_USE_CHINESE_HELP_INFO"); ok { yes, _ = strconv.ParseBool(val) } return }()
UseChineseHelpInfo control whether to use chinese help information.
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.
type RequestLabelMappingFn ¶
RequestLabelMappingFn request label mapping function returns c.Request.URL.Path by default.
Click to show internal directories.
Click to hide internal directories.