Repository navigation
How to measure an orchestration's total execution time from isolated-worker middleware when it runs once per replay episode? #3508
Unanswered
hz-git-oss
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
We have a small instrumentation
IFunctionsWorkerMiddlewarethat measures thelogical execution time of each orchestration/activity and logs one
ExecutionInforecord. It reads the logical clock(
TaskOrchestrationContext.CurrentUtcDateTime) before and afternext(context). This worked fine up toMicrosoft.Azure.Functions.Worker.Extensions.DurableTaskv1.10, but breaks onv1.11.0+. We'd like the recommended way to measure execution time under the new
model.
Our instrumentation (worked on ≤ v1.10)
The base middleware brackets
next()with two logical-time reads and logs thedifference:
What breaks on v1.11.0+
next()throws. Since durable-type binding is now deferredto the end of the pipeline, calling
BindFunctionInputAsync(context)for thestart time (before
next()) throws for orchestration triggers (this isthe crash tracked in Middleware crashing after Worker.Extensions.DurableTask v1.11.0 and later releases #3329).
after binding, the middleware now runs once per replay episode, so for a
single orchestration we get multiple
ExecutionInforecords withdifferent
ElapsedMsvalues (an early episode reports ≈0, a later onereports the real total) instead of one correct total.
Questions
logical execution time from isolated-worker middleware on v1.11.0+?
Environment
Microsoft.Azure.Functions.Worker.Extensions.DurableTask: 1.18.0 (broke at 1.11.0)Microsoft.DurableTask.*: 1.24.xAll reactions