Sentry

On this page 7

Sentry is an application monitoring platform that captures unhandled exceptions, crashes and performance data directly from running code and groups them into actionable issues. In cloud observability, it fills the gap between infrastructure metrics and the source code: instead of reporting that a service returned more errors, it shows which line failed, for which release, and under what conditions.

Sentry began as an open-source error tracker for Python web applications and grew into a platform that also covers performance tracing, profiling, session replay and cron monitoring. It runs as a hosted service or as a self-hosted installation, and it ships SDKs for most mainstream languages, frameworks and mobile platforms.

How Sentry captures and processes events

Sentry works by embedding a language-specific SDK in the application, which hooks into the runtime and sends structured events to an ingestion endpoint identified by a Data Source Name (DSN). An event is a JSON document that describes one occurrence, such as an exception or a finished transaction.

The SDK installs global handlers for uncaught exceptions and integrates with frameworks to record request data automatically. Before an event leaves the process, it is enriched with breadcrumbs (a short trail of recent actions such as HTTP calls, log lines and clicks), tags, user context, the environment name and the release identifier. On the server side, an ingestion layer called Relay validates, filters and rate-limits events before they are stored and processed.

The table below lists the main parts of an error event and the questions each part answers during debugging.

Event componentContentDebugging question answered
Stack traceFrames with file, function, line and local variablesWhere exactly did the code fail
BreadcrumbsTimestamped actions before the errorWhat led up to the failure
TagsIndexed key-value pairs such as browser or regionWhich population is affected
ReleaseVersion string tied to a deployWhich deploy introduced the problem
ContextDevice, runtime, request and user dataUnder what conditions it happens
Main components of a Sentry error event

Issue grouping and fingerprinting

Sentry reduces thousands of individual events to a manageable list by grouping events into issues with a computed fingerprint. By default the fingerprint is derived from the normalized stack trace, so the same bug produces one issue even when it fires a million times.

When no stack trace is available, grouping falls back to the exception type and message, which can split one problem into many issues if the message contains variable data such as IDs. Teams therefore define custom fingerprinting rules or stack trace rules that mark framework frames as irrelevant. Grouping quality is the single biggest factor in signal-to-noise: poor grouping creates duplicate issues and, in turn, alert fatigue.

For compiled or minified code, Sentry needs extra artifacts to show readable frames. The following table summarizes what each platform requires.

PlatformRequired artifactEffect if missing
JavaScriptSource maps uploaded per releaseMinified names and wrong line numbers
iOS and macOSdSYM debug symbol filesMemory addresses instead of functions
AndroidProGuard or R8 mapping fileObfuscated class and method names
Native C and C++Debug information filesUnreadable native crash frames
Python, Ruby, PHPNothing extraFrames are readable by default
Symbolication artifacts by platform

Sentry compared with other observability tools

Sentry is best understood as a code-centric, developer-facing tool, whereas metrics systems and full APM suites are mostly operations-centric. It overlaps with them but answers different questions, and many organizations run Sentry next to a metrics stack rather than instead of it.

The comparison below shows where Sentry sits among neighboring concepts in the Observability topic.

Tool or approachPrimary signalMain strengthTypical gap
SentryErrors, transactions, replaysCode-level root cause per releaseLimited infrastructure metrics
Prometheus with GrafanaNumeric time-series metricsCheap, high-volume trend dataNo stack traces or user context
Full APM suitesTraces, metrics, logs, hostsBroad end-to-end coverageHigher cost and complexity
Log aggregationUnstructured or structured logsComplete audit trailErrors buried in noise
Jaeger tracingDistributed spansRequest flow across servicesNo error grouping or triage
Sentry and related observability approaches

Sentry performance monitoring records transactions and spans in a model close to distributed tracing, and current SDKs can interoperate with OpenTelemetry instrumentation. Its traces are oriented toward finding slow code paths and linking them to errors rather than toward long-term capacity planning.

Configuring Sentry in production

A useful Sentry setup depends on a few configuration decisions made at SDK initialization and in the project settings. Without them, teams often see unreadable traces, missing deploy attribution or an exhausted event quota within days.

  • Set the release and environment on every event so regressions can be traced to a specific deploy.
  • Upload source maps or debug symbols in the CI pipeline as part of each release.
  • Tune sample rates: errors are usually captured at 100 percent, while traces are commonly sampled between 1 and 20 percent.
  • Enable server-side data scrubbing for passwords, tokens and personal data.
  • Connect source control so Sentry can suggest suspect commits and link issues to code owners.

The decision table below maps common situations to a recommended choice.

SituationRecommended choiceReason
Small team, no compliance limitsHosted serviceNo servers, upgrades or storage to manage
Strict data residency rulesSelf-hosted installationEvent data stays on owned infrastructure
High-traffic APILow trace sample rateControls cost while keeping statistical value
Noisy third-party errorsInbound filtersDrops known noise before it counts against quota
Scheduled batch jobsCron monitoringAlerts when a job is late, missing or failing
Deployment and sampling decisions

Limitations and common mistakes

Sentry is powerful for code-level diagnosis but has clear limits that experienced teams plan around. Event volume drives cost on the hosted service, and a single bug in a hot loop can burn through a monthly quota unless rate limits and spike protection are configured.

Self-hosting is free of license fees for internal use, yet it is operationally heavy: the stack includes several databases, a message queue and many containers, and it needs regular upgrades. The source code is published under the Functional Source License, which permits most uses but is not an OSI-approved open-source license.

MistakeSymptomFix
No release taggingCannot tell which deploy broke thingsSet the release in SDK and CI
Missing source mapsMinified frames in JavaScript issuesUpload maps for every build
Alerting on every new issueChannels flooded, alerts ignoredAlert on frequency or user impact
Sending personal dataPrivacy and compliance exposureEnable scrubbing and disable default PII
Trace sampling at 100 percentQuota exhausted earlyLower or use dynamic sampling
Frequent mistakes and how to fix them

In everyday language

Sentry is like a flight recorder for software. When an app crashes or something goes wrong for a user, Sentry writes down exactly what happened: which part of the program failed, what the user did just before, and which version of the app was running.

Developers then see one tidy list of problems instead of thousands of separate reports, sorted by how many people are affected. The key idea is simple: Sentry tells programmers what broke and where to look, often before customers even complain.

Seen in the real world

An online booking service runs a React front end and a Python API on a managed Kubernetes cluster. Shortly after a Friday deploy, Sentry opens a new issue: a TypeError in the checkout page affecting about 4 percent of sessions, all on one mobile browser version.

Because the team uploads source maps and tags each release, the issue shows the exact component and line, and Sentry flags the suspect commit that changed date parsing. A session replay confirms that users are stuck on the payment step. The on-call developer reverts the commit within 25 minutes, the error rate returns to zero in the next release, and the issue is resolved automatically when the fixed version stops reporting it. The outage stayed small because diagnosis took minutes, not hours.