forcedotcom

span-file-export

Use file-based span export for AI consumption. Where it lives, how to enable/clear, settings for Node and Web. Use when enabling span file dump, debugging traces for AI, or configuring local observability.

forcedotcom 1.038 456 Actualitzat fa 8 mesos
GitHub

Instal·la

npx skillscat add forcedotcom/salesforcedx-vscode/span-file-export

Instal·la des del registre de SkillsCat.

SKILL.md

Span File Export

Local span export to ~/.sf/vscode-spans/ for AI consumers. Simplified flat JSON Lines format.

Choose One: OTLP vs File

  • OTLP (enableLocalTraces): Grafana/Jaeger UI — for humans
  • File (enableFileTraces): .jsonl on disk — for AI agents, Cursor

Use only one at a time.

Where It Lives

All spans in one directory: ~/.sf/vscode-spans/

Prefix Path pattern
Node node-{extensionName}-{ISO-timestamp}.jsonl
Web web-{extensionName}-{ISO-timestamp}.jsonl

Find latest: ls -lt ~/.sf/vscode-spans/

Enable (Desktop)

Settings → search enableFileTraces → check, or:

{ "salesforcedx-vscode-salesforcedx.enableFileTraces": true }

Enable (Web / run:web)

Web POSTs to local span file server (port 3003). Server must be running.

  1. Start server: npm run spans:server -w salesforcedx-vscode-services
  2. Add to .esbuild-web-extra-settings.json at repo root (gitignored):
{ "salesforcedx-vscode-salesforcedx.enableFileTraces": true }
  1. Run npm run run:web -w packages/<extension>
  2. If settings don't appear: rm -rf packages/salesforcedx-vscode-services/.wireit packages/salesforcedx-vscode-services/dist

test:web starts the span file server automatically via wireit service dep.

Clear

rm ~/.sf/vscode-spans/* or rm -rf ~/.sf/vscode-spans/

Format

Simplified flat JSON — one object per line:

{"name":"deploy","traceId":"abc","spanId":"def","parentSpanId":"","durationMs":1234,"status":"OK","startTime":"2026-02-25T10:30:00.000Z","attributes":{"componentCount":"5"}}

Parse with JSON.parse per line.