Documentation
¶
Index ¶
- func DecrementQueuesTotal()
- func HTTPMetricsMiddleware(handler http.Handler) http.Handler
- func IncrementBackgroundServiceIterations(service, status string)
- func IncrementBackgroundServiceProcessedMessages(service, queueName string)
- func IncrementCronScheduleExecutions(scheduleID, queueName string)
- func IncrementCronScheduleFailures(scheduleID, queueName string)
- func IncrementDLQIngestion(dlqName, sourceQueue, reason string)
- func IncrementDLQRetry(dlqName, destinationQueue string)
- func IncrementHeartbeatTimeouts(queueName string)
- func IncrementLeaseExpirations(queueName, expiryType string)
- func IncrementLeaseRenewals(queueName, status string)
- func IncrementMessagesDequeued(queueName string)
- func IncrementMessagesEnqueued(queueName string)
- func IncrementMessagesValidated(queueName string)
- func IncrementQueuesTotal()
- func IncrementScheduleActivations(queueName string)
- func IncrementScheduleExecutions(scheduleID, queueName, status string)
- func IncrementValidationFailures(queueName string, reason string)
- func ObserveBackgroundServiceIterationDuration(service string, durationSeconds float64)
- func ObserveDBQuery(backend, operation string, duration time.Duration)
- func ObserveDBTransaction(backend, operation string, duration time.Duration)
- func ObserveMessageClaimLatency(queueName string, duration time.Duration)
- func ObserveMessageProcessingDuration(queueName string, duration time.Duration)
- func RecordGRPCMetrics(method string, duration time.Duration, err error)
- func RecordMessagesCleanedUp(count int64)
- func RecordStateTransition(queueName, fromState, toState string)
- func SetDBConnectionsActive(backend string, count float64)
- func SetDBConnectionsIdle(backend string, count float64)
- func SetDBConnectionsWait(backend string, count float64)
- func SetDLQMessagesTotal(dlqName, sourceQueue string, count float64)
- func SetMessagesByState(queueName, state string, count float64)
- func SetMessagesPending(queueName string, count float64)
- func SetQueuesTotal(count float64)
- func SetScheduleLag(queueName string, lagSeconds float64)
- type MetricsRegistry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecrementQueuesTotal ¶
func DecrementQueuesTotal()
DecrementQueuesTotal decrements the total queue count
func HTTPMetricsMiddleware ¶
HTTPMetricsMiddleware wraps an HTTP handler with Prometheus metrics
func IncrementBackgroundServiceIterations ¶ added in v1.2.0
func IncrementBackgroundServiceIterations(service, status string)
IncrementBackgroundServiceIterations records a background service iteration Service should be: "scheduler" or "reclaim" Status should be: "success" or "error"
func IncrementBackgroundServiceProcessedMessages ¶ added in v1.2.0
func IncrementBackgroundServiceProcessedMessages(service, queueName string)
IncrementBackgroundServiceProcessedMessages records a message processed by a background service Service should be: "scheduler" or "reclaim"
func IncrementCronScheduleExecutions ¶ added in v1.2.0
func IncrementCronScheduleExecutions(scheduleID, queueName string)
IncrementCronScheduleExecutions records a cron schedule execution success
func IncrementCronScheduleFailures ¶ added in v1.2.0
func IncrementCronScheduleFailures(scheduleID, queueName string)
IncrementCronScheduleFailures records a cron schedule failure
func IncrementDLQIngestion ¶ added in v1.2.0
func IncrementDLQIngestion(dlqName, sourceQueue, reason string)
IncrementDLQIngestion records a message being moved to DLQ Reason should be: "max_attempts", "lease_timeout", or "nack"
func IncrementDLQRetry ¶ added in v1.2.0
func IncrementDLQRetry(dlqName, destinationQueue string)
IncrementDLQRetry records a message being retried from DLQ Call this when RetryDLQMessage succeeds
func IncrementHeartbeatTimeouts ¶ added in v1.2.0
func IncrementHeartbeatTimeouts(queueName string)
IncrementHeartbeatTimeouts records a heartbeat timeout event Call this when reclaim service finds a message with expired heartbeat_expiry
func IncrementLeaseExpirations ¶ added in v1.2.0
func IncrementLeaseExpirations(queueName, expiryType string)
IncrementLeaseExpirations records a message being reclaimed due to lease/heartbeat expiry Expiry type should be: "lease" or "heartbeat"
func IncrementLeaseRenewals ¶ added in v1.2.0
func IncrementLeaseRenewals(queueName, status string)
IncrementLeaseRenewals records a lease renewal attempt Status should be: "success", "denied_max_renewals", or "failed"
func IncrementMessagesDequeued ¶
func IncrementMessagesDequeued(queueName string)
IncrementMessagesDequeued increments dequeued message count for a queue
func IncrementMessagesEnqueued ¶
func IncrementMessagesEnqueued(queueName string)
IncrementMessagesEnqueued increments enqueued message count for a queue
func IncrementMessagesValidated ¶ added in v1.2.0
func IncrementMessagesValidated(queueName string)
IncrementMessagesValidated increments validated message count for a queue
func IncrementQueuesTotal ¶
func IncrementQueuesTotal()
IncrementQueuesTotal increments the total queue count
func IncrementScheduleActivations ¶ added in v1.2.0
func IncrementScheduleActivations(queueName string)
IncrementScheduleActivations records a message being activated by the scheduler Call this when scheduler moves a message from INVISIBLE to PENDING
func IncrementScheduleExecutions ¶ added in v1.2.0
func IncrementScheduleExecutions(scheduleID, queueName, status string)
IncrementScheduleExecutions records a schedule execution attempt Status should be: "success" or "failed"
func IncrementValidationFailures ¶ added in v1.2.0
IncrementValidationFailures increments validation failure count for a queue with reason
func ObserveBackgroundServiceIterationDuration ¶ added in v1.2.0
ObserveBackgroundServiceIterationDuration records how long a service iteration took Service should be: "scheduler" or "reclaim"
func ObserveDBQuery ¶ added in v1.2.0
ObserveDBQuery records a database query execution time Backend should be: "sqlite" or "postgres" Operation should be: "claim_message", "enqueue_message", etc.
func ObserveDBTransaction ¶ added in v1.2.0
ObserveDBTransaction records a database transaction execution time This should be called for the entire transaction (begin to commit/rollback)
func ObserveMessageClaimLatency ¶ added in v1.2.0
ObserveMessageClaimLatency records how long it took to claim a message Call this after ClaimMessage operation completes
func ObserveMessageProcessingDuration ¶ added in v1.2.0
ObserveMessageProcessingDuration records how long a message took to process This requires tracking claim time and comparing to ack time
func RecordGRPCMetrics ¶
RecordGRPCMetrics records gRPC request metrics (called from the interceptor)
func RecordMessagesCleanedUp ¶ added in v1.2.0
func RecordMessagesCleanedUp(count int64)
RecordMessagesCleanedUp records the number of messages permanently deleted by cleanup service.
func RecordStateTransition ¶ added in v1.2.0
func RecordStateTransition(queueName, fromState, toState string)
RecordStateTransition records a message state change Use this whenever a message transitions between states
func SetDBConnectionsActive ¶ added in v1.2.0
SetDBConnectionsActive sets the current count of active database connections Call this periodically using sql.DB.Stats().OpenConnections
func SetDBConnectionsIdle ¶ added in v1.2.0
SetDBConnectionsIdle sets the current count of idle database connections Call this periodically using sql.DB.Stats().Idle
func SetDBConnectionsWait ¶ added in v1.2.0
SetDBConnectionsWait sets the current count of connections waiting Call this periodically using sql.DB.Stats().WaitCount
func SetDLQMessagesTotal ¶ added in v1.2.0
SetDLQMessagesTotal sets the current count of messages in a DLQ Call this after DLQ operations or periodically via GetDLQStats
func SetMessagesByState ¶ added in v1.2.0
SetMessagesByState updates the count of messages in a specific state for a queue This should be called periodically (e.g., every 30s) by querying GetQueueState
func SetMessagesPending ¶
SetMessagesPending sets the pending message count for a queue
func SetScheduleLag ¶ added in v1.2.0
SetScheduleLag updates the scheduler lag metric for a queue lagSeconds should be: current_time - scheduled_time Negative values are normal (scheduler runs slightly ahead) Positive values indicate scheduler is behind schedule
Types ¶
type MetricsRegistry ¶
type MetricsRegistry struct {
// contains filtered or unexported fields
}
MetricsRegistry holds the Prometheus registry and provides methods for metrics
func NewMetricsRegistry ¶
func NewMetricsRegistry() *MetricsRegistry
NewMetricsRegistry creates a new metrics registry with all ChronoQueue metrics
func (*MetricsRegistry) Handler ¶
func (m *MetricsRegistry) Handler() http.Handler
Handler returns an HTTP handler for Prometheus metrics