You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(observability): add debug logging and enhanced metrics
- Add debug logs to all event handlers (session, message, permission, activity)
- Log level now follows opencode --log-level via plugin config hook
- Add 7 new metrics: cache.count (cacheRead/cacheCreation), session.duration,
message.count, session.token.total, session.cost.total, model.usage, retry.count
- Track per-session totals (tokens, cost, messages) via sessionTotals map
- Record session duration and totals histograms on session.idle
- Increment retry counter on session.status retry events
- Fix cache counter to use occurrence counts (1) with cacheRead/cacheCreation types
- Fix accumulateSessionTotals to use setBoundedMap (immutable update)
- Fix sessionTotals leak: only delete by real sessionID in session.error
- Move accumulateSessionTotals to util.ts to eliminate cross-handler import
- Change sessionTokenGauge/sessionCostGauge from UpDownCounter to Histogram
- Include cache tokens in totalTokens for session gauge accuracy
- Add session.id attribute to modelUsageCounter for join capability
- Redact shell command arguments from debug log (log length only)
- Deduplicate config debug log (unique fields only after info startup log)
- Rename status.message to retryMessage to clarify intent
- Merge duplicate session.idle debug log into single call
- Add tests for all new behaviors (102 total, up from 86)
0 commit comments