-
Notifications
You must be signed in to change notification settings - Fork 83
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
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
f02e69d
to
b3d7bc6
Compare
c6712a2
to
29cc6ae
Compare
29cc6ae
to
6f890ba
Compare
454f741
to
b3d7bc6
Compare
6f890ba
to
29cc6ae
Compare
29cc6ae
to
6f890ba
Compare
b3d7bc6
to
454f741
Compare
454f741
to
b3d7bc6
Compare
6f890ba
to
29cc6ae
Compare
29cc6ae
to
6f890ba
Compare
Merge activity
|
<!-- Please make sure there is an issue that this PR is correlated to. --> ## Changes <!-- If there are frontend changes, please include screenshots. -->
Changes