Skip to content

Conversation

@prosdev
Copy link
Contributor

@prosdev prosdev commented Jan 15, 2026

Summary

Implement production-grade error store for failed events using GCS + BigQuery.

Changes

Core Implementation

  • GCSErrorStore: Parquet-based error storage with Hive partitioning
  • ErrorRecord model: Full event context with error details
  • Updated ErrorStore protocol: Better interface for error handling

Integration

  • Processor: Catches validation and processing errors
  • Two error types:
    • validation_error (expected failures)
    • processing_error (unexpected exceptions with stack traces)
  • Never loses data: All failures stored with full context

Storage Structure

gs://bucket/errors/
  date=YYYY-MM-DD/
    error_type=validation/
    error_type=processing/

BigQuery Support

  • Table schema with partitioning and clustering
  • Example queries for debugging
  • 30-day retention with metadata tracking

Documentation

  • README section on error store
  • BigQuery setup instructions
  • Query examples for pattern analysis

Tests

  • 10 new unit tests for GCSErrorStore
  • Updated processor tests for new interface
  • 252 total tests passing

Add GCS-based error store for failed events:
- ErrorRecord model with full event context
- GCSErrorStore with Hive-style partitioning (date + error_type)
- Parquet format for BigQuery compatibility
- Retry logic with tenacity
- Health check support

Storage structure:
- errors/date=YYYY-MM-DD/error_type=validation/
- errors/date=YYYY-MM-DD/error_type=processing/

Tests:
- 10 unit tests (all passing)
- ErrorRecord model validation
- Path generation logic
- Store operations with mocked GCS
Update ErrorStore protocol and Processor integration:
- Updated ErrorStore protocol to match GCSErrorStore interface
- Updated LoggingErrorStore for compatibility
- Processor now catches all exceptions and stores to ErrorStore
- Two error types: validation_error (expected) and processing_error (unexpected)
- Updated dependencies to use GCSErrorStore instead of LoggingErrorStore
- Updated processor tests to match new interface

Error handling:
- Validation failures → validation_error (adapter failures)
- Processing exceptions → processing_error (with stack trace)
- Never loses events - all go to EventStore or ErrorStore

Tests:
- 252 unit tests passing
- Processor tests updated for new interface
- No regressions
@prosdev prosdev force-pushed the feat/gcs-error-store branch from dc87f6b to e7d3972 Compare January 15, 2026 02:49
Add BigQuery schema:
- Create errors table with partitioning and clustering
- Metadata table for tracking loaded files
- Example queries for debugging

Update README:
- Error Store (Dead Letter Queue) section
- Storage structure and usage examples
- BigQuery setup and query examples
- Updated roadmap (error store complete)

Features documented:
- Two error types (validation vs processing)
- 30-day retention with GCS lifecycle
- Full event context for debugging
- BigQuery integration for analysis
@prosdev prosdev force-pushed the feat/gcs-error-store branch from e7d3972 to c2819b6 Compare January 15, 2026 03:01
@prosdev prosdev merged commit 528c94b into main Jan 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants