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)
Click to show internal directories.
Click to hide internal directories.