getsentry/sentry

Developer-first error tracking and performance monitoring

43,622 stars Python 8 components

13 hidden assumptions · 6-stage pipeline · 8 components

Like any codebase, this fullstack makes assumptions it never checks — most are routine. The ones worth your attention are below.

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.

Hidden Assumptions

Most of what this code assumes is routine. These 3 are the ones most likely to cause trouble here. The rest are minor; they're under "Show everything".

Worth your attention first

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

Worth your attention first

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

Worth your attention first

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

Show everything (10 more)
Temporal

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
Contract

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
Scale

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
Ordering

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
Domain

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
Resource

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
Contract

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
Temporal

The csrfCookieName, superUserCookieName, and superUserCookieDomain are set before any subsequent API calls are made

If this fails: If API calls happen before these globals are set, CSRF protection fails and requests are rejected with 403 Forbidden

static/app/bootstrap/index.tsx:bootApplication
Shape

The Operator enum contains all mathematical operators that the parser will encounter

If this fails: If the parser generates operators not in the enum, TokenOperator construction fails causing expression parsing to break

static/app/components/arithmeticBuilder/token/index.tsx:TokenOperator
Environment

The window.__SENTRY_DEV_UI flag accurately indicates development mode and window.location.host contains a valid domain

If this fails: In development, if the flag is incorrect or hostname is malformed, customer domain detection fails causing routing issues

static/app/bootstrap/index.tsx:bootWithHydration

Open the standalone hidden-assumptions report for sentry →

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

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 .