Core concepts
Transactions
A transaction represents a single operation — an HTTP request, a background job, or a page load. It’s the top-level unit Sentry measures.
Spans
Spans are the individual steps inside a transaction — a database query, an external API call, a template render. Each span has a start time and duration.
Traces
A trace connects spans across multiple services. When a frontend page load triggers a backend API call that queries a database, all three appear in the same trace.
Distributed tracing
When you instrument multiple services with Sentry, a trace ties them all together using a propagatedtrace_id. You can follow a single user’s request from the browser, through your API gateway, into your microservices, and down to the database — all in one waterfall view.
Sentry automatically propagates trace context in HTTP headers (using the W3C traceparent standard) when you use the SDK’s HTTP instrumentation.
Transaction performance
The Performance section in Sentry shows aggregated metrics for every transaction your application receives:| Metric | Description |
|---|---|
| P50 | Median response time — half of requests are faster |
| P75 | 75th percentile — a good proxy for typical user experience |
| P95 | 95th percentile — captures the slowest 5% of requests |
| P99 | 99th percentile — your worst-case outliers |
| Throughput | Requests per minute |
| Failure rate | Percentage of transactions that errored |
Web Vitals
For browser-instrumented pages, Sentry tracks the Core Web Vitals defined by Google:| Vital | What it measures |
|---|---|
| LCP (Largest Contentful Paint) | How long until the main content is visible |
| FID (First Input Delay) | How quickly the page responds to the first interaction |
| CLS (Cumulative Layout Shift) | How much the page layout shifts unexpectedly |
| FCP (First Contentful Paint) | How long until any content is painted |
| TTFB (Time to First Byte) | How long the browser waits for the first byte from the server |
N+1 query detection
Sentry automatically detects N+1 query patterns — where your code issues the same database query repeatedly in a loop instead of batching them. These show up as performance issues in the Performance tab, linked to the specific transaction and code location causing the problem.Instrumenting your code
- Auto-instrumentation
- Manual spans
Most frameworks are instrumented automatically. When you initialize the Sentry SDK, it patches common libraries (Express, Django, Flask, Rails, etc.) to create spans for HTTP requests, database queries, and more — with no additional code.
Set
tracesSampleRate between 0.0 and 1.0 to control what fraction of transactions Sentry records. For high-traffic apps, start with a lower value like 0.1 (10%) to manage volume.Sampling
Sentry supports uniform sampling (send X% of all transactions) and dynamic sampling (prioritize transactions with errors, specific users, or custom criteria). Configure sampling inSentry.init:
Performance dashboard
The Performance section in your Sentry project gives you:- A list of all transactions, sortable by P95 latency, throughput, or failure rate
- A transaction summary page for any individual transaction showing latency distribution, related issues, and span breakdown
- Web Vitals summary for frontend projects
- Trends view to spot transactions that got slower or faster between releases