instrument-runtime-telemetry
Mandatory telemetry checklist for Agent Session Manager runtime behavior features, fixes, and refactors. Load before changing runtime behavior so spans, invariants, tests, and catalogs stay diagnostically complete.
- License 许可
- MIT
- 最近更新
- 2026-10-25
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- instrument-runtime-telemetry
- description
- Mandatory telemetry checklist for Agent Session Manager runtime behavior features, fixes, and refactors. Load before changing runtime behavior so spans, invariants, tests, and catalogs stay diagnostically complete.
03 SKILL.md 正文
Instrument Runtime Telemetry
Load this skill for every feature, bug fix, or refactor that changes runtime behavior. This checklist applies even when telemetry is not the primary feature.
Choose The Signal
- Emit a span for operations, lifecycle transitions, meaningful points in time, and success or failure outcomes.
- Use span attributes for operation context and events for meaningful points during a long-lived operation.
- Report an invariant when a runtime contract is violated and the occurrence must remain visible as a separate diagnostic record.
- Use both when an invariant occurrence also belongs in trace correlation.
- Every
TracingServicespan/record call automatically forwards to unified logging (os.LoggerviaAppLog) and an Instruments signpost — always on, independent of Debug Mode. Do not addprint,NSLog, or a separate log call alongside a span for the same event; the span is the single instrumentation point. - If you need a direct
AppLogcall outside a span (rare — most events should just be a span), follow the same privacy split asAppLog.log: event name.public(a static string), attribute values.private(they may carrycwd, git args, or error strings).
Required Context
Every pane-scoped span must include:
pane.id
pane.name
tab.id
tab.name
Record a bounded result or failure attribute for operations with meaningful outcomes. End every started long-lived span on all success, failure, cancellation, and early-return paths.
Data Rules
- Keep local telemetry bounded and compatible with existing retention and trimming.
- Do not expose app plumbing in terminal panes. Preserve Terminal Purity.
- Do not add secrets, environment-variable values, auth material, or terminal-content capture.
- Keep payload excerpts tightly bounded and add them only when they are required for diagnosis.
- Update telemetry tests and the tracing, debug-mode, or invariant catalog when runtime telemetry changes.
Prioritized Backlog
Record these as future production instrumentation work; do not fold them into unrelated changes:
- Add stronger correlation IDs across pane lifecycle, status-line, and PR-tracking paths.
- Emit app startup and build metadata. Partially satisfied: the OTel
Resourceon every trace file's metadata header already carriesservice.version,os.*, anddevice.*(seedocumentation/features/tracing.md). Startup-event-level metadata (e.g. aapp.launchedspan) is still open. - Complete pane create, restore, close, restart, and shell lifecycle coverage.
- Add explicit failure outcomes for worktree, terminal, settings, and notification operations.
- Surface exporter write and trim failures.
- Surface provider and watcher setup/read failures.
- Close PR-cycle spans on every early return and report skipped outcomes.
Use OpenTelemetry span concepts consistently: attributes describe context, events mark meaningful moments, and failed operations carry error status or an equivalent bounded result field.
04 同仓库更多 Skills
workflow
Development workflow for this repo: plan → test → implement → human review → repeat. Load when starting any feature, bug fix, or refactor.
usernotifications-documentation
UserNotifications official doc index — load when building notification features, requesting authorization, scheduling local notifications, handling notification actions, or any UserNotifications framework behavior.
swiftui-macos-form-alignment
SwiftUI macOS Form layout: alignment override bug, background control, and VStack-based alternative. Load when debugging alignment issues inside Form rows, or when row controls (toggles, text fields, pickers) are visually misaligned with their labels on macOS.
swiftui-documentation
SwiftUI official doc index — load when building SwiftUI views, modifiers, state management, data flow, AppKit bridging, or any SwiftUI behavior.
swifterm-documentation
SwiftTerm official doc index — load when building SwiftTerm features, terminal emulation, terminal views, process lifecycle, delegate callbacks, GPU rendering, pseudo-terminals, or any SwiftTerm-specific behavior. Any project that uses or interacts with SwiftTerm should load this skill.
sqlite-documentation
SQLite official doc index — load when working with SQLite, the C/C++ API, import SQLite3, prepared statements, binding, query execution, result codes, or any SQLite-specific behavior. Any project that uses or interacts with SQLite should load this skill.