Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultMinimumRequiredRequests = 1
View Source
const DefaultRequestFailureThreshold = 0.50
Variables ¶
View Source
var ( MARRequests = prometheus.NewCounter(prometheus.CounterOpts{ Name: "mar_requests_total", Help: "Total number of MAR requests sent to HSS", }) MARSendFailures = prometheus.NewCounter(prometheus.CounterOpts{ Name: "mar_send_failures_total", Help: "Total number of MAR requests that failed to send to HSS", }) SARRequests = prometheus.NewCounter(prometheus.CounterOpts{ Name: "sar_requests_total", Help: "Total number of SAR requests sent to HSS", }) SARSendFailures = prometheus.NewCounter(prometheus.CounterOpts{ Name: "sar_send_failures_total", Help: "Total number of SAR requests that failed to send to HSS", }) SwxTimeouts = prometheus.NewCounter(prometheus.CounterOpts{ Name: "swx_timeouts_total", Help: "Total number of swx timeouts", }) SwxUnparseableMsg = prometheus.NewCounter(prometheus.CounterOpts{ Name: "swx_unparseable_msg_total", Help: "Total number of swx messages received that cannot be parsed", }) SwxInvalidSessions = prometheus.NewCounter(prometheus.CounterOpts{ Name: "swx_invalid_sessions_total", Help: "Total number of swx responses received with invalid sids", }) SwxResultCodes = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "swx_result_codes", Help: "swx accumulated result codes", }, []string{"code"}, ) SwxExperimentalResultCodes = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "swx_experimental_result_codes", Help: "swx accumulated experimental result codes", }, []string{"code"}, ) Name: "unauthorized_auth_requests_total", Help: "Total number of authentication requests for un-authorized users", }) // Latency Metrics MARLatency = prometheus.NewSummary(prometheus.SummaryOpts{ Name: "mar_latency", Help: "Latency of MAR Diameter requests (seconds).", Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}, }) SARLatency = prometheus.NewSummary(prometheus.SummaryOpts{ Name: "sar_latency", Help: "Latency of SAR Diameter requests (seconds).", Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}, }) AuthLatency = prometheus.NewSummary(prometheus.SummaryOpts{ Name: "auth_latency", Help: "Latency of Authenticate GRPC requests (seconds).", Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}, }) RegisterLatency = prometheus.NewSummary(prometheus.SummaryOpts{ Name: "register_latency", Help: "Latency of Register GRPC requests (seconds).", Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}, }) DeregisterLatency = prometheus.NewSummary(prometheus.SummaryOpts{ Name: "deregister_latency", Help: "Latency of Deregister GRPC requests (seconds).", Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}, }) )
Prometheus counters are monotonically increasing Counters reset to zero on service restart
Functions ¶
This section is empty.
Types ¶
type SwxHealthMetrics ¶
type SwxHealthMetrics struct { MarTotal int64 MarSendFailures int64 SarTotal int64 SarSendFailures int64 Timeouts int64 UnparseableMsg int64 }
func GetCurrentHealthMetrics ¶
func GetCurrentHealthMetrics() (*SwxHealthMetrics, error)
func (*SwxHealthMetrics) GetDelta ¶
func (prevMetrics *SwxHealthMetrics) GetDelta(currentMetrics *SwxHealthMetrics) (*SwxHealthMetrics, error)
type SwxHealthTracker ¶
type SwxHealthTracker struct { Metrics *SwxHealthMetrics RequestFailureThreshold float32 MinimumRequestThreshold uint32 }
func NewSwxHealthTracker ¶
func NewSwxHealthTracker() *SwxHealthTracker
Click to show internal directories.
Click to hide internal directories.