TraceCommand
Category: Commands
Source: trace_command.dart
Classes
TraceExportResult
Outcome of glue trace export. Returned by [exportSessionTrace] so the Command<int> layer can render it via [formatTraceExportResult] without owning any I/O logic itself.
Constructor
const TraceExportResult({
required this.sessionId,
required this.outputPath,
required this.spanCount,
required this.droppedInFlight,
required this.scannedLogFiles,
})Properties
| Property | Type | Description |
|---|---|---|
sessionId | String | |
outputPath | String | |
spanCount | int | Number of completed spans written as Complete (X) events. Excludes per-span Instant child events and M metadata events. |
droppedInFlight | int | Spans that fell within the session window but had no end_time — they were in flight when the log was sampled and cannot be Complete events. |
scannedLogFiles | List<String> | spans-*.jsonl files whose date range overlapped the session window. Empty when the session left no spans on disk (e.g. early crash before the file sink wrote anything). |
TraceExportException
Constructor
TraceExportException(this.message)Properties
| Property | Type | Description |
|---|---|---|
message | String |
Methods
String toString()
TraceCommand
glue trace … — convert recorded observability spans into a Firefox Profiler–compatible trace file (Chrome Trace Event Format). The conversion reads $GLUE_HOME/logs/ spans-*.jsonl produced by FileSink and filters to one session via its meta.json time range.
Constructor
TraceCommand()Properties
| Property | Type | Description |
|---|---|---|
name | String get | |
description | String get | |
name | String get | |
description | String get |
TraceExportCommand
Constructor
TraceExportCommand()Properties
| Property | Type | Description |
|---|---|---|
name | String get | |
description | String get | |
invocation | String get | |
name | String get | |
description | String get | |
invocation | String get |
Methods
Future<int> run()
Functions
`TraceExportResult exportSessionTrace({
required Environment env, required String sessionId, String? outputPath, })`
Resolves [sessionId] to a session on disk, scans logsDir for spans that fall within the session window, converts them with [spansToChromeTrace], and writes the result to [outputPath] (defaulting to <sessionDir>/trace.json).
Time-range filtering — rather than per-span session.id matching — keeps this command zero-cost: it reads existing JSONL without any upstream changes to span emission. Sound today because Glue runs one session per process; revisit when that stops being true.
SessionMeta? findLatestSession(Environment env)
Newest session by start_time. null when sessionsDir is empty.