Welcome to Sentry

Your guide to understanding the codebase.

Learning Path

16 units • 5 levels

Orchestration & APIs

  1. 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

  1. Query and Storage Systems
  2. Event Ingestion and Processing
  3. Task Queue and Background Processing

Interaction & Integration

UI components, external connectors • 3 units

  1. Hybrid Cloud Architecture
  2. Data Analysis and Visualization
  3. Monitoring and Alerting Systems

Cross-Cutting Concerns

Auth, logging, config, testing • 2 units

  1. Debug Data Processing
  2. Release Management and Code Intelligence

Edge Cases & Resilience

Error handling, fault tolerance • 2 units

  1. Additional Data Model Patterns
  2. 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

  1. Events with release information automatically receive deployment tags (environment, deploy_time, commit_sha).
  2. The enrichment processor handles missing deployment data gracefully without breaking event ingestion.
  3. Database queries are optimized with appropriate caching to avoid N+1 query problems.
  4. New unit tests demonstrate the enrichment works for various scenarios (with/without releases, multiple environments).
  5. Existing event ingestion tests still pass: pytest tests/sentry/event_manager/
  6. 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.