Skip to content

[💡 FEATURE REQUEST]: Allow overriding traceparent in Jobs plugin to continue existing trace from HTTP request #2211

@bohemima

Description

@bohemima

Plugin

Jobs

I have an idea!

Description

Currently, when using RoadRunner with the Laravel Bridge package, the Jobs plugin always starts a new span when a job is pushed via RPC, even if a valid traceparent header is already available from the initial HTTP request.

In the following scenario, this leads to disconnected traces:

  1. API request arrives → handled by RR HTTP worker.
  2. Laravel handles request and pushes a job to RR via RPC (Kafka backend).
  3. RR Jobs plugin picks up the job and sends it to a PHP worker.
  4. Tracing shows separate spans for HTTP request and Job execution — they are not connected in a single trace.

Current Behavior

  • RR creates a new span when the job is pushed, regardless of whether a traceparent was already provided.
  • There is no way to pass the current traceparent to the Jobs plugin for it to be used instead of generating a new one.

Expected Behavior / Feature Request

  • Add support in the Jobs plugin to accept and use an external traceparent if provided in the job headers when pushing via RPC.
  • If the header is valid and present, the Jobs plugin should use it to continue the existing trace rather than creating a new root span.
  • This would allow full end-to-end tracing across:
    • RR HTTP → Laravel → Job push (RPC) → RR Jobs → Laravel worker.

Use Case

Ensures uninterrupted tracing across HTTP requests and queued jobs in systems where RR is both the HTTP and Job server, improving observability for distributed tracing with OpenTelemetry.

Metadata

Metadata

Assignees

Labels

C-feature-acceptedCategory: Feature discussed and acceptedC-feature-requestCategory: feature requested, but need to be discussedW-waiting on responseWait: waiting for the issue creator response

Projects

Status

📋 Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions