Skip to content

feat(ext/cache): inject W3C traceparent/tracestate into LSC HTTP requests#32661

Open
wperron wants to merge 1 commit intodenoland:mainfrom
wperron:trace-propagation-cache
Open

feat(ext/cache): inject W3C traceparent/tracestate into LSC HTTP requests#32661
wperron wants to merge 1 commit intodenoland:mainfrom
wperron:trace-propagation-cache

Conversation

@wperron
Copy link
Member

@wperron wperron commented Mar 12, 2026

Extract the active trace context on the JS side using the telemetry propagators (ContextManager.active() + PROPAGATORS.inject()) and pass the traceparent and tracestate values as optional string fields through the cache op calls (op_cache_put, op_cache_match, op_cache_delete).

On the Rust side, CacheShard::get_object, put_object, and put_object_empty now accept an optional trace_headers parameter and inject the corresponding HTTP headers into outgoing LSC requests, enabling distributed trace propagation through the cache layer.

@wperron wperron force-pushed the trace-propagation-cache branch 2 times, most recently from 2c8fc6c to c9925b8 Compare March 12, 2026 14:02
…ests

Extract the active trace context on the JS side using the telemetry
propagators (ContextManager.active() + PROPAGATORS.inject()) and pass
the traceparent and tracestate values as optional string fields through
the cache op calls (op_cache_put, op_cache_match, op_cache_delete).

On the Rust side, CacheShard::get_object, put_object, and
put_object_empty now accept an optional trace_headers parameter and
inject the corresponding HTTP headers into outgoing LSC requests,
enabling distributed trace propagation through the cache layer.
@wperron wperron force-pushed the trace-propagation-cache branch from c9925b8 to f8a7624 Compare March 12, 2026 14:13
Copy link
Contributor

@kajukitli kajukitli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine overall, but i think this needs a test before merging

right now the JS side is extracting active trace context and threading traceparent / tracestate through the cache ops into LSC requests, but there's no coverage proving those headers actually make it onto the outgoing HTTP calls.

without a test this is pretty easy to regress later because the propagation path crosses a lot of layers:
01_cache.js -> op structs -> lsc backend -> shard request building

suggestion: add an integration test with tracing enabled and a fake LSC endpoint that records request headers, then assert traceparent is present on:

  • cache.put()
  • cache.match()
  • cache.delete()

and ideally also assert tracestate is forwarded when set.

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.

2 participants