Part of the Telemetry Phase A rollout. See the RFC in Linear: AIGOV-154.
Scope
- Register the
coder.exportTelemetry command via the dispatcher from ENG-2458.
- Date range selection via
QuickPick with presets ("Last 24 hours", "Last 7 days", "Last 30 days", "All time", "Custom range…"). Custom range falls back to two InputBox prompts with validateInput for YYYY-MM-DD dates.
- File filtering by filename only, since daily files are date-stamped. No file contents are opened outside the selected range.
- Format selection via a second
QuickPick:
- JSON array (default): a single JSON document for human inspection or compliance review.
- OTLP/JSON: OpenTelemetry Logs data model wrapped in
{ "resourceLogs": [...] }. Resource attributes are lifted from the stored context; each event becomes one LogRecord with body, attributes, and observedTimeUnixNano. Can be POSTed unchanged to any OTLP/HTTP endpoint.
- Streaming output via
readline.createInterface + createReadStream. Memory usage stays proportional to a single line, not total file size.
vscode.window.showSaveDialog with suggested filename coder-telemetry-{range}.{ext} and a filter matching the chosen format.
Tests
- Unit tests for date range parsing and the filename-based file filter.
- Unit tests for the JSON-array writer (header, comma-separated lines, footer).
- Unit tests for the OTLP/JSON writer (envelope structure,
LogRecord shape, resource attribute mapping from context).
- Memfs-backed integration test that seeds a few JSONL files, exports a range, and verifies the output.
Out of scope
- No Prometheus endpoint. Prometheus cannot ingest event files directly. Users who want Prometheus feed the OTLP/JSON output into an OTel Collector and let it forward via the
prometheusremotewrite exporter.
Depends on AIGOV-243, AIGOV-244, ENG-2458.
Part of the Telemetry Phase A rollout. See the RFC in Linear: AIGOV-154.
Scope
coder.exportTelemetrycommand via the dispatcher from ENG-2458.QuickPickwith presets ("Last 24 hours", "Last 7 days", "Last 30 days", "All time", "Custom range…"). Custom range falls back to twoInputBoxprompts withvalidateInputforYYYY-MM-DDdates.QuickPick:{ "resourceLogs": [...] }. Resource attributes are lifted from the storedcontext; each event becomes oneLogRecordwithbody,attributes, andobservedTimeUnixNano. Can be POSTed unchanged to any OTLP/HTTP endpoint.readline.createInterface+createReadStream. Memory usage stays proportional to a single line, not total file size.vscode.window.showSaveDialogwith suggested filenamecoder-telemetry-{range}.{ext}and a filter matching the chosen format.Tests
LogRecordshape, resource attribute mapping fromcontext).Out of scope
prometheusremotewriteexporter.Depends on AIGOV-243, AIGOV-244, ENG-2458.