Repository navigation
Create parentless roots for v4 trace summaries - #128
Merged
Merged
Conversation
bcdonadio
marked this pull request as ready for review
October 6, 2026 17:14
kxzk
force-pushed
the
fix/explicit-trace-id-roots
branch
from
October 7, 2026 13:29
15b0605 to
df60724
Compare
4 tasks done
kxzk
force-pushed
the
fix/explicit-trace-id-roots
branch
3 times, most recently
from
October 8, 2026 12:09
e65893f to
ac97f76
Compare
Avoid unexported synthetic parents so v4 can aggregate observation input and output from real roots. Preserve nesting, sampling and no-op correlation; pair the tracer and generator across provider lifecycle changes. Sixteen regressions and the full locked Ruby 3.4.5 suite pass. Signed-off-by: Bernardo Donadio <bcdonadio@bcdonadio.com>
Keep the explicit trace ID behavior documented in docs/TRACING.md. The top-level README addition is unnecessary for this fix. Signed-off-by: Bernardo Donadio <bcdonadio@bcdonadio.com>
kxzk
force-pushed
the
fix/explicit-trace-id-roots
branch
from
October 8, 2026 13:57
c1d61e9 to
2c05bb8
Compare
3 of 4 tasks
benlangfeld
added a commit
to powerhome/nitro-intelligence.rb
that referenced
this pull request
Oct 19, 2026
langfuse-rb 0.12.4 creates a parentless root for an explicit trace_id (simplepractice/langfuse-rb#128) and marks it for legacy trace summaries (#129). That is the behaviour #137 carried as its own start_root_span and ID generator, so upgrade from 0.7.0 and use upstream's RootSpanIdGenerator and create_otel_span root path instead. langfuse-rb's SpanProcessor now owns the batching, so the tracer provider passes it the exporter rather than adding a separate batch processor. The seeded-root regression specs from #137 pass unchanged against upstream's implementation, and a new spec covers the as_root marker. Closes #164 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DRCreate parentless roots for explicit
trace_id:values so v4 trace summaries can select input/output.WhyDepends on #129 for legacy summaries. Explicit roots use root sampling. This differs from Python's placeholder-parent behavior. Applications that replace the ID generator retain the placeholder parent.
ChecklistRelated to #125. Stack order: #129, then #128.
Verification
Automated tests, RuboCop, and live Cloud CLI/UI checks passed for parentage and input/output. The internal v4 summary query remains unverified.
Note
Medium Risk
Changes core span parentage, sampling, and context for explicit trace IDs; behavior shifts for apps relying on placeholder parents, though custom ID generators retain the old path.
Overview
Explicit
trace_id:onstart_observation/observenow starts a parentless OpenTelemetry root (even with an active span), uses the provider root sampler, and restores ambient context when the block ends. Children inside the explicit root still attach to that root; repeated calls with the same ID remain separate roots and still get the legacyas_rootmark for v4 trace input/output summaries.Implementation adds
RootSpanIdGeneratoron the Langfuse tracer provider and routes explicit roots throughwith_trace_id, which clears the ambient parent and Langfuse trace baggage claim while scoping the requested trace ID to the span start.otel_tracer_and_id_generatorkeeps tracer and generator paired if the provider is reconfigured. ReplacingLangfuse.tracer_provider.id_generatorfalls back to the previous placeholder-parent behavior (documented).Reviewed by Cursor Bugbot for commit 2c05bb8. Bugbot is set up for automated code reviews on this repo. Configure here.