Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Aug 22, 2024
1 parent 834dd81 commit 4b90be9
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,25 @@ $ systemctl daemon-reload --user
$ systemctl enable --user tldr
$ systemctl start --user tldr
```

## Protocol

Clients communicate with the `tldr` daemon via a unix socket (by default in `/tmp/tldr.socket`).
Each client process should open one connection to `tldr` and send these messages:

| message | comment |
|---|---|
| OPEN <trace-id> | mandatory first message |
| {"ph": "X", …} | a normal TEF event |
| EMIT_TEF <path/to/trace.json> | optional last message |


All processes in a single program run must open the same `trace_id` (a utf-8 safe identifier
used to name the `.jsonl` file). Traces from processes using the same `trace_id` will
be written to a single `.jsonl` file and will belong in the same trace.

Events can be sent normally after the first `OPEN`, one json event per line.

At the end, one of the processes can send `EMIT_TEF /foo/trace.json` to have the server
write the whole trace, in TEF format (not `.jsonl`! rather, a single json object)
to the file at `/foo/trace.json`.

0 comments on commit 4b90be9

Please sign in to comment.