Welcome to Sentry
Your guide to understanding the codebase.
Learning Path
16 units • 5 levels
Orchestration & APIs
- Pipelines, workflows, public interfaces • 3 units
- API Patterns and Serialization
- Django Architecture and Data Models
- Security and Access Control
Core Logic & Data
Business rules, schemas, models • 3 units
- Query and Storage Systems
- Event Ingestion and Processing
- Task Queue and Background Processing
Interaction & Integration
UI components, external connectors • 3 units
- Hybrid Cloud Architecture
- Data Analysis and Visualization
- Monitoring and Alerting Systems
Cross-Cutting Concerns
Auth, logging, config, testing • 2 units
- Debug Data Processing
- Release Management and Code Intelligence
Edge Cases & Resilience
Error handling, fault tolerance • 2 units
- Additional Data Model Patterns
- Additional Tooling Patterns
Test Your Knowledge
Test your deep understanding of the codebase
Progress: 0/26 answered
Question Tiers · ordered for deep understanding
- Why: 8
- Purpose & Problem: Architecture: 10
- Design & Patterns: Code: 8
- Implementation
Hands-On Assignment
Duration: 90-120 minutes
Your Challenge
Build a custom event enrichment pipeline that automatically tags events with deployment environment metadata. When events are ingested, your enrichment processor should look up the release version from the event data, fetch associated deployment information (environment, deploy time, commit SHA), and attach this as structured tags to the event before it's stored. This will help users correlate errors with specific deployments.
Starting Points
src/sentry/event_manager.py- Explore how events flow through the ingestion pipeline and where data transformations happen.
src/sentry/models/release.py- Study the Release model to understand what deployment metadata is available.
src/sentry/models/deploy.py- Examine the Deploy model which tracks deployment information per environment.
src/sentry/eventstore/processing/base.py- Look at existing event processors to understand the plugin pattern.
src/sentry/plugins/base/v2.py- This is where you'll create your enrichment processor following the plugin architecture.
src/sentry/tasks/store.py- Understand where event processing tasks are queued and executed.
Success Criteria
- Events with release information automatically receive deployment tags (environment, deploy_time, commit_sha).
- The enrichment processor handles missing deployment data gracefully without breaking event ingestion.
- Database queries are optimized with appropriate caching to avoid N+1 query problems.
- New unit tests demonstrate the enrichment works for various scenarios (with/without releases, multiple environments).
- Existing event ingestion tests still pass:
pytest tests/sentry/event_manager/ - Tags appear correctly in the Sentry UI when viewing enriched events.
Hints
- Hint 1: Understanding event processing stages.
- Hint 2: Finding the release-deploy relationship.
- Hint 3: Event data structure.
- Hint 4: Performance considerations.
- Hint 5: Registration and testing.
Prerequisites
- Django ORM and query optimization.
- Event-driven architecture.
- Caching strategies.
- Python decorators and middleware patterns.