ahto

Debugger

The debugger takes traces, logs and crash reports from your own programs and ties each one to the commit and file it came from.

It is the first part of a larger plan: what is built is the receiving end and the lookup. Probes that reach into a running program are not built.

What is built

ahto serve listens for OpenTelemetry over OTLP/HTTP on 127.0.0.1:4318, the port exporters use by default, so a program that already exports traces needs no change:

sh
OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4318 ./your-program

ahto keeps what it receives in its own DuckDB file, beside the lake and not in it, for 7 days. It maps a build to a commit of the lake using the revision Go stamps in the binary (or the service.version the program reports: a tag, a branch or a commit), and a stack frame to the file and line in that commit.

CallWhat it returns
GET /v1/debug/targetsthe services that sent something
GET /v1/debug/traces, /traces/{trace_id}find traces, read one
GET /v1/debug/logslogs
POST /v1/debug/crashessend a crash report
GET /v1/debug/crashes, /crashes/{id}list crash reports, read one with its code mapped

Try it without a program

With ahto serve running, send one span by hand and read it back:

sh
curl -s -X POST http://127.0.0.1:4318/v1/traces -H 'Content-Type: application/json' -d '{"resourceSpans":[{"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"demo"}}]},"scopeSpans":[{"spans":[{"traceId":"5b8efff798038103d269b633813fc60c","spanId":"eee19b7ec3c1b174","name":"GET /hello","kind":2,"startTimeUnixNano":"1700000000000000000","endTimeUnixNano":"1700000000050000000"}]}]}]}'
curl -s http://127.0.0.1:8080/v1/debug/traces
text
{}
{"traces":[{"trace_id":"5b8efff798038103d269b633813fc60c","service":"demo","root":"GET /hello","start":"2023-11-14T22:13:20Z","duration_us":"50000","spans":1,"error":false,"error_message":"","version":""}],"next_page_token":""}

Settings

SettingDefaultWhat it does
--otlp-listen (AHTO_OTLP_LISTEN)127.0.0.1:4318where ahto serve takes OTLP; off turns it off
debug.pathdebug/debug.duckdb in ahto's data folderthe store; one process opens it, ahto serve
debug.retention_days7days kept, 1 to 90, counted from when ahto received the data

The listener is on loopback only and is never started in public mode or with protocol.allow_remote.

Not built yet

Probes (breakpoints and snapshots in a running program) are planned. The design is RFC 0021.

From docs/debugger.md · This page as Markdown