Skip to content

Proposal: Persist trace context in job metadata #41

@Wouter12

Description

@Wouter12

Idea

To facilitate better observability and bridge the gap between background job execution and distributed tracing, I propose to add more context to the River job's metadata.

The goal is to allow otelriver to automatically inject the TraceID and SpanID into the River job's metadata field. This ensures that when viewing a job in the River UI, the operator can immediately see the associated Trace ID and navigate to their tracing backend.

Proposed Changes:

  1. Add a new configuration option PersistTraceContextInMetadata bool to MiddlewareConfig.
  2. Update InsertMany to inject the current TraceID and SpanID into the Metadata map of each JobInsertParams.
  3. Update Work to ensure the metadata is updated if the context was started within the worker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions