jpskill.com
💼 ビジネス コミュニティ

error-tracking-integrator

SentryやRollbarなどのサービスと連携し、エラー発生時の状況や経緯を記録することで、本番環境でのデバッグやエラー監視を効率化し、問題解決を支援するSkill。

📜 元の英語説明(参考)

Adds comprehensive error tracking with Sentry, Rollbar, or similar services including error boundaries, context, and breadcrumbs. Use when user requests error monitoring or mentions production debugging.

🇯🇵 日本人クリエイター向け解説

一言でいうと

SentryやRollbarなどのサービスと連携し、エラー発生時の状況や経緯を記録することで、本番環境でのデバッグやエラー監視を効率化し、問題解決を支援するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o error-tracking-integrator.zip https://jpskill.com/download/18107.zip && unzip -o error-tracking-integrator.zip && rm error-tracking-integrator.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18107.zip -OutFile "$d\error-tracking-integrator.zip"; Expand-Archive "$d\error-tracking-integrator.zip" -DestinationPath $d -Force; ri "$d\error-tracking-integrator.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して error-tracking-integrator.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → error-tracking-integrator フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Error Tracking Integrator

より良い本番環境でのデバッグとモニタリングのために、エラー追跡サービスをアプリケーションに統合します。

どのような時に使うか

  • ユーザーがエラー監視または追跡を要求した場合
  • 本番環境のエラーログを設定する場合
  • ユーザーが "Sentry"、"error tracking"、"crash reporting"、または "production debugging" について言及した場合

手順

1. フレームワークの検出

アプリケーションのフレームワークを特定します。

  • React, Vue, Angular (フロントエンド)
  • Express, Fastify (Node.js バックエンド)
  • Django, Flask (Python)
  • Rails (Ruby)

2. エラー追跡サービスの選択

一般的なサービス:

  • Sentry: 最も人気があり、包括的
  • Rollbar: バックエンドに最適
  • Bugsnag: マルチプラットフォーム
  • Airbrake: Ruby に特化
  • LogRocket: セッションリプレイ + エラー

3. インストールと設定

Sentry (React の例):

npm install @sentry/react
import * as Sentry from "@sentry/react";

Sentry.init({
  dsn: process.env.REACT_APP_SENTRY_DSN,
  environment: process.env.NODE_ENV,
  tracesSampleRate: 1.0,
  integrations: [
    new Sentry.BrowserTracing(),
    new Sentry.Replay()
  ],
});

Sentry (Node.js/Express):

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

Sentry.init({
  dsn: process.env.SENTRY_DSN,
  environment: process.env.NODE_ENV,
  tracesSampleRate: 1.0,
});

// Request handler (first middleware)
app.use(Sentry.Handlers.requestHandler());

// Error handler (after all routes, before error middleware)
app.use(Sentry.Handlers.errorHandler());

4. エラー境界の追加 (React)

import { ErrorBoundary } from '@sentry/react';

function App() {
  return (
    <ErrorBoundary fallback={<ErrorFallback />}>
      <YourApp />
    </ErrorBoundary>
  );
}

5. コンテキストの追加

ユーザーコンテキスト:

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

タグ:

Sentry.setTag("page_locale", "en-US");
Sentry.setTag("feature_flag", "new_ui");

コンテキスト:

Sentry.setContext("order", {
  id: order.id,
  total: order.total,
  items: order.items.length
});

6. パンくずリスト

エラーにつながるユーザーアクションを追跡します。

Sentry.addBreadcrumb({
  category: "auth",
  message: "User logged in",
  level: "info"
});

Sentry.addBreadcrumb({
  category: "ui",
  message: "Button clicked",
  data: { buttonId: "submit-form" }
});

7. 手動でのエラー捕捉

try {
  riskyOperation();
} catch (error) {
  Sentry.captureException(error, {
    tags: { section: "payment" },
    level: "error",
    extra: { orderId: order.id }
  });
}

8. 機密データのフィルタリング

PII のスクラブ:

Sentry.init({
  beforeSend(event, hint) {
    // 機密データが含まれている場合は送信しない
    if (event.request?.data?.password) {
      delete event.request.data.password;
    }
    return event;
  },
  ignoreErrors: [
    // ブラウザ拡張機能のエラーを無視する
    /extensions\//i,
    /^Non-Error promise rejection/,
  ]
});

9. ソースマップ (本番環境)

読みやすいスタックトレースのためにソースマップを有効にします。

Webpack:

// webpack.config.js
module.exports = {
  devtool: 'source-map',
  plugins: [
    new SentryWebpackPlugin({
      org: "your-org",
      project: "your-project",
      authToken: process.env.SENTRY_AUTH_TOKEN,
      include: "./dist",
    }),
  ],
};

10. アラート設定

以下のアラートを設定します。

  • 新しい問題
  • リグレッション (解決済みの問題が再発)
  • エラー率の急上昇
  • 重大なエラー (支払い、認証の失敗)

11. パフォーマンスモニタリング

トランザクショントラッキングを追加します。

const transaction = Sentry.startTransaction({
  name: "processOrder",
  op: "task"
});

try {
  await processOrder();
} finally {
  transaction.finish();
}

12. ベストプラクティス

  • 環境の分離: 開発/ステージング/本番環境で異なるプロジェクトを使用
  • リリースの追跡: エラーにリリースバージョンをタグ付け
  • サンプルレート: エラーは 100%、パフォーマンスは低い%
  • チームへの通知: Slack/メールの統合
  • 問題の割り当て: コードオーナーへの自動割り当て
  • エラーのグループ化: より良いグループ化のためのカスタムフィンガープリント
  • 機密データをログに記録しない: PII、パスワード、トークン

サポートファイル

  • templates/sentry-react.js: React 統合テンプレート
  • templates/sentry-node.js: Node.js 統合テンプレート
  • templates/sentry-python.py: Python 統合テンプレート
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Error Tracking Integrator

Integrates error tracking services into applications for better production debugging and monitoring.

When to Use

  • User requests error monitoring or tracking
  • Setting up production error logging
  • User mentions "Sentry", "error tracking", "crash reporting", or "production debugging"

Instructions

1. Detect Framework

Identify application framework:

  • React, Vue, Angular (frontend)
  • Express, Fastify (Node.js backend)
  • Django, Flask (Python)
  • Rails (Ruby)

2. Choose Error Tracking Service

Popular services:

  • Sentry: Most popular, comprehensive
  • Rollbar: Good for backend
  • Bugsnag: Multi-platform
  • Airbrake: Ruby-focused
  • LogRocket: Session replay + errors

3. Install and Configure

Sentry (React example):

npm install @sentry/react
import * as Sentry from "@sentry/react";

Sentry.init({
  dsn: process.env.REACT_APP_SENTRY_DSN,
  environment: process.env.NODE_ENV,
  tracesSampleRate: 1.0,
  integrations: [
    new Sentry.BrowserTracing(),
    new Sentry.Replay()
  ],
});

Sentry (Node.js/Express):

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

Sentry.init({
  dsn: process.env.SENTRY_DSN,
  environment: process.env.NODE_ENV,
  tracesSampleRate: 1.0,
});

// Request handler (first middleware)
app.use(Sentry.Handlers.requestHandler());

// Error handler (after all routes, before error middleware)
app.use(Sentry.Handlers.errorHandler());

4. Add Error Boundaries (React)

import { ErrorBoundary } from '@sentry/react';

function App() {
  return (
    <ErrorBoundary fallback={<ErrorFallback />}>
      <YourApp />
    </ErrorBoundary>
  );
}

5. Add Context

User context:

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

Tags:

Sentry.setTag("page_locale", "en-US");
Sentry.setTag("feature_flag", "new_ui");

Context:

Sentry.setContext("order", {
  id: order.id,
  total: order.total,
  items: order.items.length
});

6. Breadcrumbs

Track user actions leading to error:

Sentry.addBreadcrumb({
  category: "auth",
  message: "User logged in",
  level: "info"
});

Sentry.addBreadcrumb({
  category: "ui",
  message: "Button clicked",
  data: { buttonId: "submit-form" }
});

7. Manual Error Capture

try {
  riskyOperation();
} catch (error) {
  Sentry.captureException(error, {
    tags: { section: "payment" },
    level: "error",
    extra: { orderId: order.id }
  });
}

8. Filter Sensitive Data

Scrub PII:

Sentry.init({
  beforeSend(event, hint) {
    // Don't send if contains sensitive data
    if (event.request?.data?.password) {
      delete event.request.data.password;
    }
    return event;
  },
  ignoreErrors: [
    // Ignore browser extension errors
    /extensions\//i,
    /^Non-Error promise rejection/,
  ]
});

9. Source Maps (Production)

Enable source maps for readable stack traces:

Webpack:

// webpack.config.js
module.exports = {
  devtool: 'source-map',
  plugins: [
    new SentryWebpackPlugin({
      org: "your-org",
      project: "your-project",
      authToken: process.env.SENTRY_AUTH_TOKEN,
      include: "./dist",
    }),
  ],
};

10. Alert Configuration

Set up alerts for:

  • New issues
  • Regression (resolved issue occurs again)
  • Spike in error rate
  • Critical errors (payment, auth failures)

11. Performance Monitoring

Add transaction tracking:

const transaction = Sentry.startTransaction({
  name: "processOrder",
  op: "task"
});

try {
  await processOrder();
} finally {
  transaction.finish();
}

12. Best Practices

  • Environment separation: Different projects for dev/staging/prod
  • Release tracking: Tag errors with release version
  • Sample rates: 100% errors, lower% for performance
  • Team notifications: Slack/email integration
  • Issue assignment: Auto-assign to code owners
  • Error grouping: Custom fingerprinting for better grouping
  • Don't log sensitive data: PII, passwords, tokens

Supporting Files

  • templates/sentry-react.js: React integration template
  • templates/sentry-node.js: Node.js integration template
  • templates/sentry-python.py: Python integration template