service
service ¶
Monitoring service for flow execution.
MonitoringService ¶
Service for monitoring and managing flow metrics.
Source code in src/flow/monitoring/service.py
get_flow_health
async
¶
get_flow_health(flow: 'Flow') -> HealthStatus
Get health status for a flow.
Source code in src/flow/monitoring/service.py
get_flow_statistics
async
¶
get_flow_statistics(flow: Flow) -> FlowStatistics
Get execution statistics for a flow.
Source code in src/flow/monitoring/service.py
get_instance
classmethod
¶
get_recent_events
async
¶
get_recent_events(
flow: Optional["Flow"] = None, limit: int = 100, min_level: int = INFO
) -> List[FlowEvent]
Get recent events, optionally filtered.
Source code in src/flow/monitoring/service.py
monitor_flow
async
¶
monitor_flow(flow: Flow) -> AsyncGenerator[None, None]
Context manager for monitoring a flow execution.
Source code in src/flow/monitoring/service.py
record_flow_event
async
¶
record_flow_event(
flow: Flow, event_type: str, description: str, level: int, details: Dict[str, Any] = None
) -> None
Record a flow-related event.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
flow
|
Flow
|
Flow instance |
required |
event_type
|
str
|
Type of event |
required |
description
|
str
|
Event description |
required |
level
|
int
|
Logging level (e.g., LoggingLevel.INFO, LoggingLevel.ERROR) |
required |
details
|
Dict[str, Any]
|
Additional event details |
None
|