← Graph

Retry Error Wrapper Pattern

concept 1 connections

Pattern to avoid paying monitoring services for errors that will still be retried: define an error wrapper class that inherits from StandardError and stores a reference to the original error; inside the job rescue the original error and re-raise it wrapped. Configure the monitoring SDK to ignore the wrapper class so retries don't flood the service. Implement Sidekiq's sidekiq_retries_exhausted hook to report the final error once no more retries will occur, so only genuinely final failures reach the monitoring service.

category
pattern
about
Retry Error Wrapper Pattern concept
Shows how to wrap non-final errors so monitoring only receives final failures via sidekiq_retries_exhausted.

Provenance

Read by
2 extractions