Performance Monitoring
Understand and monitor how your application performs in production. Track key metrics, analyze bottlenecks, and resolve performance issues with distributed tracing, detailed transaction data, and automated issue detection.
In many tools, Performance Monitoring is just about tracking a few key metrics on your web pages. Sentry takes a different approach. By setting up [Tracing])(/concepts/key-terms/tracing/), Sentry captures detailed performance data for every transaction in your entire application stack and automatically presents it in a variety of easy-to-use but powerful features so you can rapidly identify and resolve performance issues as they happen - all in one place.
Set up Distributed Tracing to enable Performance Monitoring.
Sentry has multiple tools for monitoring performance which are useful for different aspects of your monitoring & debugging needs:
After turning on Distributed Tracing, you'll automatically see a set of Insights pages that give you a high-level view of performance data for each layer of your stack. This is extremely useful for quickly seeing any major performance outliers that need optimization, or tracking potential regressions across time, environments, releases, etc.
- Frontend Insights givews you an easy but powerful way to\ drill into common frontend performance issues with things like Core Web Vitals, as well as transaction performance with things like duration, and error rate.
- Backend Insights show your backend transaction performance, across things like database queries, external API calls, caches, queues, crons, and more.
- Mobile Insights track vital performance metrics for your mobile apps, including your cold & warm app start times, TTID & TTFD, and time to load or render key screens throughout your app.
- AI Insights give you a view of your LLM performance. This is currently in beta and only available for certain integrations.
See the demo video below for a quick tour of the Insights pages:
All accounts have access to the top level insights pages. Upgrading to the Team plan or higher gets you access to more dedicated insights pages for common monitoring use cases.
Alongside typical error issues, Sentry will automatically detect common performance issues and group them into performance issues. For instance:
- N+1 Query & API call issues that indicate unnecessary round-trips to your backend
- Consecutive DB Queries or HTTP Requests that could be batched for better performance
- Database queries or File I/O running on the main thread, which can block the UI thread and cause performance issues
- And many more documented here.
While Performance Issues and Insights give you a high-level view of performance data, the Trace Explorer lets you slice and dice all your performance data by any attribute. This is an extremely powerful tool for finding root causes and common patterns for performance regressions or potential optimizations. For instance, you can find the p95 duration of all spans on the GET /users/:id
endpoint, or find all pages slowing down because of a particular middleware routing.
The newest version of the Trace Explorer also lets you quickly calculate metrics based on your span data, like p50, p95, and p99 durations, and then group them by any attribute. This lets you quickly see if there's specific endpoints, versions, user groups, etc. that are performing poorly. For a more thorough dive into how you can use the new Trace Explorer and Span Metrics, take a look at our most recent blog post.
This demo shows a new version of the Trace Explorer that is available for all self-serve orgs in the Early Adopter program. Enable the EA flag in your organization settings to gain access to Span Metrics, Group By, Create Widgets and Alerts.
By default, Sentry automatically tracks a set of performance metrics for every trace. These are used to pupulate the Insights dashboards, but you can also use them to build custom dashboards and alerts.
Opting into the Early Adopter program for the Trace Explorer also gives you access to the new Span Metrics feature, which lets you calculate custom metrics based on your span data. This is extremely useful for building dashboards and alerts that are underpinned by real performance tracing data, so you can quickly debug performance issues.
For basic frontend or backend performance monitoring, just turn on Tracing in your relevant SDK. This will automatically trace every network request and give you a basic set of performance metrics. However, to make sure Sentry is capturing accurate and complete performance data, you need to set up Distributed Tracing. NextJS, Laravel, Ruby on Rails and a few others have strong out-of-the-box support for distributed tracing, but for more complex or multi-language applications, you'll need to configure this manually. Learn more about trace propagation here.
Instead of instrumenting pageloads with specific metrics at set points, ie. onLoad
, onUnload
, onError
, etc., Sentry automatically traces every network request, file I/O, and other operation in your application. This lets you see the performance impact of every request, and any errors that occur during that request.
These performance metrics are sent by the Sentry SDK as part of each Span, which is the smallest unit of work in a Trace. Traces are assembled in Sentry's backend, and then extrapolated to populate all the tools we have for monitoring performance.
This differs substantially from other performance monitoring tools that only capture metrics at specific points in your application. Instead, all your holistic metrics are backed up by the raw tracing data, so you can drill into any specific request or operation to get a detailed view of its performance.
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").