metrics

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2020 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMinimumRequiredRequests = 1
View Source
const DefaultRequestFailureThreshold = 0.50

Variables

View Source
var (
	AIRRequests = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "air_requests_total",
		Help: "Total number of AIR requests sent to HSS",
	})
	AIRSendFailures = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "air_send_failures_total",
		Help: "Total number of AIR requests that failed to send to HSS",
	})
	ULRRequests = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "ulr_requests_total",
		Help: "Total number of ULR requests sent to HSS",
	})
	ULRSendFailures = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "ulr_send_failures_total",
		Help: "Total number of ULR requests that failed to send to HSS",
	})
	S6aTimeouts = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "s6a_timeouts_total",
		Help: "Total number of s6a timeouts",
	})
	S6aUnparseableMsg = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "s6a_unparseable_msg_total",
		Help: "Total number of s6a messages received that cannot be parsed",
	})
	S6aResultCodes = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "s6a_result_codes",
			Help: "S6a accumulated result codes",
		},
		[]string{"code"},
	)
	S6aSuccessTimestamp = prometheus.NewGauge(prometheus.GaugeOpts{
		Name: "s6a_success_timestamp",
		Help: "Timestamp of the last successfully completed s6a request",
	})
	S6aFailuresSinceLastSuccess = prometheus.NewGauge(prometheus.GaugeOpts{
		Name: "s6a_failures_since_last_success",
		Help: "The total number of s6a request failures since the last successful request completed",
	})
	// Latencies
	AIRLatency = prometheus.NewSummary(prometheus.SummaryOpts{
		Name:       "air_lat",
		Help:       "Latency of AIR requests (milliseconds).",
		Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
	})
	ULRLatency = prometheus.NewSummary(prometheus.SummaryOpts{
		Name:       "ulr_lat",
		Help:       "Latency of ULR requests (milliseconds).",
		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

func UpdateS6aRecentRequestMetrics

func UpdateS6aRecentRequestMetrics(err error)

Types

type S6aHealthMetrics

type S6aHealthMetrics struct {
	AirTotal        int64
	AirSendFailures int64
	UlrTotal        int64
	UlrSendFailures int64
	Timeouts        int64
	UnparseableMsg  int64
}

func GetCurrentHealthMetrics

func GetCurrentHealthMetrics() (*S6aHealthMetrics, error)

func (*S6aHealthMetrics) GetDelta

func (prevMetrics *S6aHealthMetrics) GetDelta(currentMetrics *S6aHealthMetrics) (*S6aHealthMetrics, error)

type S6aHealthTracker

type S6aHealthTracker struct {
	Metrics                 *S6aHealthMetrics
	RequestFailureThreshold float32
	MinimumRequestThreshold uint32
}

func NewS6aHealthTracker

func NewS6aHealthTracker() *S6aHealthTracker

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL