Tracing a serverless app in ten minutes
A practical walkthrough of instrumenting a Workers app with OpenTelemetry and sending traces to Beacon.

Serverless platforms make deployment easy and debugging hard. Requests fan out across functions, queues and caches, and by the time a user reports a slow page you've lost the thread. Distributed tracing gives it back.
1. Install the SDK
Add the OpenTelemetry SDK and Beacon's exporter to your project. Both are a single dependency and work on Node, Bun and Workers runtimes.
2. Wrap your handler
Beacon's helper wraps your fetch handler so every request becomes a root span automatically. Outbound fetches, KV reads and D1 queries are captured as child spans without any extra code.
3. Look at a trace
Deploy, hit an endpoint, and open the trace viewer. You'll see the request timeline, every downstream call, and the logs emitted during each span. Slow spans are highlighted so you can go straight to the problem.
What about cost?
Traces are sampled at the edge by default. You keep 100% of errors and slow requests and a configurable share of everything else.


