Skip to content

feat(inspector): capture pipeline — AWS SDK middleware + ring buffer#211

Merged
JSisques merged 24 commits into
devfrom
feat/inspector-pr1
May 23, 2026
Merged

feat(inspector): capture pipeline — AWS SDK middleware + ring buffer#211
JSisques merged 24 commits into
devfrom
feat/inspector-pr1

Conversation

@JSisques

Copy link
Copy Markdown
Contributor

Summary

  • Adds RequestEntry type with service, operation, input, output, durationMs, status, error, attempts fields
  • Implements a module-level ring buffer (lib/aws/inspector-buffer.ts, cap 200, FIFO) to store captured SDK calls
  • Implements a payload truncation utility (lib/aws/inspector-truncate.ts) that handles strings >4KB, Uint8Array, stream duck-types, and nested objects
  • Adds withInspectorMiddleware Smithy middleware at the deserialize step to capture timing and $metadata.attempts
  • Wires the middleware into all 6 AWS client factories: DynamoDB, Lambda, SNS, SQS, CloudWatchLogs, S3

Notes

  • Ring buffer is process-scoped (resets on server restart) — intentional for a local dev tool
  • Error shape enriched to { name, message, code?, statusCode? } instead of plain string (design decision)
  • Chained PR — PR2 (Server Action + Store + UI) targets this branch

Test plan

  • pnpm test passes with 0 failures in PR1 files (71 tests)
  • Middleware records success + error entries with correct fields
  • Buffer FIFO eviction at 200 entries
  • Truncation handles all edge cases (string, binary, stream)
  • All 6 client factories have INSPECTOR middleware tag

JSisques and others added 17 commits May 23, 2026 18:11
…nspectorToolbar, and InspectorClient components
feat(inspector): timeline, empty/skeleton states, and retry badge
feat(inspector): server action, Zustand store, and list UI
@JSisques JSisques changed the base branch from main to dev May 23, 2026 16:47
@JSisques JSisques merged commit ddec5c8 into dev May 23, 2026
2 checks passed
@JSisques JSisques deleted the feat/inspector-pr1 branch May 23, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant