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
Wire OTel LoggerProvider into logfire-node + expose forceFlush/shutdown
`withOnlineEvaluation` emits `gen_ai.evaluation.result` log records via
the OTel api-logs API, but logfire-node never configured a LoggerProvider
or OTLP logs exporter — records fell through to the OTel SDK's default
`localhost:4318/v1/logs`, which on most setups silently dropped them. Add
a BatchLogRecordProcessor pointing at `${baseUrl}/v1/logs` (alongside the
existing trace + metric exporters) by passing it to NodeSDK's
`logRecordProcessors`. Verified end-to-end against the local platform:
log records now POST to `localhost:3000/v1/logs` and the Live Evaluations
UI lights up with target/eval rows.
Also expose `logfire.forceFlush()` and `logfire.shutdown()` from
logfire-node, mirroring Python's `logfire.force_flush()`. The previous
`beforeExit` cleanup was racy for short-lived scripts that top-level-await
once and exit before the OTel batch processor's 5-second scheduledDelay
fires. Demos now call these explicitly so spans land deterministically.
Drop `dotenv/config` from the demo scripts: env-loaded config can silently
override the local-dev defaults (caught when `LOGFIRE_BASE_URL` in a stray
.env pointed at port 8000 instead of 3000). Demos now use their hard-coded
local-platform defaults; users wanting to point elsewhere can set env vars
explicitly via shell.
0 commit comments