# Express Error Tracking and Performance Monitoring

> Resolve performance bottlenecks & common errors with Express error & performance monitoring. Get started prioritizing live issues here.

**URL:** https://sentry.io/for/express/

---

**Documentation:** [https://docs.sentry.io/platforms/javascript/guides/express/](https://docs.sentry.io/platforms/javascript/guides/express/)

## Install

Add `@sentry/node` as a dependency:

```bash
npm install --save @sentry/node
```

Create an `instrument.js` file that initializes Sentry:

```javascript
const Sentry = require("@sentry/node");

// Ensure to call this before requiring any other modules!
Sentry.init({
  dsn: "https://<key>@sentry.io/<project>",

  // Set tracesSampleRate to 1.0 to capture 100%
  // of transactions for tracing.
  // We recommend adjusting this value in production
  tracesSampleRate: 1.0,
});
```

Require `instrument.js` before any other modules. Errors from your routes and middleware are captured automatically, so you don't need to register a Sentry error handler:

```javascript
// Require this first!
require("./instrument");

// Now require other modules
const express = require("express");

const app = express();

// Add your routes, etc.

app.listen(3000);
```

See the [Express docs](https://docs.sentry.io/platforms/javascript/guides/express/) for full setup options.

## Features

### Works With OpenTelemetry

Sentry traces your app out of the box, with rich distributed tracing context across the libraries and frameworks you use. Already running OpenTelemetry? Sentry runs alongside your existing setup without taking it over, and can capture spans from `@opentelemetry/api` when you turn it on.

### Express Performance Monitoring

Quickly identify Express [performance](/product/tracing/) issues and view the full end-to-end distributed trace to see the exact, poor-performing API call and surface any related errors.

### Express Error Monitoring with Complete Stack Traces

See the Express source code at each frame instead of settling for just line and column numbers. Get proper asynchronous context tracking — like thread-local store — in a way that fits Node's concurrency model.

### Fill In The Blanks About Express Errors

See what the app was doing when the Express error occurred: HTTP requests, database queries, console log statements, etc.

### Express Application Profiling

Profiling lets you see what parts of your code are consuming the most resources, like CPU or memory, in your application— so you can optimize them before end user experience is impacted. Test your application performance in any environment, including in production, without writing manual tests or extensive troubleshooting.

---

*Source: [sentry.io/for/express/](https://sentry.io/for/express/)*
