Recipes
Copy-pasteable cookbook for extending Telescope — a custom storage adapter, custom watchers, dashboard login, custom tags and redaction, request-context capture, archiving to S3 before prune, reporting frontend errors, and AI exception diagnosis.
Every recipe here is a complete, working example built against the real v1.x SPI — the same interfaces the shipped adapters and watchers implement. Read the problem statement, copy the code, adapt the clearly-marked sketch parts to your stack.
| Recipe | When you reach for it |
|---|---|
| Custom storage adapter | Persist entries in a store no shipped adapter covers (Mongo, Knex, a file). Implement StorageProvider end to end. |
| Custom watcher | Capture a source Telescope doesn't ship a watcher for (WebSocket events, a bespoke cache), correlated to the request that caused it. |
| Capture @nestjs/axios traffic | Outbound calls through HttpService (or any axios instance) bypass the fetch patch — wire the axios source to capture them too. |
| Dashboard login & sessions | Gate the dashboard against your own user table, bridge an existing JWT session, and role-gate queue mutations. |
| Custom tags & redaction | Tag entries by tenant, mask extra fields, drop noisy entries, and sample high-volume types. |
| Request context for your routes | Capture the authenticated user under a setGlobalPrefix, and drop ad-hoc debug dumps. |
| Archiving exceptions to S3 | Export entries of a type to cold storage before the pruner deletes them, with the archive.sink hook and @aws-sdk/client-s3. |
| Reporting frontend errors | Let browsers POST errors straight to Telescope (client_exception entries) instead of a hand-rolled reporter — endpoint config, the security knobs, a fetch/sendBeacon snippet, and a react-error-boundary integration. |
| AI exception diagnosis | Add a Diagnose with AI button (and optional auto-mode that enriches new-exception alerts) that turns a captured exception into a probable-cause report — Bedrock, OpenAI, or any Vercel AI SDK model. |
Each recipe links back to the concept page that explains the mechanism — the recipes are the how, the concepts are the why.
@dudousxd/nestjs-telescope-testing
Test utilities — a deterministic FakeClock, a no-NestJS watcher harness, and the in-memory storage provider re-exported for tests.
Custom storage adapter
Persist Telescope entries in a store no shipped adapter covers — implement the StorageProvider SPI end to end, with the keyset-pagination contract and the optional RollupStore add-on.