Expand description
Span-tree logging for Jan cron scripts and agent pipelines.
Spans live under logs/ in the store root. Each span is a JSON file
logs/<id>.json; log events are embedded in the span they belong to.
Reading back a span tree walks the directory and reconstructs parent→child
relationships in memory.
Layout:
logs/
<uuid>.json # one file per spanSpan JSON schema:
{
"id": "<uuid>",
"name": "fetch-prices",
"parent_id": "<uuid> | null",
"started_at": "<rfc3339>",
"ended_at": "<rfc3339> | null",
"fields": { "key": "value", ... },
"events": [
{ "message": "...", "fields": {...}, "timestamp": "<rfc3339>" }
]
}Structs§
Functions§
- load_
all_ spans - Load every span from
logs/. - log_
event - Add a log event to a span.
- parse_
fields - Parse
key=valuepairs from a slice of strings. - render_
tree - Render a span tree as indented text, starting from roots (or the given span).
- span_
end - End a span (record
ended_at). - span_
set_ fields - Set key/value fields on an existing span.
- span_
start - Start a new span, optionally nested under
parent_id. Returns the new span’s UUID.