Add workflow spans for tagging the logs with step name#6088
Add workflow spans for tagging the logs with step name#6088Caio-Nogueira wants to merge 1 commit intomainfrom
Conversation
c3251e2 to
c9820b7
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
9184d97 to
5dad480
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6088 +/- ##
==========================================
- Coverage 70.55% 70.47% -0.09%
==========================================
Files 409 409
Lines 109532 109863 +331
Branches 18038 18093 +55
==========================================
+ Hits 77281 77422 +141
- Misses 21441 21625 +184
- Partials 10810 10816 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5dad480 to
d8fdc7b
Compare
| cbRef = kj::mv(cbRef)), | ||
| (stepNameRef, cbRef), | ||
| (jsg::Lock& js, | ||
| const v8::FunctionCallbackInfo<v8::Value>& cbInfo) |
There was a problem hiding this comment.
Passing FunctionCallbackInfo is supported but not really idiomatic for the code base. Generally speaking we should try to pass jsg typemapped types (e.g. kj::String, etc)
There was a problem hiding this comment.
FunctionCallbackInfo is part of the signature. I'm now deconstructing it so that we can extract the correctly typed values and use those instead
|
@Caio-Nogueira Bonk workflow was cancelled. View workflow run · To retry, trigger Bonk again. |
src/workerd/api/workers-module.c++
Outdated
| KJ_ASSERT(originalDo.isFunction(), "step object missing 'do' method"); | ||
|
|
||
| // Capture references for the patched step.do closure. | ||
| auto selfRef = JSG_THIS; |
There was a problem hiding this comment.
Ultimately selfRef lets us access the run method on the user's subclass
d8fdc7b to
4b6707a
Compare
This is a proposal to add arbitrary step-related tags on console logs emitted from within workflow instances (more specifically, steps).
WorkflowEntrypointbase class that the engine will call instead ofrun;domethod from the originalstep(passed as an rpc property) and patches it;handleLogattaches to the workflow step span if it exists in current async context