Resubmit a stored event as a new undelivered event (closes #250)
All checks were successful
check / check (push) Successful in 3m1s

This commit was merged in pull request #251.
This commit is contained in:
2026-08-24 00:53:37 +02:00
parent a83e8fe654
commit 89f3b984d2
11 changed files with 1279 additions and 148 deletions

View File

@@ -83,6 +83,7 @@ type Set struct {
deliveriesFailed *prometheus.CounterVec
deliveryRetries *prometheus.CounterVec
deliveryReplays *prometheus.CounterVec
eventsResubmitted prometheus.Counter
deliveryDuration *prometheus.HistogramVec
deliveriesPending *prometheus.GaugeVec
deliveriesRetrying *prometheus.GaugeVec
@@ -166,6 +167,23 @@ func (s *Set) DeliveryReplayed(t database.TargetType) {
Inc()
}
// EventResubmitted counts one stored event an operator re-injected
// from the event log.
//
// It counts the operator action once, not the deliveries it fans out
// to: those already move the attempt, outcome and duration series, and
// the new event moves events_received_total, since it is a stored
// event that the delivery side will be compared against. This counter
// is what separates a resubmitted event from a received one.
//
// It carries no labels. The only label available at the call site
// would be the route pattern, which has exactly one value and so would
// distinguish nothing; the target types the event fans out to belong
// to the delivery series, not to this one.
func (s *Set) EventResubmitted() {
s.eventsResubmitted.Inc()
}
// DeliveryStatusChanged counts a delivery's transition into a new
// status. The mapping from status to counter lives here, next to the
// collectors, so the engine has a single call for every transition it
@@ -298,6 +316,15 @@ func (s *Set) registerCounters(factory promauto.Factory) {
},
[]string{targetTypeLabel},
)
s.eventsResubmitted = factory.NewCounter(
prometheus.CounterOpts{
Namespace: namespace,
Name: "events_resubmitted_total",
Help: "Stored events an operator re-injected from " +
"the event log as new events.",
},
)
}
func (s *Set) registerGauges(factory promauto.Factory) {