Documentation
¶
Index ¶
- Variables
- func AddHandlerMetrics(handlerName string)
- func GetFailureCountByMessageTypeAndHandlerName(messageType, handlerName string) (float64, error)
- func GetLatencySampleCountByMessageTypeAndHandlerName(messageType, handlerName string) (*uint64, error)
- func GetRejectedMessagesValue() (float64, error)
- func GetSagaTimeoutCounterValue() (float64, error)
- func GetSuccessCountByMessageTypeAndHandlerName(messageType, handlerName string) (float64, error)
- func ReportRejectedMessage()
- func ResetRejectedMessagesCounter()
- func RunHandlerWithMetric(handleMessage func() error, handlerName, messageType string, ...) error
- type HandlerMetrics
Constants ¶
This section is empty.
Variables ¶
var ( //SagaTimeoutCounter is the prometheus counter counting timed out saga instances SagaTimeoutCounter = promauto.NewCounter(prometheus.CounterOpts{ Namespace: grabbitPrefix, Subsystem: "saga", Name: "timedout_sagas", Help: "counting the number of timedout saga instances", }) //SagaLatencySummary is the prometheus summary for the total duration of a saga SagaLatencySummary = promauto.NewSummaryVec(prometheus.SummaryOpts{ Namespace: grabbitPrefix, Subsystem: "saga", Name: "latency", Help: "The latency of the entire saga", }, []string{"Service", "SagaType", "Initiator"}) )
var OutboxSize = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: grabbitPrefix,
Name: "outbox_total_records",
Subsystem: "outbox",
Help: "reports the total amount of records currently in the outbox",
})
var PendingMessages = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: grabbitPrefix,
Name: "outbox_pending_delivery",
Subsystem: "outbox",
Help: "reports the total amount of records pending delivery currently in the outbox",
})
var SentMessages = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: grabbitPrefix,
Name: "outbox_pending_removal",
Subsystem: "outbox",
Help: "reports the total amount of records that were sent and pending removal currently in the outbox",
})
Functions ¶
func AddHandlerMetrics ¶
func AddHandlerMetrics(handlerName string)
AddHandlerMetrics adds a handler to be tracked with metrics
func GetFailureCountByMessageTypeAndHandlerName ¶ added in v1.1.2
GetFailureCountByMessageTypeAndHandlerName gets the counter value for the failed handlers' run for a given message type and handler's name
func GetLatencySampleCountByMessageTypeAndHandlerName ¶ added in v1.1.2
func GetLatencySampleCountByMessageTypeAndHandlerName(messageType, handlerName string) (*uint64, error)
GetLatencySampleCountByMessageTypeAndHandlerName gets the summary sample count value for the handlers' run for a given message type and handler's name
func GetRejectedMessagesValue ¶
GetRejectedMessagesValue gets the value of the rejected message counter
func GetSagaTimeoutCounterValue ¶
GetSagaTimeoutCounterValue gets the counter value of timed out sagas reported to prometheus
func GetSuccessCountByMessageTypeAndHandlerName ¶ added in v1.1.2
GetSuccessCountByMessageTypeAndHandlerName gets the counter value for the successful handlers' run for a given message type and handler's name
func ReportRejectedMessage ¶
func ReportRejectedMessage()
ReportRejectedMessage reports a message being rejected to the metrics counter
func ResetRejectedMessagesCounter ¶ added in v1.1.1
func ResetRejectedMessagesCounter()
ResetRejectedMessagesCounter resets the counter intended to be used in tests only
func RunHandlerWithMetric ¶
func RunHandlerWithMetric(handleMessage func() error, handlerName, messageType string, logger logrus.FieldLogger) error
RunHandlerWithMetric runs a specific handler with metrics being collected and reported to prometheus
Types ¶
type HandlerMetrics ¶ added in v1.1.3
type HandlerMetrics struct {
// contains filtered or unexported fields
}
HandlerMetrics holds the metrics results for a handler
func GetHandlerMetrics ¶
func GetHandlerMetrics(handlerName string) *HandlerMetrics
GetHandlerMetrics gets the metrics handler associated with the handlerName
func (*HandlerMetrics) GetFailureCount ¶ added in v1.1.3
func (hm *HandlerMetrics) GetFailureCount() (float64, error)
GetFailureCount gets the value of the handlers failure value
func (*HandlerMetrics) GetLatencySampleCount ¶ added in v1.1.3
func (hm *HandlerMetrics) GetLatencySampleCount() (*uint64, error)
GetLatencySampleCount gets the value of the handlers latency value
func (*HandlerMetrics) GetSuccessCount ¶ added in v1.1.3
func (hm *HandlerMetrics) GetSuccessCount() (float64, error)
GetSuccessCount gets the value of the handlers success value