You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/logfire-instrumentation-strategy.md
+60Lines changed: 60 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -403,6 +403,66 @@ Add:
403
403
404
404
This makes the trace view and the log stream tell the same story without forcing logger rewrites across the codebase.
405
405
406
+
## Local Dev Playbook
407
+
408
+
The fastest way to sanity-check the current trace shape is:
409
+
410
+
```bash
411
+
LOGFIRE_TOKEN=lf_... just telemetry-smoke
412
+
```
413
+
414
+
What this does:
415
+
416
+
- creates an isolated temp home, config dir, and project path
417
+
- enables Logfire for the run
418
+
- automatically exports to Logfire when `LOGFIRE_TOKEN` is present
419
+
- defaults `BASIC_MEMORY_SEMANTIC_SEARCH_ENABLED=false` so the smoke run stays fast and trace-friendly
420
+
- disables promo telemetry so the trace is about Basic Memory work, not analytics noise
421
+
- runs a small CLI workflow:
422
+
-`project add`
423
+
-`tool write-note`
424
+
-`tool search-notes`
425
+
-`doctor`
426
+
427
+
If you want to exercise the instrumentation without exporting anything upstream:
428
+
429
+
```bash
430
+
BASIC_MEMORY_LOGFIRE_SEND_TO_LOGFIRE=false just telemetry-smoke
431
+
```
432
+
433
+
If you want the smoke run to include vector or hybrid retrieval spans too:
434
+
435
+
```bash
436
+
LOGFIRE_TOKEN=lf_... BASIC_MEMORY_SEMANTIC_SEARCH_ENABLED=true just telemetry-smoke
437
+
```
438
+
439
+
The recipe sets `BASIC_MEMORY_LOGFIRE_ENVIRONMENT=telemetry-smoke` by default so these traces are easy to isolate in Logfire. Override it if you want the smoke traces grouped under a different environment name.
440
+
441
+
### What to look for
442
+
443
+
You should see a small set of comparable root spans rather than a framework-generated span forest:
444
+
445
+
-`cli.command.project`
446
+
-`cli.command.tool`
447
+
-`mcp.tool.write_note`
448
+
-`mcp.tool.search_notes`
449
+
-`sync.project.run`
450
+
451
+
You should also see correlated logs under those traces with stable fields like:
452
+
453
+
-`project_name`
454
+
-`route_mode`
455
+
-`tool_name`
456
+
-`entrypoint`
457
+
458
+
### Expected nuance
459
+
460
+
`doctor` creates its own temporary project on purpose. That means the sync trace will usually show a different project name than the `telemetry-smoke` write/search traces. That is fine for smoke testing because the goal is to confirm:
461
+
462
+
- root span names are meaningful
463
+
- scoped logs stay attached to the active trace
464
+
- routing, tool, search, and sync phases are easy to distinguish
465
+
406
466
## Validation Checklist
407
467
408
468
We should consider the integration successful when the following are true:
0 commit comments