@o11y/local-headless
v266.18.0
Published
Node-target local-file collector and static viewer for o11y-client
Downloads
434
Readme
@o11y/local-headless
Node-target local-file collector and static viewer for o11y-client.
Use this when instrumenting a local desktop app (Electron, or any Node-hosted
UI) and you want to see telemetry before deciding to upload it to Splunk.
This package is never part of the browser bundle, so its viewer adds no bytes to
o11y's browser-facing size.
Quick start
import { registerInstrumentedApp } from 'o11y/client';
import { LocalCollector } from '@o11y/local-headless';
const app = registerInstrumentedApp('my-electron-app');
const collector = new LocalCollector({ filePath: './o11y.jsonl' });
app.registerLogCollector(collector);
// On app quit, flush:
// collector.close();Then open viewer/index.html in a browser and pick your o11y.jsonl to read,
group by activity (rootId), and filter by schema.
Where it runs
Pure-Node app / Electron main process /
nodeIntegrationrenderer — the defaultFileSinkwrites the file directly. Works out of the box.Context-isolated Electron renderer — the renderer has no
fs. Supply a customSinkwhosewrite(line)forwards over IPC to a main-process handler that owns aFileSink:// renderer new LocalCollector({ sink: { write: (l) => window.o11yBridge.write(l), close: () => window.o11yBridge.close() } }); // preload exposes window.o11yBridge; main process owns the FileSink.
Record format
One JSON object per line (v: 1): { v, schemaId, schemaName, ts, rootId, seq, loggerName, data }.
Limitations (v1)
- Logs, activities, and errors only — no metrics.
- No log rotation.
- Static viewer only (no live tail).
