getsentry/sentry

Developer-first error tracking and performance monitoring

43,622 stars Python 8 components

Captures errors and performance data from applications and provides debugging workflows

Data enters Sentry through SDK HTTP requests containing error events or performance traces. The EventManager validates and enriches this data, uses GroupingEnhancer rules to normalize stacktraces, then applies grouping logic to either create new issues or update existing ones. The processed events are stored in PostgreSQL/ClickHouse while the React frontend loads user configuration via /api/client-config/ and provides interfaces for browsing, triaging, and analyzing the collected data.

Under the hood, the system uses 3 feedback loops, 4 data pools, 4 control points to manage its runtime behavior.

A 8-component fullstack. 16895 files analyzed. Data flows through 6 distinct pipeline stages.

How Data Flows Through the System

Data enters Sentry through SDK HTTP requests containing error events or performance traces. The EventManager validates and enriches this data, uses GroupingEnhancer rules to normalize stacktraces, then applies grouping logic to either create new issues or update existing ones. The processed events are stored in PostgreSQL/ClickHouse while the React frontend loads user configuration via /api/client-config/ and provides interfaces for browsing, triaging, and analyzing the collected data.

  1. SDK Event Ingestion — Client SDKs POST JSON payloads to /api/store/ endpoints containing error events, transactions, or performance spans with stacktraces, breadcrumbs, and context data [Raw Event Data]
  2. Event Validation and Enrichment — EventManager validates the incoming payload schema, applies rate limits, enriches with IP geolocation and user agent parsing, and extracts key metadata
  3. Stacktrace Enhancement — GroupingEnhancer applies configurable rules to normalize stacktrace frames — removing file paths, grouping similar functions, and standardizing error patterns [Raw Stacktrace → Enhanced Stacktrace]
  4. Issue Grouping — Grouping algorithm computes fingerprints from enhanced stacktraces and error details, then either matches to existing GroupHash or creates new issue group [Enhanced Stacktrace → GroupingResult]
  5. Frontend Configuration Loading — React app fetches /api/client-config/ to get user permissions, organization settings, feature flags, and CSRF tokens needed for authenticated requests
  6. Real-time Alert Processing — IncidentLogic evaluates incoming metrics against alert rule thresholds, creates IncidentUpdateValues when conditions are met, and manages incident state transitions [Metrics Data → IncidentUpdateValues]

Data Models

The data structures that flow between stages — the contracts that hold the system together.

Config static/app/bootstrap/index.tsx
TypeScript interface with user: User, organizationUrl: string, features: FeatureSet, csrfCookieName: string, customerDomain: CustomerDomain
Loaded via /api/client-config/ on app start, stored in window.__initialData, and accessed throughout the React app lifecycle
ActivityItem static/app/components/activity/item/index.tsx
React component props with author: {type: ActivityAuthorType, user?: AvatarUser}, date: string | Date, interval?: number, children: ReactNode
Created for each activity event (comments, status changes, assignments) and rendered in chronological feeds
GroupingResult src/sentry/grouping/api.py
dataclass with config: GroupingConfig, variants: dict[str, BaseVariant], hashes: list[str], grouphashes: list[GroupHash]
Computed when processing new events to determine which existing issue group they belong to based on stacktrace and error characteristics
IncidentUpdateValues src/sentry/incidents/utils/types.py
dataclass with entity: str, subscription_id: str, values: SubscriptionUpdateValues, timestamp: datetime
Generated by Snuba subscription updates when alert rule thresholds are crossed, triggers incident creation or resolution
ArithmeticExpression static/app/components/arithmeticBuilder/index.tsx
TypeScript type representing parsed mathematical expressions with aggregations: string[], functionArguments: FunctionArgument[], references?: Set<string>
Built by users in the UI for custom metrics and dashboard widgets, validated and executed against Snuba data

Hidden Assumptions

Things this code relies on but never validates. These are the things that cause silent failures when the system changes.

critical Environment unguarded

The /api/client-config/ endpoint will always return valid JSON with the expected Config schema structure

If this fails: If the backend returns malformed JSON or missing required fields, the frontend crashes with a runtime error that's hard to debug

static/app/bootstrap/index.tsx:bootWithHydration
critical Environment unguarded

The window.__initialData global variable can be safely written to and will persist throughout the application lifecycle

If this fails: If another script overwrites window.__initialData or the browser doesn't support globals, the entire frontend loses its configuration data and becomes non-functional

static/app/bootstrap/index.tsx:bootWithHydration
critical Shape weakly guarded

All references in the references Set match the VALID_REFERENCE_PATTERN regex /^[A-Z]$/ (single uppercase letter)

If this fails: Invalid references throw an Error during render, crashing the entire UI component tree without graceful fallback

static/app/components/arithmeticBuilder/index.tsx:ArithmeticBuilder
critical Temporal unguarded

The window.__initialData.initialTrace object exists and has sentry_trace and baggage properties when making preload requests

If this fails: If the trace data isn't available yet or was cleared, all preload requests fail with 'Cannot read property sentry_trace of undefined' causing silent data loading failures

static/app/bootstrap/index.tsx:promiseRequest
warning Contract unguarded

When author.type is 'user', the author.user field is always provided with valid AvatarUser data

If this fails: If user data is missing for type 'user', the avatar component receives undefined and renders blank or crashes, breaking activity feeds

static/app/components/activity/item/index.tsx:ActivityItem
warning Scale unguarded

API authentication headers and signatures will fit within standard HTTP header size limits (typically 8KB)

If this fails: Large organization contexts or complex authentication tokens could exceed server header limits, causing 431 Request Header Fields Too Large errors that appear as authentication failures

src/sentry/api/authentication.py
warning Ordering weakly guarded

The aggregations array is pre-filtered to only contain function-type fields before being passed to ArithmeticBuilder

If this fails: If non-function aggregations are included, they get filtered out during context creation causing silently missing options in the UI

static/app/components/arithmeticBuilder/index.tsx:ArithmeticBuilder
warning Domain unguarded

The date prop, when provided as a string, is in a format that moment.js can parse correctly

If this fails: Invalid date strings result in 'Invalid date' being displayed in the UI without user-friendly error messages

static/app/components/activity/item/index.tsx:ActivityItem
warning Resource unguarded

The browser supports the fetch API with all required options (credentials, priority, headers)

If this fails: In older browsers without full fetch support, requests silently fail or ignore important options like credentials, causing authentication issues

static/app/bootstrap/index.tsx:promiseRequest
warning Contract unguarded

Organization slugs in URLs are always URL-safe and contain no special characters that could interfere with routing or permission checks

If this fails: Special characters in organization slugs could cause routing mismatches or bypass permission checks if the slug isn't properly escaped

src/sentry/api/bases/organization.py:OrganizationEndpoint

System Behavior

How the system operates at runtime — where data accumulates, what loops, what waits, and what controls what.

Data Pools

Event Store (database)
PostgreSQL tables storing processed events, issues, user data, and organizational metadata with relationships
Analytics Store (database)
ClickHouse-based time-series storage for high-volume event data, metrics aggregation, and performance queries
Frontend State Cache (in-memory)
Browser-side configuration and user context loaded once and cached in window.__initialData
Task Queue (queue)
Redis-backed job queue for asynchronous processing of notifications, data cleanup, and background operations

Feedback Loops

Delays

Control Points

Technology Stack

Django (framework)
Web framework providing REST API endpoints, authentication, and request routing
React (framework)
Frontend framework for building the web UI with components for dashboards, issue details, and settings
TypeScript (runtime)
Type system for frontend code providing static analysis and IDE support
PostgreSQL (database)
Primary database for user data, organization settings, and normalized event metadata
ClickHouse (database)
Time-series database for high-volume raw event data and analytics queries
Redis (database)
Task queue backend and caching layer for session data and rate limiting
Snuba (database)
Query layer that translates high-level filters into optimized ClickHouse queries
Celery (infra)
Distributed task queue for background jobs like notifications and data processing
Jest (testing)
JavaScript testing framework for frontend unit and integration tests
Rspack (build)
Fast Rust-based bundler for building and hot-reloading the React frontend

Key Components

Explore the interactive analysis

See the full architecture map, data flow, and code patterns visualization.

Analyze on CodeSea

Related Fullstack Repositories

Frequently Asked Questions

What is sentry used for?

Captures errors and performance data from applications and provides debugging workflows getsentry/sentry is a 8-component fullstack written in Python. Data flows through 6 distinct pipeline stages. The codebase contains 16895 files.

How is sentry architected?

sentry is organized into 5 architecture layers: Frontend UI, API Layer, Event Processing, Storage & Analytics, and 1 more. Data flows through 6 distinct pipeline stages. This layered structure keeps concerns separated and modules independent.

How does data flow through sentry?

Data moves through 6 stages: SDK Event Ingestion → Event Validation and Enrichment → Stacktrace Enhancement → Issue Grouping → Frontend Configuration Loading → .... Data enters Sentry through SDK HTTP requests containing error events or performance traces. The EventManager validates and enriches this data, uses GroupingEnhancer rules to normalize stacktraces, then applies grouping logic to either create new issues or update existing ones. The processed events are stored in PostgreSQL/ClickHouse while the React frontend loads user configuration via /api/client-config/ and provides interfaces for browsing, triaging, and analyzing the collected data. This pipeline design reflects a complex multi-stage processing system.

What technologies does sentry use?

The core stack includes Django (Web framework providing REST API endpoints, authentication, and request routing), React (Frontend framework for building the web UI with components for dashboards, issue details, and settings), TypeScript (Type system for frontend code providing static analysis and IDE support), PostgreSQL (Primary database for user data, organization settings, and normalized event metadata), ClickHouse (Time-series database for high-volume raw event data and analytics queries), Redis (Task queue backend and caching layer for session data and rate limiting), and 4 more. This broad technology surface reflects a mature project with many integration points.

What system dynamics does sentry have?

sentry exhibits 4 data pools (Event Store, Analytics Store), 3 feedback loops, 4 control points, 3 delays. The feedback loops handle polling and self-correction. These runtime behaviors shape how the system responds to load, failures, and configuration changes.

What design patterns does sentry use?

4 design patterns detected: Multi-Tenant SaaS Architecture, Event Sourcing for Audit Trail, Plugin Architecture for Integrations, CQRS with Separate Read/Write Models.

Analyzed on April 20, 2026 by CodeSea. Written by .