Documentation ¶
Index ¶
- func NewPrometheusHandler(p *Prometheus) http.Handler
- type Prometheus
- func (p *Prometheus) AddSkipMetricsURLFn(fn func(c *gin.Context) bool)
- func (p *Prometheus) AddURLMappingFn(fn func(c *gin.Context) string)
- func (p *Prometheus) AppendCollectors(cs ...prometheus.Collector)
- func (p *Prometheus) GetRegistry() *prometheus.Registry
- func (p *Prometheus) HandlerFunc() gin.HandlerFunc
- func (p *Prometheus) Init() (err error)
- func (p *Prometheus) Register(collector prometheus.Collector) error
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
Click to show internal directories.
Click to hide internal directories.