Sentry logo

Sentry

Learn about Sentry's engineering efforts, company culture, product developments and more.

Try:
Sentry logo
Sentry

Tablecloth Trick: Migrating Issue Alerts to a New System

Sentry migrated its issue-alerting pipeline from multiple JSON-blob alert formats into a unified workflow engine backed by normalized DB rows, rewrote condition evaluation (fast and slow paths), ran the new system in silent dual-processing during rollout, resolved a Redis shard overload by sharding keys and provisioning a dedicated cluster, and now routes errors fully through the new system.

Sentry logo
Sentry

From /users/123 to /users/:id: A Guide to Route Parametrization

This post explains how Sentry’s JavaScript SDKs detect and normalize dynamic route segments (e.g. turning /users/123 into /users/:id) by hooking into popular routing libraries. It details the SDK’s instrumentation approach for extracting route templates at runtime, enabling consistent issue grouping across parameterized paths.

Sentry logo
Sentry

Shipping Features Without Writing Code

A Sentry engineer describes using Cursor's AI background agents to add C# support to the Open PR Comments parser. With minimal prompting the agent added a CSharpParser class, regex patterns, tests, and a feature flag. The author reviewed and extended the tests, concluding that background agents can be highly useful for isolated, well-scoped pattern-matching tasks and small code changes.

Sentry logo
Sentry

Building a Product Tour in React

Technical how‑to from Sentry describing a reusable, performant in‑product tour built with React and TypeScript: CSS-based visual layering, a generic TourContextProvider using useReducer/useRef for registration, and TourElement wrappers that avoid re-parenting to prevent layout shifts. The post covers API design tradeoffs, accessibility considerations, and mentions react-popper, storybook, and the GitHub source.

Sentry logo
Sentry

Formatting SQL in the Browser Using PEG

Sentry's Performance team built a browser-based SQL formatter that uses a PEG grammar (compiled with Peggy/pegjs) to parse even invalid SQL-like strings and then formats them either as indented multi-line strings (with Prism syntax highlighting) or as arrays of JSX elements for compact UI rendering. The implementation compiles grammar files with Webpack, handles many SQL dialect/placeholder variants (Django, Python, PHP, Rails), instruments performance and parse errors via Sentry spans, and uses a permissive GenericToken grammar to tolerate real-world, truncated, or redacted queries.

Sentry logo
Sentry

How Sentry queries unstructured data in ClickHouse 62x faster

Sentry describes redesigning how it stores and queries unstructured span attributes in ClickHouse. After trying a wide-column schema and then a naive Map column approach (which scanned huge files), they implemented a hash-bucketing scheme (using fnv_1a to pick one of many Map columns) and rewrote queries in Snuba to target the appropriate bucket. This reduced scanned data by ~1/number_of_buckets and produced up to a 62x speedup for key OLAP queries.

Sentry logo
Sentry

Better Code Rendering Through Virtualization

Codecov rebuilt its in-browser code renderer to handle very large files by virtualizing rendered lines (using @tanstack/react-virtual), overlaying a transparent textarea to preserve native browser search, synchronizing scrolling and line-number interaction, adding telemetry with Sentry for unsupported languages, disabling pointer events during scroll to avoid forced reflows, and adding a custom horizontal scrollbar. The result drastically reduced render blocking and allowed rendering of very large files (stress-tested up to ~500k lines).

Sentry logo
Sentry

Enabling Out-of-the-Box Performance Insights in Unity Games with the Sentry SDK

The post details how the Sentry Unity SDK implements automatic performance instrumentation via IL Weaving at build time. It describes injecting monitoring hooks into game assemblies to capture frame rates, asset load times, and other runtime metrics without manual code changes. Key design decisions and challenges in the autoinstrumentation pipeline are also discussed.

Sentry logo
Sentry

Perfectly Fitting Text to Container in React

Sentry describes building an AutoSizedText ("Big Number") React component that scales numeric text to perfectly fit its container. They evaluate approaches (SVG, CSS transforms, container queries, JavaScript resizing, canvas), implement a performant JavaScript binary-search resizing algorithm, iterate from a React-state-driven version to a ResizeObserver + direct-DOM-update version to avoid re-renders, instrument performance using Sentry spans (p50/p95/p99), and finalize API and implementation choices before publishing the component on GitHub.

Sentry logo
Sentry

Mobile App Launch Profiling

This post explores techniques for profiling a mobile app during its earliest launch phases, capturing OS-level events and initialization overhead before the first line of app code executes. It covers strategies to instrument and measure dynamic library loading, static initializers, and other pre-main activities to optimize startup performance.

Sentry logo
Sentry

Splitting production databases with minimal downtime

Sentry describes how they split Postgres primaries along product-area (silo) boundaries to increase write throughput with minimal downtime. They explain their replication topology, use of pgbouncer sidecars, Django DB routers and migrations to remove blocking foreign keys, a tombstone-based eventual-consistency delete system, and the operational cutover steps (creating a replica, promoting it to primary, and updating pgbouncer mappings).

Sentry logo
Sentry

Preact or Svelte? An Embedded Widget Use Case

Sentry compared Preact and Svelte for adding screenshotting/cropping and annotation to an embedded user feedback widget. The team recreated the widget in both frameworks, measured bundle sizes with Vite and a bundle visualizer, dealt with shadow DOM and CSS theming, and weighed build-size differences against developer familiarity and maintainability. They chose Preact; adding Preact increased the @sentry/browser user-feedback bundle by ~22.9%.

Sentry logo
Sentry

Mutation-testing our JavaScript SDKs

An engineering case study of running mutation testing on Sentry's JavaScript SDK monorepo using Stryker. The post explains mutation testing, describes how they integrated Stryker into package-level tests, reports mutation scores and runtime behavior, highlights limitations (notably Stryker's lack of Playwright support for E2E/integration tests), and records performance improvements after switching from Jest to Vitest. The team decided to run mutation testing weekly and outlined future work (Playwright support, incremental MT, CodeCov integration).

Sentry logo
Sentry

How we fixed incorrect Codecov bundle size reporting

An engineering post describing how Codecov fixed incorrect bundle size reporting caused by GitHub Actions creating a detached merge commit. The bundler plugins were updated to use @actions/github to read the pull_request head SHA (avoiding the detached GITHUB_SHA) and to capture the correct comparison/base SHA. Bundle stats are uploaded to GCP and the correct compare SHA for bundle analysis is stored in a per-commit SQLite DB to avoid locking the large pulls table.

Sentry logo
Sentry

Sentry JavaScript SDK v8 - A Retrospective

This retrospective examines the technical challenges and improvements encountered during the Sentry JavaScript SDK v8 release, including dependency management, API deprecations, performance optimizations, and testing strategies. It outlines best practices for maintaining backward compatibility and ensuring high code quality through major version upgrades.

Sentry logo
Sentry

How to Refactor and Not Break Things

Sentry describes a multi-phase refactor of its Python SDK (major version 2.0) that removed the Hub in favor of Scope-based Context Variables to achieve OpenTelemetry compatibility. The team proceeded in small PRs, moved functionality into Scopes, updated 40+ integrations, ran load tests and dogfooding on Sentry.io, fixed issues (notably Celery and a Starlette+Uvicorn bug), and released 2.0 with follow-up patches — all while keeping behavior and performance stable.

Sentry logo
Sentry

Designing Sentry's cross-region replication

Sentry evaluated Postgres replication and CDC+Kafka but adopted a transactional outbox pattern to implement cross-region replication between region silos and a control silo. They designed sharded outbox storage with categories and coalescing, made RPC handlers idempotent by sending full-object snapshots, integrated outbox creation into ORM save/update paths, added SQL-auditing test tooling, rolled out incrementally, and addressed operational issues (webhook timeouts and outbox loops).

Sentry logo
Sentry

Improving DX: From Unreadable CSS Selectors to Clear React Component Names

Sentry added a build-time annotation system that injects React component names and source-file attributes into compiled HTML. They implemented a Babel annotate plugin (forked from FullStory’s Annotate React plugin and converted to TypeScript), packaged it into bundler plugins (via Unplugin) for Vite, Webpack, and Rollup, and updated the Sentry JavaScript/Browser SDK (v7.91.0) and UI to surface component names in spans, breadcrumbs, session replays, and rage/dead click issues — improving production debugging and devtools workflows.

Sentry logo
Sentry

Removing risk from our multi-region design with simulations

Sentry describes their approach to adding multi-region support by splitting the application into Control and Region silos. To avoid risky immediate schema changes, they annotated Django models with silo metadata, monkeypatched the ORM to detect cross-silo DB usage, and used a ‘silo stable’ testing mode (running tests in monolith and silo modes) to iteratively identify and fix cross-silo dependencies (replacing them with RPCs). After achieving full test stability they were confident to finalize silo assignments and proceed toward a physical Postgres split.

Sentry logo
Sentry

How open PR comments work

Sentry describes the implementation of "Open PR comments": when a GitHub pull request is opened they fetch and qualify PR files, reverse codemap file paths to Sentry projects, extract modified functions from git patches using language-specific parsers and regex, prefetch unresolved issues from Postgres, query Snuba to find the top related unhandled issues per function, and post formatted comments on the PR. The post covers language-specific logic, parser abstractions, design tradeoffs (regex vs AST), and how to enable the feature in GitHub.