Journaltypeno test imports ittype Journal = { readonly signals: Signals; readonly skipped: number };What a journal gave: the signals, and how many lines did not decode.
The journal of signals, read for a question (commons telemetry 0002-telemetry-query FR-004, FR-005): each line of the journal files is one OTLP/JSON export request (resourceSpans, resourceLogs or resourceMetrics), decoded as the exporter encoded it, and a line that does not decode is counted and left out. main is the command line [--limit N] [--json] FILE... -- "SELECT ...": the answer as a table or JSON; it writes nothing.
bun tools/query.ts ~/.cache/app/telemetry.jsonl -- "SELECT name, duration_ms FROM spans ORDER BY duration_ms DESC LIMIT 5"Journaltypeno test imports ittype Journal = { readonly signals: Signals; readonly skipped: number };What a journal gave: the signals, and how many lines did not decode.
parseJournalfunctionfunction parseJournal(texts: readonly string[]): JournalThe signals of the text of journal files: a line of each kind decodes with its own decoder; a blank line is nothing, and any other line is skipped.
readJournalfunctionfunction readJournal(paths: readonly string[]): Promise<Journal>The signals of journal files, read in the order given (a file that is not there is empty).
tableTextfunctionno test imports itfunction tableText(answer: Answer): stringThe rows as aligned text: a header, then a row for each.
mainfunctionfunction main(argv: readonly string[]): Promise<{ readonly code: 0 | 1 | 2; readonly lines: readonly string[]; }>The command line: the exit status (0 an answer, 1 a refused question, 2 a line that does not fit) and what to print.