Documentation ¶
Index ¶
- Constants
- Variables
- func CreateTelemetryHandle(version, aiMetadata string) error
- func DecIPSetInventory(setName string)
- func GetIPSetInventory(setName string) int
- func GetIPSetInventoryLabels(setName string) prometheus.Labels
- func IncIPSetInventory(setName string)
- func InitializeAll()
- func SendErrorLogAndMetric(operationID int, format string, args ...interface{})
- func SendLog(report aitelemetry.Report)
- func SendMetric(metric aitelemetry.Metric)
- func SetIPSetInventory(setName string, val int)
- func StartHTTP(delayAmountAfterStart 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 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 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 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.
func StartHTTP ¶ added in v1.1.5
func StartHTTP(delayAmountAfterStart int)
StartHTTP starts a HTTP server in a Go routine with endpoint on port 8000. Metrics are exposed on the endpoint /metrics. By being exposed, the metrics can be scraped by a Prometheus Server or Container Insights. The function will pause for delayAmountAfterStart seconds after starting the HTTP server for the first time.
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