customerio-advanced-troubleshooting
Customer.ioの高度なデバッグ技法を活用できます。 複雑な問題の診断、配信の問題調査、統合失敗のデバッグが必要な場合に使用してください。「customer.ioをデバッグする」「customer.io調査」「customer.ioトラブルシュート」「customer.ioインシデント」といったフレーズで起動できます。
description の原文を見る
Apply Customer.io advanced debugging techniques. Use when diagnosing complex issues, investigating delivery problems, or debugging integration failures. Trigger with phrases like "debug customer.io", "customer.io investigation", "customer.io troubleshoot", "customer.io incident".
SKILL.md 本文
Customer.io 高度なトラブルシューティング
概要
Customer.io 統合の複雑な問題を診断するための高度なデバッグ手法です。
前提条件
- Customer.io ダッシュボードへのアクセス
- アプリケーションログへのアクセス
- 統合アーキテクチャの理解
トラブルシューティングフレームワーク
フェーズ 1: 症状の特定
1. 期待される動作は何か?
2. 実際の動作は何か?
3. 問題はいつ開始したか?
4. 影響を受けたユーザー/メッセージの数は?
5. 一貫して発生するか、それとも断続的か?
手順
ステップ 1: API デバッグ
// lib/debug-client.ts
import { TrackClient, RegionUS } from '@customerio/track';
interface DebugResult {
success: boolean;
latency: number;
requestId?: string;
error?: {
code: string;
message: string;
details?: any;
};
}
export class DebugCustomerIO {
private client: TrackClient;
constructor() {
this.client = new TrackClient(
process.env.CUSTOMERIO_SITE_ID!,
process.env.CUSTOMERIO_API_KEY!,
{ region: RegionUS }
);
}
async debugIdentify(
userId: string,
attributes: Record<string, any>
): Promise<DebugResult> {
const start = Date.now();
console.log('=== Customer.io Debug: Identify ===');
console.log('User ID:', userId);
console.log('Attributes:', JSON.stringify(attributes, null, 2));
try {
await this.client.identify(userId, attributes);
const result: DebugResult = {
success: true,
latency: Date.now() - start
};
console.log('Result: SUCCESS');
console.log('Latency:', result.latency, 'ms');
return result;
} catch (error: any) {
const result: DebugResult = {
success: false,
latency: Date.now() - start,
error: {
code: error.statusCode || 'UNKNOWN',
message: error.message,
details: error.response?.body
}
};
console.log('Result: FAILED');
console.log('Error:', JSON.stringify(result.error, null, 2));
return result;
}
}
async debugTrack(
userId: string,
event: string,
data?: Record<string, any>
): Promise<DebugResult> {
const start = Date.now();
console.log('=== Customer.io Debug: Track ===');
console.log('User ID:', userId);
console.log('Event:', event);
console.log('Data:', JSON.stringify(data, null, 2));
try {
await this.client.track(userId, { name: event, data });
return {
success: true,
latency: Date.now() - start
};
} catch (error: any) {
return {
success: false,
latency: Date.now() - start,
error: {
code: error.statusCode || 'UNKNOWN',
message: error.message
}
};
}
}
}
ステップ 2: ユーザープロフィール調査
// scripts/investigate-user.ts
interface UserInvestigation {
userId: string;
profile: {
exists: boolean;
attributes: Record<string, any>;
segments: string[];
};
activity: {
lastIdentify: Date;
lastEvent: Date;
eventCount24h: number;
recentEvents: string[];
};
delivery: {
emailsSent: number;
emailsDelivered: number;
emailsOpened: number;
bounces: number;
complaints: number;
suppressed: boolean;
};
issues: string[];
}
async function investigateUser(userId: string): Promise<UserInvestigation> {
const investigation: UserInvestigation = {
userId,
profile: { exists: false, attributes: {}, segments: [] },
activity: {
lastIdentify: new Date(0),
lastEvent: new Date(0),
eventCount24h: 0,
recentEvents: []
},
delivery: {
emailsSent: 0,
emailsDelivered: 0,
emailsOpened: 0,
bounces: 0,
complaints: 0,
suppressed: false
},
issues: []
};
// 1. ユーザーが存在するかチェック
try {
const profile = await fetchUserProfile(userId);
investigation.profile = {
exists: true,
attributes: profile.attributes,
segments: profile.segments
};
} catch (error) {
investigation.issues.push('User profile not found in Customer.io');
return investigation;
}
// 2. 必須属性の欠落をチェック
if (!investigation.profile.attributes.email) {
investigation.issues.push('User missing email attribute - cannot receive emails');
}
// 3. 抑制ステータスをチェック
if (investigation.delivery.suppressed) {
investigation.issues.push('User is suppressed - no messages will be sent');
}
// 4. バウンス/クレーム履歴をチェック
if (investigation.delivery.bounces > 0) {
investigation.issues.push(`User has ${investigation.delivery.bounces} bounces`);
}
if (investigation.delivery.complaints > 0) {
investigation.issues.push(`User has ${investigation.delivery.complaints} spam complaints - HIGH PRIORITY`);
}
// 5. 最近のアクティビティをチェック
const oneDayAgo = new Date(Date.now() - 24 * 60 * 60 * 1000);
if (investigation.activity.lastIdentify < oneDayAgo) {
investigation.issues.push('User profile not updated in 24+ hours');
}
return investigation;
}
ステップ 3: キャンペーンのデバッグ
// scripts/debug-campaign.ts
interface CampaignDebug {
campaignId: number;
status: 'active' | 'paused' | 'draft';
trigger: {
type: string;
conditions: any;
};
audience: {
segmentId?: number;
estimatedSize: number;
};
recentSends: Array<{
userId: string;
timestamp: Date;
status: string;
}>;
issues: string[];
}
async function debugCampaign(campaignId: number): Promise<CampaignDebug> {
const debug: CampaignDebug = {
campaignId,
status: 'draft',
trigger: { type: '', conditions: {} },
audience: { estimatedSize: 0 },
recentSends: [],
issues: []
};
// API からキャンペーン詳細を取得
// トリガー条件を分析
// オーディエンスサイズをチェック
// 最近の送信アクティビティを確認
// チェック対象の一般的な問題
if (debug.status !== 'active') {
debug.issues.push('Campaign is not active');
}
if (debug.audience.estimatedSize === 0) {
debug.issues.push('No users match campaign audience');
}
return debug;
}
ステップ 4: ウェブフック デバッグ
// lib/webhook-debugger.ts
import crypto from 'crypto';
interface WebhookDebugResult {
signatureValid: boolean;
payloadParsed: boolean;
eventsProcessed: number;
errors: Array<{
event: string;
error: string;
}>;
processingTime: number;
}
export function debugWebhook(
rawBody: string,
signature: string,
secret: string
): WebhookDebugResult {
const start = Date.now();
const result: WebhookDebugResult = {
signatureValid: false,
payloadParsed: false,
eventsProcessed: 0,
errors: [],
processingTime: 0
};
// 1. 署名を検証
const expectedSignature = crypto
.createHmac('sha256', secret)
.update(rawBody)
.digest('hex');
result.signatureValid = crypto.timingSafeEqual(
Buffer.from(signature || ''),
Buffer.from(expectedSignature)
);
if (!result.signatureValid) {
console.log('Expected signature:', expectedSignature);
console.log('Received signature:', signature);
result.processingTime = Date.now() - start;
return result;
}
// 2. ペイロードを解析
try {
const payload = JSON.parse(rawBody);
result.payloadParsed = true;
// 3. イベントを処理
for (const event of payload.events || []) {
try {
console.log('Processing event:', event.metric, event.event_id);
result.eventsProcessed++;
} catch (error: any) {
result.errors.push({
event: event.event_id,
error: error.message
});
}
}
} catch (error: any) {
result.errors.push({
event: 'parse',
error: error.message
});
}
result.processingTime = Date.now() - start;
return result;
}
ステップ 5: ネットワーク デバッグ
#!/bin/bash
# scripts/debug-network.sh
echo "=== Customer.io Network Diagnostics ==="
# 1. DNS 解決
echo -e "\n1. DNS Resolution:"
dig track.customer.io +short
# 2. TCP 接続性
echo -e "\n2. TCP Connectivity:"
nc -zv track.customer.io 443 2>&1
# 3. TLS ハンドシェイク
echo -e "\n3. TLS Certificate:"
echo | openssl s_client -connect track.customer.io:443 2>/dev/null | openssl x509 -noout -dates
# 4. API レスポンスタイム
echo -e "\n4. API Latency:"
curl -o /dev/null -s -w "Connect: %{time_connect}s\nTTFB: %{time_starttransfer}s\nTotal: %{time_total}s\n" \
-X POST "https://track.customer.io/api/v1/customers/test" \
-u "$CUSTOMERIO_SITE_ID:$CUSTOMERIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email":"test@test.com"}'
# 5. レート制限をチェック
echo -e "\n5. Rate Limit Check:"
for i in {1..5}; do
curl -s -o /dev/null -w "%{http_code}\n" \
-X POST "https://track.customer.io/api/v1/customers/test-$i" \
-u "$CUSTOMERIO_SITE_ID:$CUSTOMERIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email":"test@test.com"}'
done
ステップ 6: インシデント対応ランブック
## Customer.io インシデント対応ランブック
### P1: 完全な API 障害
1. https://status.customer.io/ をチェック
2. 認証情報が期限切れていないことを確認
3. curl で直接テスト
4. サーキットブレーカーが利用可能な場合は有効化
5. 再試行用にイベントをキューイング
6. ステークホルダーに通知
### P2: 高いエラー率(>5%)
1. タイプ別エラー分布をチェック
2. 影響を受けた操作を特定
3. 最近のコードデプロイを確認
4. レート制限をチェック
5. 自己起因の場合はスケールダウン
### P3: 配信の問題
1. バウンス/クレーム率をチェック
2. 抑制リストを確認
3. 送信者の評判を確認
4. キャンペーン設定を確認
5. セグメント条件を確認
### P4: ウェブフック障害
1. ウェブフック秘密鍵を確認
2. エンドポイントの可用性をチェック
3. ペイロード形式を確認
4. 重複イベントをチェック
5. べき等性の処理を確認
診断コマンド
# API ヘルスをチェック
curl -s "https://status.customer.io/api/v2/status.json" | jq '.status'
# 認証をテスト
curl -u "$CIO_SITE_ID:$CIO_API_KEY" "https://track.customer.io/api/v1/accounts"
# ユーザーが存在するかチェック
curl -u "$CIO_SITE_ID:$CIO_API_KEY" "https://track.customer.io/api/v1/customers/USER_ID"
エラーハンドリング
| 問題 | 解決策 |
|---|---|
| ユーザーがメールを受け取らない | 抑制、セグメントをチェック |
| イベントが追跡されない | ユーザー識別を先に実施したことを確認 |
| 遅延が大きい | ネットワークをチェック、プーリングを有効化 |
リソース
次のステップ
トラブルシューティング後、回復性のため customerio-reliability-patterns に進んでください。
ライセンス: MIT(寛容ライセンスのため全文を引用しています) · 原本リポジトリ
詳細情報
- 作者
- Brmbobo
- リポジトリ
- Brmbobo/Web2podcast
- ライセンス
- MIT
- 最終更新
- 2026/1/26
Source: https://github.com/Brmbobo/Web2podcast / ライセンス: MIT
関連スキル
3-statement-model
3種類の財務諸表テンプレート(損益計算書、貸借対照表、キャッシュフロー計算書)を作成・記入・完成させることができます。モデルテンプレートの記入、既存のモデル枠組みの完成、財務モデルへのデータ入力、部分的に完成した損益/貸借/キャッシュフロー枠組みの完成、または既存テンプレート構造内での統合財務諸表の連携に対応しています。3種類の財務モデルテンプレートの記入、完成、またはデータ入力に関するご依頼で自動的に機能します。
strategic-decision
CEO・経営層向けの戦略的意思決定支援です。前提条件に異議を唱え、問題を診断し、確実な戦略を設計できます。4つのモード(AGGRESSIVE:大きな夢を見る、SELECTIVE:基盤を維持しつつ有望な拡張を厳選、DIAGNOSTIC:最大限の厳密性、VALIDATION:本質に絞る)を備えています。創業者、経営幹部、プロダクトリーダーが製品開発、成長戦略、市場戦略、技術選定、リソース配分に関する戦略的判断が必要な場面で活用できます。
value-realization
エンドユーザーが製品アイデアから明確な価値を感じるかどうかを分析します。以下の場面で活用できます:製品コンセプトの議論、機能の評価、製品改善の方向性提示、マーケティング戦略の企画、導入・継続率の問題分析、コピーが価値を伝えているかの検証、機能と利用シーンの対応付け、または製品方向性・ポジショニング・エンドユーザーの需要の有無が不確かな場合(例:「これは良いアイデアか」「この製品をどう思うか」「ユーザーは必要とするか」「この機能は何に役立つのか」「機能の価値をどう説明するか」「このコピーをどう思うか」「利用シーンを作成する手助けが欲しい」「ユーザーが継続利用しない理由は何か」「どうポジショニングすべきか」)。
creating-financial-models
このスキルは、投資判断に必要な高度な財務モデリング機能を提供します。DCF分析、感度分析、モンテカルロシミュレーション、シナリオプランニングなど、複数の分析手法を組み合わせることで、より正確で信頼性の高い財務予測が可能になります。
pestel-analysis
政治的、経済的、社会的、技術的、環境的、法的な外部要因を分析します。市場環境の変化が製品、ロードマップ、または戦略に大きな影響を与える可能性がある場合に活用できます。
chemical_safety_assessment
化学安全性評価 - 化学物質の安全性を評価します。PubChemの化合物情報、FDAの医薬品データ、ADMET予測、ChEMBLの構造警告を活用します。このスキルを使用することで、化合物名から一般情報を取得したり、医薬品名から警告および注意事項を取得したり、分子のADMETを予測したり、化合物の構造警告を検出したりできます。4つのSCPサーバーから4つのツールを統合しています。