docs(bd-czg): document config-based NEEDLE→FABRIC wiring and enable fabric telemetry

Enable fabric.enabled in ~/.needle/config.yaml and add README section
explaining HTTP POST /api/events as a simpler local-dev alternative to OTLP.
NEEDLE's FabricConfig already includes endpoint in src/config/mod.rs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jedarden 2026-04-23 15:46:47 -04:00
parent 91d0896797
commit de96f2a776

View file

@ -87,6 +87,29 @@ NEEDLE does the work. FABRIC shows you what's happening and helps you understand
## Wiring NEEDLE → FABRIC
There are two ways to send NEEDLE telemetry to FABRIC: config-based HTTP POST (simpler) or OTLP (lower latency, more features).
### Option 1: Config-based HTTP POST (recommended for local dev)
Set `fabric.enabled: true` in `~/.needle/config.yaml`:
```yaml
fabric:
enabled: true
endpoint: http://localhost:3000/api/events
timeout: 2
batching: false
```
Start FABRIC web server, then start NEEDLE workers — events flow automatically:
```bash
fabric web # starts on http://localhost:3000
needle run ... # workers POST to /api/events
```
### Option 2: OTLP (recommended for multi-host or production)
NEEDLE ships with an `otlp` feature (enabled by default in `Cargo.toml`) that exports telemetry over the standard OpenTelemetry OTLP protocol. No rebuild or extra flags are needed — just set two environment variables before launching workers:
```bash