agentleFS
TehseenTechTehseenTech/manus-skills/skills/tier2-automation/error-monitoring-setup/SKILL.md

error-monitoring-setup

Skill0 starsChanged 3 months agoMITView on GitHub

Automated Sentry and error tracking setup for production applications. Apply automatically when the request matches; the user does not need to mention this skill.

  • Reads credentials
  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 9 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create account (free tier available)

    line 47
  2. Distinctive:

    Import at the top of your main file:

    line 215
  3. Distinctive:

    Import in your main file:

    line 232
  4. Distinctive:

    Verify test error appears

    line 308
  5. Distinctive:

    Check stack trace and context

    line 309
  6. Distinctive:

    Look for requests to sentry.io

    line 331
  7. Distinctive:

    github-workflow-automation: - Add Sentry to CI/CD

    line 430
  8. Distinctive:

    testing-framework: - Test error handling

    line 431
  9. Distinctive:

    Create Sentry account: 5 min

    line 463

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

error-monitoring-setup

Automated Sentry and error tracking setup for production applications


Overview

Automate the setup of Sentry error monitoring for Next.js, React, Node.js, and Python applications. Detects project type, installs dependencies, and configures error tracking in minutes.

Time Saved: ~45 minutes per setup
Complexity: Low
Prerequisites: Node.js/Python, Sentry account


When to Use

  • Setting up error monitoring for new projects
  • Adding Sentry to existing applications
  • Standardizing error tracking across projects
  • Deploying to production
  • Improving application reliability

Supported Platforms

  1. Next.js - Full-stack React framework
  2. React - Frontend applications
  3. Node.js - Backend APIs and services
  4. Python - Flask, Django, FastAPI

Quick Start

1. Get Sentry DSN

  1. Go to sentry.io
  2. Create account (free tier available)
  3. Create new project
  4. Copy your DSN (looks like: https://...@sentry.io/...)

2. Run Setup Script

python3 /home/ubuntu/skills/error-monitoring-setup/scripts/setup_sentry.py /path/to/project <your-dsn>

3. Test Error Tracking

// Throw a test error
throw new Error("Test error - Sentry is working!");

4. Check Sentry Dashboard

Visit your Sentry dashboard to see the error.


How It Works

Phase 1: Detection

  • Scans project for package.json, requirements.txt, etc.
  • Identifies: Next.js, React, Node.js, or Python

Phase 2: Installation

  • Installs appropriate Sentry package
  • @sentry/nextjs, @sentry/react, @sentry/node, or sentry-sdk

Phase 3: Configuration

  • Creates Sentry config files
  • Sets up error tracking
  • Configures performance monitoring
  • Enables session replay (where applicable)

Usage Examples

Example 1: Setup Sentry for Next.js

python3 /home/ubuntu/skills/error-monitoring-setup/scripts/setup_sentry.py ~/my-nextjs-app https://abc123@sentry.io/456

# Output:
# 📁 Project: /home/ubuntu/my-nextjs-app
# 🔑 DSN: https://abc123...
# ✅ Detected project type: nextjs
# 📦 Installing Sentry package for nextjs...
# ✅ Sentry package installed
# 📝 Creating Sentry configuration...
# ✅ Created Sentry config files
# ✅ Sentry setup complete!

Example 2: Setup Sentry for React

python3 /home/ubuntu/skills/error-monitoring-setup/scripts/setup_sentry.py ~/my-react-app https://abc123@sentry.io/456

# Output:
# 📁 Project: /home/ubuntu/my-react-app
# 🔑 DSN: https://abc123...
# ✅ Detected project type: react
# 📦 Installing Sentry package for react...
# ✅ Sentry package installed
# 📝 Creating Sentry configuration...
# ✅ Created Sentry config file
# ✅ Sentry setup complete!

Example 3: Setup Sentry for Python

python3 /home/ubuntu/skills/error-monitoring-setup/scripts/setup_sentry.py ~/my-python-app https://abc123@sentry.io/456

# Output:
# 📁 Project: /home/ubuntu/my-python-app
# 🔑 DSN: https://abc123...
# ✅ Detected project type: python
# 📦 Installing Sentry package for python...
# ✅ Sentry package installed
# 📝 Creating Sentry configuration...
# ✅ Created Sentry config file
# ✅ Sentry setup complete!

Configuration Files Created

Next.js

  • sentry.client.config.js - Client-side error tracking
  • sentry.server.config.js - Server-side error tracking
  • sentry.edge.config.js - Edge runtime error tracking

React

  • src/sentry.js - Browser error tracking

Node.js

  • sentry.js - Server error tracking

Python

  • sentry_config.py - Application error tracking

Features Enabled

Error Tracking ✅

  • Automatic error capture
  • Stack traces
  • Error grouping
  • User context
  • Custom tags

Performance Monitoring ✅

  • Transaction tracking
  • Slow query detection
  • API performance
  • Page load times

Session Replay ✅ (Next.js/React)

  • Video-like replay of user sessions
  • See what users saw when errors occurred
  • Privacy controls (mask sensitive data)

Integration Steps

Next.js

Automatic - Sentry config files are automatically loaded.

Test:

// pages/index.js
export default function Home() {
  return (
    <button onClick={() => {
      throw new Error("Test error");
    }}>
      Test Sentry
    </button>
  );
}

React

Import in src/index.js:

import './sentry';
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<App />);

Node.js

Import at the top of your main file:

const Sentry = require('./sentry');
const express = require('express');

const app = express();

// Your routes...

// Error handler (must be last)
app.use(Sentry.Handlers.errorHandler());

app.listen(3000);

Python

Import in your main file:

from sentry_config import *
from flask import Flask

app = Flask(__name__)

# Your routes...

if __name__ == '__main__':
    app.run()

Advanced Configuration

Custom Sample Rates

Edit config files to adjust:

Sentry.init({
  dsn: "your-dsn",
  tracesSampleRate: 0.1,  // 10% of transactions (production)
  replaysSessionSampleRate: 0.1,  // 10% of sessions
  replaysOnErrorSampleRate: 1.0,  // 100% of error sessions
});

User Context

Sentry.setUser({
  id: user.id,
  email: user.email,
  username: user.username
});

Custom Tags

Sentry.setTag("page", "checkout");
Sentry.setTag("feature", "payment");

Custom Context

Sentry.setContext("order", {
  id: "123",
  total: 99.99,
  items: 3
});

Testing Error Tracking

Manual Test

// Throw error
throw new Error("Test error - Sentry is working!");

// Or capture manually
Sentry.captureMessage("Test message");
Sentry.captureException(new Error("Test exception"));

Check Dashboard

  1. Go to Sentry dashboard
  2. Navigate to Issues
  3. Verify test error appears
  4. Check stack trace and context

Troubleshooting

Errors Not Appearing

Check DSN:

console.log(process.env.NEXT_PUBLIC_SENTRY_DSN);

Verify Initialization:

console.log("Sentry initialized");
Sentry.captureMessage("Test");

Check Network:

  • Open browser DevTools
  • Check Network tab
  • Look for requests to sentry.io

Wrong Project Type Detected

Manually specify project type by editing config files.

Package Installation Failed

# Next.js/React/Node.js
npm install --save @sentry/nextjs

# Python
pip install sentry-sdk

Best Practices

1. Set Appropriate Sample Rates

  • Development: 100% (tracesSampleRate: 1.0)
  • Production: 10-20% (tracesSampleRate: 0.1)

2. Use Environments

environment: process.env.NODE_ENV

3. Track Releases

release: "my-app@1.0.0"

4. Add User Context

Sentry.setUser({ id: user.id });

5. Filter Sensitive Data

beforeSend(event) {
  // Remove sensitive data
  delete event.request?.cookies;
  return event;
}

6. Set Up Alerts

  • Configure Slack notifications
  • Set up email alerts
  • Create alert rules

7. Review Regularly

  • Check dashboard daily
  • Triage new errors
  • Track trends
  • Prioritize fixes

Sentry Pricing

Free Tier

  • 5,000 errors/month
  • 10,000 performance units/month
  • 500 replays/month
  • Perfect for side projects

Team ($26/month)

  • 50,000 errors/month
  • 100,000 performance units/month
  • 5,000 replays/month
  • Good for small teams

Business ($80/month)

  • 500,000 errors/month
  • 1M performance units/month
  • 50,000 replays/month
  • For growing companies

Files

Scripts

  • scripts/setup_sentry.py - Automated Sentry setup

Templates

  • templates/sentry.client.config.js - Next.js client config

References

  • references/monitoring_guide.md - Complete monitoring guide

Related Skills

  • deployment-automation - Deploy after setting up monitoring
  • github-workflow-automation - Add Sentry to CI/CD
  • testing-framework - Test error handling

Workflow

1. User creates Sentry account
2. User gets DSN from Sentry dashboard
3. User runs setup script with project path and DSN
4. Script detects project type
5. Script installs Sentry package
6. Script creates config files
7. User tests error tracking
8. Errors appear in Sentry dashboard

Success Criteria

✅ Sentry package installed
✅ Config files created
✅ Error tracking working
✅ Errors appear in dashboard
✅ Stack traces visible


Time Savings

Manual Setup: ~45 minutes

  • Create Sentry account: 5 min
  • Read documentation: 10 min
  • Install package: 2 min
  • Configure: 15 min
  • Test: 5 min
  • Troubleshoot: 8 min

With This Skill: ~5 minutes

  • Get DSN: 2 min
  • Run script: 1 min
  • Test: 2 min

Savings: ~40 minutes per setup


Future Enhancements

  • Support for more platforms (Vue, Angular, Ruby, Go)
  • Automatic source map upload
  • Custom error boundaries
  • Performance optimization suggestions
  • Alert rule templates
  • Integration with other monitoring tools

Created: February 10, 2026
Status: Production Ready
Tested: Next.js, React, Node.js, Python

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.