Skip to content

Propagate request trace through logs#123

Open
simonepri wants to merge 1 commit intosoedinglab:masterfrom
simonepri:trace-aware-request-logging
Open

Propagate request trace through logs#123
simonepri wants to merge 1 commit intosoedinglab:masterfrom
simonepri:trace-aware-request-logging

Conversation

@simonepri
Copy link
Copy Markdown

@simonepri simonepri commented Apr 15, 2026

Problem

MMseqs2-App server does not allow to correlate logs with request ids.

Solution

Add an OTEL trace context payload to JobRequest, populate it once from HTTP middleware, and pass it through the job constructors so the same context is available when the worker executes the job. Update job-scoped worker logs to append that context, and include explicit trace_id and span_id fields derived from traceparent for easier downstream parsing.

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

@simonepri simonepri marked this pull request as draft April 15, 2026 17:57
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

## Problem
MMseqs2-App lost request trace context as soon as work was enqueued, so
request-side and worker-side logs could not be correlated reliably. The
existing plain-text logs also only exposed `traceparent`, which is harder to
parse in systems like SigNoz or Datadog.

## Solution
Add an OTEL trace context payload to `JobRequest`, populate it once from HTTP
middleware, and pass it through the job constructors so the same context is
available when the worker executes the job. Update job-scoped worker logs to
append that context, and include explicit `trace_id` and `span_id` fields
derived from `traceparent` for easier downstream parsing.
@simonepri simonepri force-pushed the trace-aware-request-logging branch from e18706e to dfd2688 Compare April 15, 2026 20:40
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

@simonepri simonepri marked this pull request as ready for review April 15, 2026 20:41
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

@simonepri simonepri changed the title Add trace-aware request logging feat(backend): propagate otel trace through queued jobs Apr 15, 2026
@simonepri simonepri changed the title feat(backend): propagate otel trace through queued jobs Propagate request trace through logs Apr 15, 2026
@simonepri
Copy link
Copy Markdown
Author

@rachelse, @dannydoor could you please take a look at this? Thanks!

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