Repository navigation
feat(durablejobs,journaling): add tracing and batching metrics - #10151
Merged
ReubenBond merged 1 commit intoMay 30, 2026
Merged
Conversation
Adds W3C-compatible distributed tracing across DurableJobs scheduling,
execution, handler invocation, and journaling persistence.
* Introduces the Microsoft.Orleans.DurableJobs ActivitySource plus
orleans.durable_job.* / orleans.journal.* semantic-convention tag
keys (in Orleans.Core.Abstractions), with InternalsVisibleTo wired
to DurableJobs and Journaling.
* DurableJobsDiagnostics owns Producer/Consumer/Internal activity
helpers (StartScheduleActivity, StartExecuteActivity,
StartHandlerActivity, StartPersistBatchActivity,
StartDeleteShardActivity) plus CaptureTraceContext /
TryParseTraceContext.
* DurableJob and ScheduleJobRequest persist the schedule activity's
W3C traceparent/tracestate; JobShard / JournaledJobShardState copy
it onto the created DurableJob so the trace survives persistence.
ShardExecutor.ExecuteJobAsync re-roots the execute span to the
persisted context and tags completed/retried/failed/canceled.
* The DurableJobReceiverExtension wraps handler invocation in an
Internal span so user grain code naturally inherits the same trace.
* JournaledJobShard captures Activity.Current.Context on every
PendingOperation at enqueue time (exposed via IHasCapturedContext)
and uses it as the parent (with the remaining distinct contexts as
ActivityLinks, capped at 128) when starting the persist-batch and
delete-shard spans.
* JournaledStateManager.WorkItem captures the calling activity's W3C
id when an operation is enqueued and starts a journal {op} span on
the Microsoft.Orleans.Storage ActivitySource using that captured
parent / link set so each shard read/write/delete shows up as a
child of the request that caused it.
* Adds an end-to-end DurableJobsTracingTests covering schedule/execute/
handler/journal trace continuity, plus the IDurableJobGrain
plumbing used to read back the handler's recorded TraceId.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ReubenBond
force-pushed
the
rebond/durablejobs-tracing-metrics
branch
from
May 30, 2026 20:58
ff7dc80 to
2384800
Compare
ReubenBond
marked this pull request as ready for review
May 30, 2026 21:05
ReubenBond
enabled auto-merge
May 30, 2026 21:05
This was referenced Jun 15, 2026
This was referenced Jun 22, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #10150.
Adds distributed tracing and batching-effectiveness instrumentation for DurableJobs and journaling, including handler execution tracking and the receiver shared-dependency refactor.
This branch is stacked on #10150, so the PR diff is cumulative until earlier PRs land and this branch is rebased.
Microsoft Reviewers: Open in CodeFlow