Skip to content

Power User Tips

1) Use traceId as your session spine

Use one trace ID through frontend actions and backend calls.

const traceId = crypto.randomUUID();
gunsole.info({
bucket: 'checkout',
message: 'Submit form',
traceId,
tags: { step: 'submit' }
});
await fetch('/api/checkout', {
method: 'POST',
headers: { 'x-trace-id': traceId }
});

2) Tune batching for bursty paths

SDK defaults:

  • batchSize: 10
  • flushInterval: 5000

For interactive debugging, reduce interval and call flush() at boundary points (route leave, worker shutdown).

3) Attach global handlers early

gunsole.attachGlobalErrorHandlers();

You capture browser and Node unhandled failures without sprinkling manual catch/log everywhere.

4) Make tags filterable, keep context rich

  • tags: enum-like values (feature=checkout, tier=pro)
  • context: payload details (statusCode, timing, IDs)

5) Use local MCP for agent workflows

MCP endpoint: POST /mcp.

Available tools:

  • list_projects
  • list_buckets
  • query_logs
  • tail_logs

This is ideal for local automation and assistant-driven triage.

6) Know what is roadmap vs shipped

From monorepo planning notes:

  • Shipped: pagination metadata, server-side tag filtering, REST endpoints, MCP server.
  • Planned: updater hardening, live logs (liveId/cards/tables/progress), timeline grouping UX.