Prerequisites
Before upgrading:- Upgrade to the latest v7 version first
- Fix all deprecation warnings
- Review the v8 changelog
- Test in a non-production environment
Installation
Major Changes
1. Performance API Overhaul
The biggest change in v8 is the new Performance API based on OpenTelemetry.Before (v7):
After (v8):
2. Package Removals
@sentry/tracing
Before (v7):@sentry/integrations
Before (v7):@sentry/replay
Before (v7):3. Hub to Scope API
The Hub API is deprecated in favor of the new Scope API. Before (v7):4. Integration Interface Changes
All integrations are now functions instead of classes. Before (v7):Node.js Specific Changes
Initialization Order
In v8, Sentry MUST be initialized before any other imports. Before (v7):Express Error Handler
Before (v7):Framework-Specific Migration
Next.js
v8 requires using the instrumentation hook. 1. Enable instrumentation hook (Next.js 13-14):React Router
Before (v7):API Changes
Removed APIs
configureScope
Before:getActiveTransaction
Before:spanStatusfromHttpCode
Before:Behavior Changes
tracePropagationTargets
In v7,tracePropagationTargets defaulted to ['localhost', /^\/(?!\/)/].
In v8, it defaults to same-origin requests only.
Migration:
Severity Enum
Before:Step-by-Step Migration
1. Update Dependencies
2. Update Imports
3. Update Integrations
4. Update Performance Code
5. Update Scope Usage
6. Test Thoroughly
- Test error capturing
- Test performance monitoring
- Verify source maps
- Check integrations
Migration Checklist
- Update all
@sentry/*packages to v8 - Remove deprecated packages (
@sentry/tracing,@sentry/integrations,@sentry/replay) - Update integration syntax (class → function)
- Replace
startTransactionwithstartSpan - Replace
configureScopewithgetCurrentScope() - Update Next.js to use instrumentation hook
- Update Node.js initialization order
- Test in staging environment
- Update source map configuration
- Review and test all custom instrumentation
Automated Migration
Sentry provides a migration tool:- Integration syntax
- Import statements
- Performance API calls
- Scope API usage
Getting Help
If you encounter issues:- Check the full v8 migration guide
- Search GitHub issues
- Ask in Discord
- Review the v8 changelog
Next Steps
v8 to v10 Migration
Upgrade from v8 to the latest version
Performance Monitoring
Learn the new Performance API