Documentation ¶
Index ¶
- Constants
- Variables
- func CreateTelemetryHandle(version, aiMetadata string) error
- func DecIPSetInventory(setName string)
- func GetHandler(isNodeLevel bool) http.Handler
- func GetIPSetInventory(setName string) int
- func GetIPSetInventoryLabels(setName string) prometheus.Labels
- func GetRegistry(isNodeLevel bool) *prometheus.Registry
- func IncIPSetInventory(setName string)
- func InitializeAll()
- func ReInitializeAllMetrics()
- func SendErrorLogAndMetric(operationID int, format string, args ...interface{})
- func SendLog(report aitelemetry.Report)
- func SendMetric(metric aitelemetry.Metric)
- func SetIPSetInventory(setName string, val int)
- type Timer
Constants ¶
const ( SetNameLabel = "set_name" SetHashLabel = "set_hash" )
Constants for metric names and descriptions as well as exported labels for Vector metrics
Variables ¶
var ( NumPolicies prometheus.Gauge AddPolicyExecTime prometheus.Summary NumIPTableRules prometheus.Gauge AddIPTableRuleExecTime prometheus.Summary NumIPSets prometheus.Gauge AddIPSetExecTime prometheus.Summary NumIPSetEntries prometheus.Gauge // IPSetInventory should not be referenced directly. Use the functions in ipset-inventory.go IPSetInventory *prometheus.GaugeVec )
Prometheus Metrics Gauge metrics have the methods Inc(), Dec(), and Set(float64) Summary metrics has the method Observe(float64) For any Vector metric, you can call With(prometheus.Labels) before the above methods
e.g. SomeGaugeVec.With(prometheus.Labels{label1: val1, label2: val2, ...).Dec()
Functions ¶
func CreateTelemetryHandle ¶
CreateTelemetryHandle creates a handler to initialize AI telemetry
func DecIPSetInventory ¶ added in v1.1.7
func DecIPSetInventory(setName string)
DecIPSetInventory decreases the number of entries in an IPSet and updates a Prometheus metric.
func GetHandler ¶
getHandler returns the HTTP handler for the metrics endpoint
func GetIPSetInventory ¶ added in v1.1.7
GetIPSetInventory returns the number of entries in an IPSet, or 0 if the set doesn't exist.
func GetIPSetInventoryLabels ¶ added in v1.1.7
func GetIPSetInventoryLabels(setName string) prometheus.Labels
GetIPSetInventoryLabels returns the labels for the IPSetInventory GaugeVec for a given setName.
func GetRegistry ¶ added in v1.2.8
func GetRegistry(isNodeLevel bool) *prometheus.Registry
func IncIPSetInventory ¶ added in v1.1.7
func IncIPSetInventory(setName string)
IncIPSetInventory increases the number of entries in an IPSet and updates a Prometheus metric.
func InitializeAll ¶
func InitializeAll()
InitializeAll creates all the Prometheus Metrics. The metrics will be nil before this method is called.
func ReInitializeAllMetrics ¶ added in v1.2.9
func ReInitializeAllMetrics()
func SendErrorLogAndMetric ¶
SendErrorLogAndMetric is responsible for sending log and error metrics through AI telemetry
func SetIPSetInventory ¶ added in v1.1.7
SetIPSetInventory sets the number of entries in an IPSet and updates a Prometheus metric.
Types ¶
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
Timer is a one-time-use tool for recording time between a start and end point
func (*Timer) StopAndRecord ¶ added in v1.1.5
func (timer *Timer) StopAndRecord(observer prometheus.Summary)
StopAndRecord ends a timer and records its delta in a summary