本文へ移動
Telemetry
コーディングエージェント向けのインストルメンテーションスキルのレビュー

skill.md 可観測性ラッパーの例

TypeScript および Python テレメトリ ラッパーの例、安全なイベント境界、SQL 検証、および Claude Code、Codex、Cursor、または別のコーディング エージェントのダッシュボード ワークフローを含むレビュー済みの skill.md をコピーします。

スキルを活かす

1 つの実際のエージェント ワークフローを今すぐ導入しましょう

準備ができた API キーとエージェント プロンプトから開始し、代表的なワークフローを 1 つ実行し、ダッシュボードを構築する前に結果のイベントを確認します。

エージェントのテレメトリを接続する

スキルがカバーする内容

検査可能なデータで終わる命令

安定したイベント契約

エージェントは、名前付きイベント、限定された snake_case フィールド、明示的なユニット、および SQL で有用な識別子に誘導されます。

安全なコレクション境界

生のプロンプト、入力完了、認証情報、認証ヘッダー、およびプライベート ペイロードは、デフォルトでは分析パスの外に留まります。

エンドツーエンドの結果

代表的なイベントが到着し、クエリまたはダッシュボードによってワークフローが表示されることが証明されるまで、インストルメンテーションは終了しません。

Telemetry ラッパーの例

エージェントに小さくてレビュー可能な取り込み境界を与える

Pass the API key from trusted server-side configuration and verify a real event with SQL. Anonymous keys support this workflow; claim the workspace before creating dashboards. Keep the Python User-Agent header so requests reach the API.

タイプスクリプト

TypeScript テレメトリ ラッパー

javascript
type TelemetryEvent = Record<string, unknown>;

export async function emitTelemetry(
  apiKey: string,
  table: string,
  data: TelemetryEvent,
) {
  const response = await fetch("https://api.telemetry.sh/log", {
    method: "POST",
    headers: {
      Authorization: apiKey,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ table, data }),
  });

  if (!response.ok) {
    throw new Error(`Telemetry ingestion failed: ${response.status}`);
  }
}
パイソン

Python テレメトリ ラッパー

python
import json
from urllib.request import Request, urlopen

def emit_telemetry(api_key: str, table: str, data: dict) -> int:
    request = Request(
        "https://api.telemetry.sh/log",
        data=json.dumps({"table": table, "data": data}).encode(),
        headers={
            "Authorization": api_key,
            "Content-Type": "application/json",
            "User-Agent": "telemetry-agent/1.0",
        },
        method="POST",
    )
    with urlopen(request, timeout=5) as response:
        return response.status

ここから始めましょう

境界のあるブリーフを 1 つ貼り付けます

プレースホルダーをサーバー側の API キーに置き換えてから、イベント境界を選択する前にリポジトリを検査するようにエージェントに依頼します。

エージェントプロンプト

AI エージェントの可観測性プロンプト

text
Instrument this project with structured logs using /skill.md. Use this Telemetry API key: YOUR_API_KEY Anonymous keys: logging and synchronous SQL work without signup. Claim the existing workspace at https://telemetry.sh/register with the same key before creating dashboards or alerts. If it is unclaimed, finish with verified event readback and mark account features as pending signup. Please: 1. Find the most important user-facing flows, background jobs, and AI/tooling workflows. 2. Add structured logging with pragmatic snake_case tables and fields. 3. Capture the key signals for each workflow, including status, latency, identifiers, and error context when relevant. 4. Run one real user-facing or operational flow through the instrumented application and verify its event appears で Telemetry. Do not use telemetry_quickstart for this milestone. 5. Run a read-only query over that real event, then create a high-level dashboard with charts and tables that summarize the most important signals in this project. 6. Tell me what you instrumented, which real flow you verified, which tables you created, and which dashboard views I should review first. Prefer small, composable events over giant payloads, and optimize for dashboards that humans can scan quickly.

境界をレビューする

人間が契約を管理できるようにする

このスキルは、エージェントが有用なワークフロー境界を見つけるのに役立ちますが、イベントの意味、許可されたフィールド、保持ポリシー、運用しきい値はチームが所有します。

  • 導入前に、新しいテーブルとフィールドをすべて確認してください。
  • プライベート ペイロードの代わりに制限された識別子を使用します。
  • 成功、失敗、最終結果を検証します。

ワークフローを続行する

AI エージェント テレメトリ ダッシュボード テンプレート

制限されたイベント スキーマと、実行、ツール、レイテンシ、コスト、失敗、結果を確認できるダッシュボードから始めます。

オープンガイド

AIエージェントの監視

有用な実行、ツール、モデル、コスト、失敗、結果の境界を選択します。

オープンガイド

エージェントプロンプトパック

製品分析、OpenAI コスト、API、収益、雇用に焦点を当てた概要をコピーします。

オープンガイド

構造化されたロギングガイド

イベントの設計、プライバシーの境界、配信動作、検証を確認します。

オープンガイド

Claude Code 可観測性

レビューされたイベント コントラクトと Claude Code 実装パスからの検証ループを適用します。

オープンガイド

Cursor テレメトリのセットアップ

アクティブ化、保持、および検査可能なダッシュボード インストルメンテーションには、焦点を絞った Cursor ワークフローを使用します。

オープンガイド

Codex 計測プロンプト

Codex に、検証付きの製品、信頼性、結果テレメトリに関する限定された概要を提供します。

オープンガイド

OpenAI コスト追跡ガイド

モデル、トークン、レイテンシー、再試行、および承認された結果のイベントを、レビュー可能な SQL コスト ダッシュボードに接続します。

オープンガイド

最初のワークフローを計測し、結果を検査する

プロビジョニングされたワークスペース、API キー、エージェント プロンプト、スターター ダッシュボードを無料で使い始めましょう。 1 つの実際のワークフローを接続し、イベントを確認し、最初の有用なクエリを保存します。