feat(metrics): record workflow and processing lifecycle counters (#44) - #67
Merged
Merged
Conversation
Completes the instrumentation started in #64. Both families exported 0 regardless of traffic because neither handler ever touched the registry. Contrary to the note in #64, no plumbing was needed: every dispatch function in both handlers already receives `shard: *Shard`, which carries the registry. The counters go in at the points every transition already passes through: - workflow: `completeRun` is the single terminal transition, so completed / failed / cancelled / timed_out all record there; started in `handleStart`, signal delivery in `handleSignal`, and step execution at the four `step_completed` history sites (all four have `shard` in scope). - processing: submitted in `handleSubmit`, and `persistStatusChange` covers cancelled and stopped. ## A crash this surfaced Eight workflow unit tests began aborting. Their test shard is built as `var shard: Shard = undefined` with fields assigned one at a time, so `metrics_registry` held garbage and the new read dereferenced it. The tests passed before only because nothing in the workflow path read that field. Both fields are now assigned in the helper. This is the third instance of the same hazard today — `allocator.create` and `= undefined` both leave field defaults inapplicable, and the compiler cannot see it. ## Tests Two more value-asserting e2e tests: start two workflows and assert `flo_workflow_started_total` is 2; submit a job and assert `flo_processing_jobs_submitted_total` is 1. Both fail with the instrumentation stashed. test-unit, test-integration, and the metrics / workflow / processing e2e filters all pass. ## Still open on #44 KVMetrics and TieredLogMetrics remain unexported and unregistered. Whether to emit or delete them is a product decision, so #44 stays open for that alone.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Completes the instrumentation started in #64. Both families exported
0regardless of traffic because neither handler ever touched the registry.