Enabling Performance Monitoring
Browser Applications
Node.js Applications
Instrumentation
Automatic Instrumentation
The SDK automatically instruments: Browser:- Page load transactions
- Navigation transactions
- Fetch/XHR requests
- User interactions (clicks, form inputs)
- Web Vitals (LCP, FID, CLS, INP, TTFB)
- HTTP/HTTPS requests
- Express.js routes
- Database queries (Prisma, MongoDB, MySQL, PostgreSQL)
- GraphQL operations
- Redis operations
Manual Instrumentation
Create custom spans for specific operations:Nested Spans
Track sub-operations:Controlling Span Creation
HTTP Instrumentation
Control which requests create spans:Browser Request Instrumentation
Trace Propagation
Control distributed tracing headers:Web Vitals
Monitor Core Web Vitals automatically:Custom Measurements
Add custom performance measurements:Transaction Naming
Browser Route Naming
Custom Transaction Names
Node.js Route Naming
Sampling Strategies
Prioritize Important Transactions
Environment-Based Sampling
Performance Overhead Reduction
Disable Unnecessary Integrations
Limit Breadcrumb Collection
Selective Instrumentation
Framework-Specific Optimizations
React
Next.js
Next.js SDK handles instrumentation automatically:Vue
Database Query Instrumentation
Prisma
MongoDB (Mongoose)
Best Practices
Use lower sampling rates in production
Use lower sampling rates in production
High-traffic applications should use lower sample rates:
Don't sample health checks or metrics endpoints
Don't sample health checks or metrics endpoints
These create noise without value:
Use span operations correctly
Use span operations correctly
Set appropriate
op values for better organization:Avoid creating too many spans
Avoid creating too many spans
Too many spans can increase overhead. Focus on meaningful operations:
Set meaningful span attributes
Set meaningful span attributes
Add context to help debug performance issues:
Monitoring Performance Impact
Check SDK Overhead
Profile Mode
Enable profiling for deeper insights:Complete Example
Next Steps
Bundle Size Optimization
Reduce SDK bundle size impact
Source Maps
Configure source maps for production