Documentation Index
Fetch the complete documentation index at: https://docs.trodo.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
Overview
When you initialise the Node or Python SDK withautoEvents: true / auto_events=True, Trodo installs process-wide exception hooks and emits a single server_error event whenever your backend crashes or rejects an unhandled promise.
This is the server-side counterpart to the browser SDK’s js_error capture — far more targeted than browser auto-events because your backend typically doesn’t have page views, clicks, or scrolls.
Server auto-events capture only uncaught exceptions. Everything else — domain events, API calls, background jobs — goes through
track().Enable
- Node.js
- Python
process.on('uncaughtException')process.on('unhandledRejection')
The server_error event
Every uncaught exception emits a single event with the following shape:
| Property | Description |
|---|---|
error_type | Exception class name (TypeError, ValueError, RuntimeError, …) |
error_message | The exception message |
stack_trace | Full stack trace as a string |
runtime | "nodejs" or "python" — identifies which backend emitted the event |
Why distinct_id = "server_global"?
Uncaught exceptions fire outside any request context. There is no user to attribute them to, so the SDK uses the synthetic id server_global. In the dashboard, filter by distinct_id = server_global to see every backend crash.
If you want a crash attributed to a specific user, catch the exception and use manual error capture instead.
Manual error capture
For handled exceptions inside a request where you already know the user, usecaptureError / capture_error on a user context. It emits the same server_error event but attaches the real distinctId.
- Node.js
- Python
'critical' | 'error' | 'warning' (default 'error').Shutdown
Auto-event handlers stay installed for the lifetime of the process. On graceful termination, callshutdown() to remove them and flush any queued events:
- Node.js
- Python
What’s not captured
- HTTP 4xx/5xx responses — those are application behaviour, not exceptions. Track them explicitly with
track('api_error', { status, route }). - Database connection pool warnings, deprecation notices, log output — not exceptions, not captured.
- Exceptions you
catchand handle — unless you callcaptureError/capture_erroryourself. - Signals (SIGKILL, SIGTERM) and OOM kills — the process dies before a handler can fire. Use your orchestrator’s crash reporting for these.
Next
Client-side auto-events
Page views, clicks, forms, media, errors in the browser
Track custom events
Instrument your own backend signals