-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(workflows): implement metrics for fdb driver #2057
base: 02-20-fix_move_actor_state_to_fdb
Are you sure you want to change the base?
feat(workflows): implement metrics for fdb driver #2057
Conversation
c521a04
to
729d516
Compare
8412313
to
1b5874e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR implements metrics collection for the FDB (FoundationDB) driver in the workflow system, focusing on workflow state tracking and performance monitoring. Here's a concise summary of the key changes:
- Added
DataSubspaceKey
and workflow state tracking structures to monitor workflow lifecycle states (Complete, Running, Sleeping, Dead) - Implemented metrics collection in
publish_metrics()
to track total, active, dead, and sleeping workflows with proper reset functionality - Made
PendingSignalSubspaceKey::new()
public and improved key handling for better metrics access - Added workflow state detection based on workflow keys and improved error handling for metrics collection
- Implemented proper locking mechanism for metrics publishing to prevent concurrent updates
The changes provide a robust foundation for monitoring workflow performance and state transitions in the FDB driver.
4 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
} else if let WorkflowState::Dead = current_state { | ||
if let Ok(_) = self | ||
.subspace | ||
.unpack::<keys::workflow::OutputChunkKey>(entry.key()) | ||
{ | ||
current_state = WorkflowState::Complete; | ||
} else if let Ok(_) = self | ||
.subspace | ||
.unpack::<keys::workflow::WorkerInstanceIdKey>(entry.key()) | ||
{ | ||
current_state = WorkflowState::Running; | ||
} else if let Ok(_) = self | ||
.subspace | ||
.unpack::<keys::workflow::HasWakeConditionKey>(entry.key()) | ||
{ | ||
current_state = WorkflowState::Sleeping; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: State transition logic doesn't handle the case where multiple state indicators exist simultaneously - could lead to incorrect metrics
1b5874e
to
4b4e6ae
Compare
729d516
to
c5b7bb3
Compare
c5b7bb3
to
729d516
Compare
4b4e6ae
to
1b5874e
Compare
Deploying rivet-hub with
|
Latest commit: |
729d516
|
Status: | ✅ Deploy successful! |
Preview URL: | https://64a6d5ba.rivet-hub-7jb.pages.dev |
Branch Preview URL: | https://02-20-feat-workflows-impleme.rivet-hub-7jb.pages.dev |
Changes