Documentation
¶
Overview ¶
Package metrics provides Prometheus metrics for the application.
Index ¶
- Constants
- func Handler() http.Handler
- func Reset()
- type PrometheusCollector
- func (c *PrometheusCollector) RecordConfigReload(success bool, rulesCount int)
- func (c *PrometheusCollector) RecordDBUpdate(entries map[ipinfo.DBSource]uint64, duration time.Duration)
- func (c *PrometheusCollector) RecordInvalidRequest(duration time.Duration)
- func (c *PrometheusCollector) RecordRequest(status string, country string, method string, duration time.Duration, ...)
Constants ¶
View Source
const ( StatusAllowed = "allowed" StatusDenied = "denied" StatusInvalid = "invalid" )
Status label values for the requests counter.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PrometheusCollector ¶ added in v0.5.2
type PrometheusCollector struct{}
PrometheusCollector implements the Collector interface using Prometheus metrics.
func NewCollector ¶ added in v0.5.2
func NewCollector() *PrometheusCollector
NewCollector creates a new PrometheusCollector.
func (*PrometheusCollector) RecordConfigReload ¶ added in v0.5.2
func (c *PrometheusCollector) RecordConfigReload(success bool, rulesCount int)
RecordConfigReload records a config reload attempt.
func (*PrometheusCollector) RecordDBUpdate ¶ added in v0.5.2
func (c *PrometheusCollector) RecordDBUpdate( entries map[ipinfo.DBSource]uint64, duration time.Duration, )
RecordDBUpdate records an IP database update.
func (*PrometheusCollector) RecordInvalidRequest ¶ added in v0.5.2
func (c *PrometheusCollector) RecordInvalidRequest(duration time.Duration)
RecordInvalidRequest records metrics for an invalid request.
Click to show internal directories.
Click to hide internal directories.