$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
Monitoring & Loggingbeginner

Error Tracking

Share

Set up error tracking (Sentry)

Works with OpenClaude

You are a DevOps/monitoring engineer. The user wants to set up error tracking using Sentry in their application.

What to check first

  • Run npm list sentry (or pip list | grep sentry for Python) to see if Sentry SDK is already installed
  • Verify you have a Sentry account and organization created at sentry.io
  • Check your application's entry point file (e.g., index.js, main.py, app.js)

Steps

  1. Install the Sentry SDK for your framework using npm install @sentry/node @sentry/tracing (Node.js) or pip install sentry-sdk (Python)
  2. Log into sentry.io, navigate to your organization, and create a new project — select your platform/framework
  3. Copy your DSN (Data Source Name) from the project settings page — it looks like https://key@sentry.io/project-id
  4. Import Sentry at the very top of your application's entry point, before any other requires/imports
  5. Call Sentry.init({ dsn: "YOUR_DSN" }) with your copied DSN and any additional options like tracesSampleRate
  6. Wrap your application code or HTTP handlers with Sentry middleware (e.g., app.use(Sentry.Handlers.requestHandler()))
  7. Add the error handler middleware after all routes (e.g., app.use(Sentry.Handlers.errorHandler()))
  8. Test by throwing an error in a route or function and verify the error appears in your Sentry dashboard within seconds

Code

// Node.js / Express example
const express = require('express');
const * as Sentry from "@sentry/node";
const { nodeProfilingIntegration } = require("@sentry/profiling-node");

const app = express();

// Initialize Sentry FIRST, before routes
Sentry.init({
  dsn: process.env.SENTRY_DSN,
  integrations: [
    new Sentry.Integrations.Http({ tracing: true }),
    new Sentry.Integrations.Express({
      request: true,
      serverName: false,
      transaction: 'path',
    }),
    nodeProfilingIntegration(),
  ],
  tracesSampleRate: 1.0,
  profilesSampleRate: 1.0,
  environment: process.env.NODE_ENV || 'development',
});

// Sentry request handler BEFORE routes
app.use(Sentry.Handlers.requestHandler());
app.use(Sentry.Handlers.tracingHandler());

// Your routes
app.get('/', (req, res) => {
  res.send('Hello World');
});

app.get('/error', (req, res) => {
  throw new Error('Test error for Sentry');
});

// Sentry error handler

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

Difficultybeginner
Version1.0.0
AuthorClaude Skills Hub
monitoringsentryerrors

Install command:

curl -o ~/.claude/skills/error-tracking.md https://claude-skills-hub.vercel.app/skills/monitoring/error-tracking.md

Related Monitoring & Logging Skills

Other Claude Code skills in the same category — free to download.

Want a Monitoring & Logging skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.