Documentation
¶
Index ¶
- type Prometheus
- func (p *Prometheus) HandlerFunc() gin.HandlerFunc
- func (p *Prometheus) SetListenAddress(address string)
- func (p *Prometheus) SetListenAddressWithRouter(listenAddress string, r *gin.Engine)
- func (p *Prometheus) SetMetricsPath(e *gin.Engine)
- func (p *Prometheus) Use(e *gin.Engine)
- func (p *Prometheus) UseCustom(e *gin.Engine)
- type RequestCounterURLLabelMappingFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Prometheus ¶
type Prometheus struct { MetricsPath string // contains filtered or unexported fields }
Prometheus contains the metrics gathered by the instance and its path
func NewPrometheus ¶
func NewPrometheus(subsystem string) *Prometheus
NewPrometheus generates a new set of metrics with a certain subsystem name
func (*Prometheus) HandlerFunc ¶
func (p *Prometheus) HandlerFunc() gin.HandlerFunc
HandlerFunc defines handler function for middleware
func (*Prometheus) SetListenAddress ¶
func (p *Prometheus) SetListenAddress(address string)
SetListenAddress for exposing metrics on address. If not set, it will be exposed at the same address of the gin engine that is being used
func (*Prometheus) SetListenAddressWithRouter ¶
func (p *Prometheus) SetListenAddressWithRouter(listenAddress string, r *gin.Engine)
SetListenAddressWithRouter for using a separate router to expose metrics. (this keeps things like GET /metrics out of your content's access log).
func (*Prometheus) SetMetricsPath ¶
func (p *Prometheus) SetMetricsPath(e *gin.Engine)
SetMetricsPath set metrics paths
func (*Prometheus) Use ¶
func (p *Prometheus) Use(e *gin.Engine)
Use adds the middleware to a gin engine with /metrics route path.
func (*Prometheus) UseCustom ¶ added in v1.5.1
func (p *Prometheus) UseCustom(e *gin.Engine)
UseCustom adds the middleware to a gin engine with a custom route path.
type RequestCounterURLLabelMappingFn ¶
RequestCounterURLLabelMappingFn url label