穩定的事件合約
代理被引導至命名事件、有界 snake_case 欄位、顯式單元和在 SQL 中仍然有用的識別符號。
複製經過審查的 Skill.md,其中包含 TypeScript 和 Python 遙測包裝範例、安全事件邊界、SQL 驗證以及 Claude Code、Codex、Cursor 或其他程式設計代理的儀表板工作流程。
將技能運用到工作中
從準備好的 API 金鑰和代理提示開始,執行一個代表性工作流程,並在建置儀表板之前驗證生成的事件。
技能涵蓋什麼
代理被引導至命名事件、有界 snake_case 欄位、顯式單元和在 SQL 中仍然有用的識別符號。
預設情況下,原始提示、完成、憑據、授權標頭和私有有效負載不會進入分析路徑。
直到代表性事件到達並且查詢或儀表板證明工作流程可見時,檢測才完成。
Telemetry 包裝範例
從可信任的伺服器端設定傳入 API 金鑰,並用 SQL 驗證真實事件。匿名金鑰也支援這些步驟。建立儀表板前,請將工作區連結到你的帳號。保留 Python 的 User-Agent 標頭,確保請求能到達 API。
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 }),
signal: AbortSignal.timeout(5_000),
});
if (!response.ok) {
throw new Error(`Telemetry ingestion failed: ${response.status}`);
}
}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從這裡開始
將佔位符替換為伺服器端 API 金鑰,然後要求代理在選擇事件邊界之前檢查儲存庫。
Instrument this project with structured logs using /skill.md. Use this Telemetry API key 中 server-side code only: YOUR_API_KEY Anonymous keys support logging and synchronous SQL without signup. Claim the existing workspace at https://telemetry.sh/register with the same key before creating dashboards or alerts. If it is unclaimed, query the event to verify delivery and report which features need signup. Please: 1. Find the most important user-facing flows, background jobs, and AI/tooling workflows. 2. Add structured logging with snake_case table and field names. 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 in 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. Keep event payloads small and focused. Do not log credentials, raw request bodies, prompts, completions, tool arguments, or customer content. Keep telemetry delivery best-effort with bounded timeouts so a telemetry failure does not fail the application action. Make dashboard labels and charts easy to scan.審查邊界
該技能可幫助代理找到有用的工作流程邊界,但您的團隊仍然擁有事件含義、允許的欄位、保留策略和操作閾值。
繼續工作流程
Telemetry 查詢引擎支援的 SQL 方言、運算式、型別和函式。
開啟指南從有界事件模式和可審查的儀表板開始,瞭解執行、工具、延遲、成本、故障和結果。
開啟指南選擇有用的執行、工具、模型、成本、故障和結果邊界。
開啟指南複製有關產品分析、OpenAI 成本、API、收入和就業機會的重點簡報。
開啟指南審查事件設計、隱私邊界、交付行為和驗證。
開啟指南應用 Claude Code 實施過程中經過審查的事件契約和驗證迴圈。
開啟指南使用集中的 Cursor 工作流程來啟用、保留和檢查儀表板儀表。
開啟指南為 Codex 提供有關產品、可靠性和結果遙測的有限簡介並進行驗證。
開啟指南將模型、權杖、延遲、重試和接受結果事件連線到可審查的 SQL 成本儀表板。
開啟指南使用預設定的工作區、API 金鑰、代理提示和入門儀表板免費開始。連線一個真實的工作流程,驗證事件,並儲存第一個有用的查詢。