Overview
When a request in your Express.js application touches multiple services, debugging latency issues becomes exponentially harder. Distributed tracing connects the dots.
Bugsly provides a first-class Express.js integration for distributed tracing that takes minutes to set up and immediately starts delivering value.
Installation and Setup
Start by adding Bugsly to your project:
npm install @bugsly/nodeNext, initialize the SDK in your application:
const Bugsly = require("@bugsly/node");
Bugsly.init({ dsn: "YOUR_BUGSLY_DSN", tracesSampleRate: 1.0 });
const app = express();
app.use(Bugsly.Handlers.requestHandler());
app.use(Bugsly.Handlers.errorHandler());How It Works
Once initialized, the Bugsly Express.js SDK automatically instruments your application. Here's what happens behind the scenes:
- Automatic error capture: Unhandled exceptions and promise rejections are caught and reported with full stack traces
- Context enrichment: Each event includes environment data, request details, and user context where available
- Intelligent grouping: Similar errors are grouped together so you see issues, not individual events
- Performance data: Transaction traces help you understand the performance impact of errors
Customizing Your Integration
For Express.js projects, we recommend enabling these additional features after the basic setup:
- Source maps (if applicable) — upload source maps during your build so Bugsly can display readable stack traces
- User feedback — prompt users who encounter errors for additional context
- Custom tags — add business-specific metadata to events for filtering and analysis
Bugsly's dashboard will become your team's go-to tool for understanding what's happening in your Express.js production environment.
Next Steps
With distributed tracing active, use Bugsly's trace explorer to find slow spans and identify bottlenecks across services. Set up performance alerts for transactions that exceed your latency budgets. Tag traces with custom attributes to filter by specific users, endpoints, or business operations.
Try Bugsly Free
AI-powered error tracking that explains your bugs. Set up in 2 minutes, free forever for small projects.
Get Started FreeRelated Articles
Complete Bugsly Setup for FastAPI
Complete guide to integrating Bugsly error monitoring in your FastAPI project. Get started in minutes with this tutorial.
Read moreComplete Bugsly Setup for Angular
Set up error monitoring for Angular using Bugsly. Quick installation, configuration, and verification steps included.
Read moreHow to Set Up Session Replay in Java
Learn how to set up session replay in Java with Bugsly. Step-by-step guide with code examples and best practices.
Read moreHow to Set Up Error Tracking in Deno
Add error tracking to your Deno app with Bugsly. Covers installation, SDK setup, and production best practices.
Read more