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
- API · 6
- Django Architecture and Data Models
- Architecture · 13
- Security and Access Control
- Security · 10
Core Logic & Data
- Business rules, schemas, models • 3 units
- Query and Storage Systems
- Integration · 5
- Event Ingestion and Processing
- Workflow · 12
- Task Queue and Background Processing
- Workflow · 1
Interaction & Integration
- UI components, external connectors • 3 units
- Hybrid Cloud Architecture
- Data Analysis and Visualization
- Monitoring and Alerting Systems
- Workflow · 2
Cross-Cutting Concerns
- Auth, logging, config, testing • 2 units
- Debug Data Processing
- Workflow · 6
- Release Management and Code Intelligence
- Edge Cases & Resilience
- Error handling, fault tolerance • 2 units
Additional Data Model Patterns
- Data Model
- Additional Tooling Patterns
- Tooling · 3
Test Your Knowledge
Test your deep understanding of the codebase
Progress
0/26 answered
Question Tiers
- Purpose & Problem
- Architecture · 10
- Design & Patterns
- Implementation
- Code · 8
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 happensrc/sentry/models/release.py
Study the Release model to understand what deployment metadata is availablesrc/sentry/models/deploy.py
Examine the Deploy model which tracks deployment information per environmentsrc/sentry/eventstore/processing/base.py
Look at existing event processors to understand the plugin patternsrc/sentry/plugins/base/v2.py
This is where you'll create your enrichment processor following the plugin architecturesrc/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 conceptual
- Hint 2: Finding the release-deploy relationship code location
- Hint 3: Event data structure implementation
- Hint 4: Performance considerations implementation
- Hint 5: Registration and testing implementation
Prerequisites
- Django ORM and query optimization
- Event-driven architecture
- Caching strategies
- Python decorators and middleware patterns