Documentation
¶
Overview ¶
Package metrics contains counters, gauges and assorted metrics for Horde (-core, -radius and -apnd)
Index ¶
- type APNCounters
- func (a *APNCounters) In(apn model.APN, nas model.NAS, t model.MessageTransport)
- func (a *APNCounters) MessageError()
- func (a *APNCounters) MessageForwarded(r model.NASRanges)
- func (a *APNCounters) MessageReceived(r model.NASRanges)
- func (a *APNCounters) MessageRejected(r model.NASRanges)
- func (a *APNCounters) MessageSendError(r model.NASRanges)
- func (a *APNCounters) MessageSent(r model.NASRanges)
- func (a *APNCounters) Out(apn model.APN, nas model.NAS, t model.MessageTransport)
- func (a *APNCounters) Rejected()
- func (a *APNCounters) Start(apnConfig *storage.APNConfigCache)
- type CoreCounters
- type CounterStore
- type DataStoreCounters
- type RADIUSCounters
- func (r *RADIUSCounters) AcceptRequest(nasIdentifier string)
- func (r *RADIUSCounters) IPAllocated(nasIdentifier string)
- func (r *RADIUSCounters) IPReleased(nasIdentifier string)
- func (r *RADIUSCounters) IPReused(nasIdentifier string)
- func (r *RADIUSCounters) RejectRequest(nasIdentifier string)
- func (r *RADIUSCounters) Start(apnConfig *storage.APNConfigCache)
- func (r *RADIUSCounters) UpdateIPAllocation(nasIdentifier string, allocated, free int)
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APNCounters ¶
type APNCounters struct { MessagesReceived *prometheus.CounterVec MessagesSent *prometheus.CounterVec MessageSendErrors *prometheus.CounterVec MessagesForwarded *prometheus.CounterVec MessagesRejected *prometheus.CounterVec MessagesError prometheus.Counter Incoming *prometheus.CounterVec Outgoing *prometheus.CounterVec RequestRejected prometheus.Counter }
APNCounters contains counters for APN. The APN might contain more than one RADIUS server (currently it doesn't but that might change)
var DefaultAPNCounters *APNCounters
DefaultAPNCounters is the default APN counters
func NewAPNCounters ¶
func NewAPNCounters() *APNCounters
NewAPNCounters creates a new set of counters for an APN
func (*APNCounters) In ¶
func (a *APNCounters) In(apn model.APN, nas model.NAS, t model.MessageTransport)
In increments the incoming counter
func (*APNCounters) MessageError ¶
func (a *APNCounters) MessageError()
MessageError increases the error counter
func (*APNCounters) MessageForwarded ¶
func (a *APNCounters) MessageForwarded(r model.NASRanges)
MessageForwarded increases the forwarded counter
func (*APNCounters) MessageReceived ¶
func (a *APNCounters) MessageReceived(r model.NASRanges)
MessageReceived increments the message received counter
func (*APNCounters) MessageRejected ¶
func (a *APNCounters) MessageRejected(r model.NASRanges)
MessageRejected increases the rejected counter
func (*APNCounters) MessageSendError ¶
func (a *APNCounters) MessageSendError(r model.NASRanges)
MessageSendError increases the send error counter
func (*APNCounters) MessageSent ¶
func (a *APNCounters) MessageSent(r model.NASRanges)
MessageSent incmrements the message sent counter
func (*APNCounters) Out ¶
func (a *APNCounters) Out(apn model.APN, nas model.NAS, t model.MessageTransport)
Out increments the outgoing counter
func (*APNCounters) Rejected ¶
func (a *APNCounters) Rejected()
Rejected increments the rejected counter
func (*APNCounters) Start ¶
func (a *APNCounters) Start(apnConfig *storage.APNConfigCache)
Start registers the counters.
type CoreCounters ¶
type CoreCounters struct { UserCount prometheus.Gauge // Total users counter CollectionCount prometheus.Gauge // Total collections DeviceCount prometheus.Gauge // Total devices TeamCount prometheus.Gauge // Total teams OutputCount prometheus.Gauge // Total outputs AuthConnectCount prometheus.Counter // Authenticated requests via CONNECT ID, incl cookies AuthGithubCount prometheus.Counter // Authenticated requests via GitHub, incl cookies AuthTokenCount prometheus.Counter // Authenticated requests with tokens MessagesInCount prometheus.Counter // Incoming messages (aka upstream) MessagesOutCount prometheus.Counter // Sent messages (aka downstream) MessagesForwardMQTT prometheus.Counter // Messages forwarded to MQTT outputs MessagesForwardUDP prometheus.Counter // Messages forwarded to UDP outputs MessagesForwardWebhook prometheus.Counter // Messages forwarded to webhooks MessagesForwardIFTTT prometheus.Counter // Messages forwarded to webhooks HTTPResponse *prometheus.CounterVec // Responses from HTTP API InvitesCreated prometheus.Counter InvitesAccepted prometheus.Counter HTTPResponseTime *prometheus.HistogramVec }
CoreCounters contains counters for the horde core API; users, devices, teams et al.
var DefaultCoreCounters *CoreCounters
DefaultCoreCounters is the default core counters.
func NewCoreCounters ¶
func NewCoreCounters() *CoreCounters
NewCoreCounters creates a new set of Horde core counters with a prefix
func (*CoreCounters) AddHTTPResponseTime ¶
func (c *CoreCounters) AddHTTPResponseTime(method string, t time.Duration)
AddHTTPResponseTime registers response time for a HTTP handler
func (*CoreCounters) AddHTTPStatus ¶
func (c *CoreCounters) AddHTTPStatus(status int)
AddHTTPStatus increments the counters for the HTTP statuses
func (*CoreCounters) Update ¶
func (c *CoreCounters) Update(counterStore CounterStore)
Update updates the counters with values from the counter store
type CounterStore ¶
type CounterStore interface { Users() int64 Collections() int64 Devices() int64 Teams() int64 Outputs() int64 }
CounterStore is a type that reports the initial values for the performance counters. TODO(stalehd): Consider removing this. Just added complexity
type DataStoreCounters ¶
type DataStoreCounters struct { Stored prometheus.Counter Errors prometheus.Counter }
DataStoreCounters holds the counters for the data store
var DefaultStoreCounters *DataStoreCounters
DefaultStoreCounters is the default data store counters
func NewDataStoreCounters ¶
func NewDataStoreCounters() *DataStoreCounters
NewDataStoreCounters creates data store counters
func (*DataStoreCounters) Start ¶
func (d *DataStoreCounters) Start()
Start registers the counters in prometheus
type RADIUSCounters ¶
type RADIUSCounters struct { Accept *prometheus.CounterVec Reject *prometheus.CounterVec Alloc *prometheus.GaugeVec Free *prometheus.GaugeVec Reused *prometheus.CounterVec }
RADIUSCounters holds monitoring counters for a RADIUS endpoint
var DefaultRADIUSCounters *RADIUSCounters
DefaultRADIUSCounters is the default RADIUS counters
func NewRADIUSCounters ¶
func NewRADIUSCounters() *RADIUSCounters
NewRADIUSCounters creates a new set of counters for a RADIUS endpoint. TODO(stalehd): Add an "apn" dimension to these metrics later.
func (*RADIUSCounters) AcceptRequest ¶
func (r *RADIUSCounters) AcceptRequest(nasIdentifier string)
AcceptRequest increments the Accept counter
func (*RADIUSCounters) IPAllocated ¶
func (r *RADIUSCounters) IPAllocated(nasIdentifier string)
IPAllocated increments the Alloc counter and decrements the Free counter
func (*RADIUSCounters) IPReleased ¶
func (r *RADIUSCounters) IPReleased(nasIdentifier string)
IPReleased decrements the Alloc counter and increments the Free counter
func (*RADIUSCounters) IPReused ¶
func (r *RADIUSCounters) IPReused(nasIdentifier string)
IPReused decrements the Alloc counter and increments the Free counter
func (*RADIUSCounters) RejectRequest ¶
func (r *RADIUSCounters) RejectRequest(nasIdentifier string)
RejectRequest increments the Reject counter
func (*RADIUSCounters) Start ¶
func (r *RADIUSCounters) Start(apnConfig *storage.APNConfigCache)
Start registers the RADIUS counters
func (*RADIUSCounters) UpdateIPAllocation ¶
func (r *RADIUSCounters) UpdateIPAllocation(nasIdentifier string, allocated, free int)
UpdateIPAllocation sets the allocation counts
type Server ¶
Server is the monitoring endpoint. The monitoring endpoint provides counters for the service and a resource to do live traces of a running service. Overall performance is affected by the trace so use with caution on running systems under load.
func NewMonitoringServer ¶
NewMonitoringServer creates a new monitoring endpoint