Skip to content

tracing: route in-process SDK writers through the v2 ring - #7326

Draft
sashwinbalaji wants to merge 1 commit into
dev/sashwinbalaji/tracing-v2-step1-protozero-stackfrom
dev/sashwinbalaji/tracing-v2-step1-scaffolding-stack
Draft

tracing: route in-process SDK writers through the v2 ring#7326
sashwinbalaji wants to merge 1 commit into
dev/sashwinbalaji/tracing-v2-step1-protozero-stackfrom
dev/sashwinbalaji/tracing-v2-step1-scaffolding-stack

Conversation

@sashwinbalaji

@sashwinbalaji sashwinbalaji commented Sep 3, 2026

Copy link
Copy Markdown
Member

Add the temporary SDK-to-v2 path used to exercise the producer-local ring in a real tracing session. The consumer still receives ordinary TracePackets through the existing v1 service connection.

The temporary hop is:

SDK -> TraceWriterV2 -> v2 ring -> relay reader/rewriter
                                  -> v1 writer -> v1 SMB -> traced

When traced reads the v2 ring directly, the relay, v1 writer and second SMB go away; the reader and rewriter move into the service ahead of the trace buffer.

  • Select v2 through the C/C++ SDK initialization arguments. Keep the producer-wide option default-off, require encoding-aware data sources and leave Rust without an opt-in.
  • Keep the optional implementation behind the established linker indirection so SDK binaries that do not enable it can discard it.
  • Decorate ProducerEndpoint::CreateTraceWriter(). Startup writers and writers without an id remain on v1.
  • Drain rings on one relay sequence. Reassemble fragments, rewrite proto groups and forward through one v1 writer per WriterID.
  • Serialize endpoint controls, per-writer flushes and retirement through ring-position watermarks and downstream v1 acknowledgements.
  • Preserve no_flush data-source semantics while still draining the ring before the producer acknowledges a service flush.
  • Retire each downstream writer only after its last ring position has been drained and flushed.
  • Complete Sync callbacks after endpoint loss instead of stranding their callers.
  • Report malformed and unsupported ring chunks as data loss on the next packet instead of silently discarding them.
  • Keep v1 writers and their arbiters alive through disconnect and shutdown, and release them on the relay sequence.
  • Test SDK selection, routing, reassembly, barrier ordering, no_flush, data loss and teardown.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Add the temporary SDK-to-v2 path used to exercise the producer-local ring in a real tracing session. The consumer still receives ordinary TracePackets through the existing v1 service connection.

The temporary hop is:

    SDK -> TraceWriterV2 -> v2 ring -> relay reader/rewriter
                                      -> v1 writer -> v1 SMB -> traced

When traced reads the v2 ring directly, the relay, v1 writer and second SMB go away; the reader and rewriter move into the service ahead of the trace buffer.

- Select v2 through the C/C++ SDK initialization arguments. Keep the producer-wide option default-off, require encoding-aware data sources and leave Rust without an opt-in.
- Keep the optional implementation behind the established linker indirection so SDK binaries that do not enable it can discard it.
- Decorate ProducerEndpoint::CreateTraceWriter(). Startup writers and writers without an id remain on v1.
- Drain rings on one relay sequence. Reassemble fragments, rewrite proto groups and forward through one v1 writer per WriterID.
- Serialize endpoint controls, per-writer flushes and retirement through ring-position watermarks and downstream v1 acknowledgements.
- Preserve no_flush data-source semantics while still draining the ring before the producer acknowledges a service flush.
- Retire each downstream writer only after its last ring position has been drained and flushed.
- Complete Sync callbacks after endpoint loss instead of stranding their callers.
- Report malformed and unsupported ring chunks as data loss on the next packet instead of silently discarding them.
- Keep v1 writers and their arbiters alive through disconnect and shutdown, and release them on the relay sequence.
- Test SDK selection, routing, reassembly, barrier ordering, no_flush, data loss and teardown.

Bug: 536851377
@sashwinbalaji
sashwinbalaji force-pushed the dev/sashwinbalaji/tracing-v2-step1-scaffolding-stack branch from a942aa5 to f0806ee Compare September 4, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant