Repository navigation
fix: propagate Langfuse trace names - #32
cryptotavares wants to merge 3 commits into
Conversation
CI blocker — shared lockfile-free dependency driftConfirmed Compatibility test (20.x), run 40555896191 / job 122372348426 fails at Install dependencies via Yarn, before tests. After This matches the existing diagnosis and byte-identical base-package reproduction: fresh Langfuse 5.14.0 resolution uses the peer path introduced in 5.12.0; the existing deny policy covers only the older exporter path. The shared issue also reproduces on base Build, lint, regular tests on Node20/22/24, and security checks pass. Compatibility 22/24 are cancelled by fail-fast. The compatibility blocker remains; no source changes or workflow reruns were made. PR stays draft at |
|
Updated LavaMoat policy in ce0f395 via |
Description
Problem
The configured name currently names only the root observation. Trace propagation omits the name, so observations lack an explicit
langfuse.trace.nameattribute.Changes
traceNamethroughpropagateAttributes.NodeSDKandLangfuseSpanProcessor.Solution
flowchart TD A[Per-run telemetry] --> B[Resolve configured name or agent-runner once] B --> C[Include traceName in init and generation contexts] C --> D[Forward traceName through propagateAttributes] D --> E[Root observation] D --> F[Generation observation] D --> G[Tool observations] B -. root observation name .-> E classDef new fill:#fff3cd,stroke:#d39e00 class B,C,D newYellow boxes show the new trace-name handling.
What changes
telemetry.traceNamelangfuse.trace.nameon root, generation, and tool observationstelemetry.traceNameagent-runneragent-runnerDecisions for reviewers
traceNameand emits the trace-level attributeReview guide
src/telemetry/message-handler.tssrc/telemetry/tracing.tstraceNameforwardingsrc/telemetry/trace-name.test.ts,message-handler.test.ts,tracing.test.tssrc/types.tsTesting
Runtime: Node
v24.22.1, Yarn4.16.0.yarn build && yarn typecheck && yarn lint && CI=true yarn testpasses.dist/index.mjs,dist/index.cjs,dist/index.d.mts, anddist/index.d.cts.yarn attw --pack --format jsonpasses with assertions that types are included and package problems are empty. Node10, Node16 CJS, Node16 ESM, and bundler entrypoints resolve to declarations.git diff --checkpasses.Review note
The independent review reported no actionable regressions. Addressed the optional test-isolation nit with
metricReaders: []andlogRecordProcessors: [], supported by the installed SDK. The final full suite passes with those options.Verification uses local fixtures and in-memory span export. Live Langfuse UI behavior is not verified.
References
No linked issue.
Checklist