Sentry
Sentry
What is Sentry?
Sentry is a popular error tracking and monitoring tool that helps developers
identify and fix issues in their applications. When an error occurs, Sentry
captures it and provides insights into the type, severity, and context of the
issue. The types of errors and issues monitored by Sentry can generally be
categorized as follows:
1. Exceptions
These are typically runtime errors in your application. When an exception is
thrown, Sentry captures the stack trace, which helps developers understand the
flow of the code leading up to the error. The types of exceptions may vary
depending on the programming language or framework being used.
2. Unhandled Errors
These are errors that weren't caught by the application. Sentry typically
captures unhandled exceptions that propagate up to the global exception
handler. These errors often indicate that the application didn't expect an issue in
that particular code path.
3. Handled Errors
These are errors that are intentionally caught by the application (using try-
catch blocks, for example) but still need to be reported for monitoring purposes.
Sentry can be configured to track these errors as well, even if the application
catches and deals with them.
4. Crashes
A crash is a serious failure where the application stops functioning or becomes
unstable. These are usually system-level errors or fatal exceptions that require
the application to be restarted. Sentry tracks crashes on mobile (iOS, Android),
desktop, and server-side applications.
5. Performance Issues
Sentry also monitors performance-related problems, such as:
- Slow Transactions: Tracks the duration of specific actions or endpoints (e.g., a
web request or API call) that exceed a threshold.
- Apdex Scores: Monitors application response times and tracks user
satisfaction with respect to response time.
- Slow Database Queries: Detects queries that take too long to execute and
may affect application performance.
6. Release Errors
Sentry allows you to monitor errors tied to specific application releases. This
means that errors can be tracked by version, and you can quickly identify if a
particular version of the software introduced new issues.
7. User Feedback
Sentry allows users to submit feedback when they experience an issue. This
feedback is often used to capture user-related insights in addition to technical
details about the error.
8. Breadcrumbs
Breadcrumbs are small events (e.g., logging messages, network requests, UI
interactions) leading up to the error. These can be used to give more context
around what happened right before an error occurred, helping developers
diagnose the problem faster.
Summary
The types of errors in Sentry are diverse, ranging from application crashes,
exceptions, and performance bottlenecks to more specialized issues like
security problems or failed network requests. The tool helps aggregate all these
errors, providing insights into where issues arise in the software lifecycle,
making it easier to identify and fix bugs quickly.
Goal: Get Sentry integrated with your application, so errors can be tracked and
insights gathered.
- Configure alert rules in Sentry to notify your team about critical issues.
- Slack
- Webhook (for custom integrations with systems like Jira, Trello, or others).
---
- Immediate action: Focus on high-severity errors that impact users the most (e.g.,
crashes, security issues, data corruption).
- Low-severity issues: Triage less important issues that can be addressed later.
- Sentry automatically groups similar errors into issues. Ensure that these groups are
correctly configured to avoid duplication.
- Use Sentry’s issue tracking to assign tasks to developers based on their area of
expertise. If the error is critical, make sure it's assigned to the appropriate
developer/team immediately.
- Use breadcrumbs and stack traces in Sentry to reproduce and debug the error.
- Explore the error's context (e.g., logs, user data, environment) to quickly identify
the root cause.
---
5. Fixing and Deploying Code
Goal: Resolve issues and ensure they are deployed without causing regressions.
- Based on your analysis of the issue, implement a fix in the relevant code section.
- For a smooth release, integrate CI/CD pipelines with Sentry so that new releases
are automatically tracked.
- Link commits and pull requests to Sentry issues, helping developers see which
commit fixed a particular issue.
- After deploying the fix, monitor Sentry for any new occurrences of the error.
- Use sentry.io performance monitoring to track if the issue caused any new
performance issues or regressions.
---
Goal: Learn from errors and improve the application and monitoring process.
- Based on the issues observed, create additional unit tests or integration tests to
prevent similar issues in the future.
- Implement error handling strategies and fail-safes to catch edge cases early in the
code.
Step 3: Review and Iterate on Alerts
- Regularly review the effectiveness of your alert rules. Avoid over-alerting and
ensure you're only notified about critical, actionable issues.
- Share error trends and lessons learned with your development team. Encourage
good practices like:
- Meaningful logging.
---
7. Ongoing Maintenance
Goal: Keep your Sentry setup effective and continuously improve error monitoring.
- Ensure that Sentry is properly integrated with all parts of your stack (back-end,
front-end, mobile, etc.).
- Periodically review the SDK versions and update them to benefit from bug fixes
and new features.
- If you're using Sentry’s user feedback feature, regularly review feedback to gauge
the impact of errors on users and use that data to prioritize fixes.
---
By following this action plan, you will set up an effective error monitoring and
response strategy with Sentry, ensuring that your application remains stable, user-
friendly, and performant over time.
1. Replays
2. Grouping - Error Aggregation & Grouping
3. Category-Different error types
4. DB slow query - Detect Performance Issues
5. N+1 query
6. Different for different environments
7. Alert system - Real-Time Error Tracking
8. Errors by Browser
9. Errors by Country
10. Historical Error Tracking
11. Can be assigned to different user to resolve error
12. Slowest functions
13. Mobile Error
14. Differentiate errors by frontend and backend
15. Monitor cron jobs
16. Number of user effected
17. Deep Insights & Context - captures detailed information of error
https://sentry.io/vs/logging/