Documentation
¶
Index ¶
- Constants
- func NewMetric(m *Metric, subsystem string) prometheus.Collector
- type ContextHandlerFunc
- type FavContextKeyType
- type Metric
- type Prometheus
- func (p *Prometheus) HandlerFunc() ContextHandlerFunc
- func (p *Prometheus) SetPushGateway()
- func (p *Prometheus) SetPushGatewayJob(j string)
- func (p *Prometheus) SetPushGatewayUrl(pushGatewayURL, metricspath string)
- func (p *Prometheus) SetPushIntervalThreshold(isTurn bool, pushIntervalThreshold int)
- type PushGateway
- type RequestCounterLabelMappingFunc
Constants ¶
View Source
const ( KB float64 = 1 << (10 * iota) MB GB TB )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContextHandlerFunc ¶
type ContextHandlerFunc func(c *contextHttp.HttpContext) error
type FavContextKeyType ¶
type FavContextKeyType string
type Prometheus ¶
type Prometheus struct { Ppg PushGateway MetricsList []*Metric MetricsPath string Subsystem string RequestCounterURLLabelMappingFunc RequestCounterLabelMappingFunc RequestCounterHostLabelMappingFunc RequestCounterLabelMappingFunc URLLabelFromContext string Datacontext context.Context // contains filtered or unexported fields }
func NewPrometheus ¶
func NewPrometheus() *Prometheus
NewPrometheus generates a new set of metrics with a certain subsystem name
func (*Prometheus) HandlerFunc ¶
func (p *Prometheus) HandlerFunc() ContextHandlerFunc
HandlerFunc defines handler function for middleware
func (*Prometheus) SetPushGateway ¶
func (p *Prometheus) SetPushGateway()
func (*Prometheus) SetPushGatewayJob ¶
func (p *Prometheus) SetPushGatewayJob(j string)
func (*Prometheus) SetPushGatewayUrl ¶
func (p *Prometheus) SetPushGatewayUrl(pushGatewayURL, metricspath string)
func (*Prometheus) SetPushIntervalThreshold ¶
func (p *Prometheus) SetPushIntervalThreshold(isTurn bool, pushIntervalThreshold int)
type PushGateway ¶
type PushGateway struct { CounterPush bool PushIntervalSeconds time.Duration PushIntervalThreshold int PushGatewayURL string Job string // contains filtered or unexported fields }
PushGateway contains the configuration for pushing to a Prometheus pushgateway (optional)
type RequestCounterLabelMappingFunc ¶
type RequestCounterLabelMappingFunc func(c *contextHttp.HttpContext) string
Click to show internal directories.
Click to hide internal directories.