get_task_metrics
Access task-level execution metrics across workflows to analyze performance, application usage, and statistics for automation monitoring and optimization.
Instructions
Get all aggregate task metrics from the Workflow Engine.
Retrieves comprehensive task-level execution metrics across all workflows, providing detailed insights into task performance, application usage patterns, and execution statistics for automation monitoring and optimization.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | Response model for task metrics collection endpoints. This Pydantic RootModel provides a standardized response format for API endpoints that return collections of task-level metrics from the Itential Platform workflow engine. It wraps a list of TaskMetricElement objects, enabling type-safe handling of task performance data across automation workflows. The root model pattern allows the response to be treated as a list while maintaining proper validation and serialization capabilities for the contained task metric elements, supporting comprehensive workflow monitoring and analysis. Args: root: List of TaskMetricElement objects containing task performance data. Defaults to an empty list if not provided. Attributes: root (List[TaskMetricElement]): Collection of task metric elements with application usage patterns and execution statistics for workflow analysis Example: Creating a response with multiple task metrics: >>> task1 = TaskMetricElement(taskType="automatic", name="validate-config", ... metrics=[], app="validator") >>> task2 = TaskMetricElement(taskType="manual", name="approve-deploy", ... metrics=[], app="approval-service") >>> response = GetTaskMetricsResponse([task1, task2]) >>> print(len(response.root)) # 2 >>> print(response.root[0].task_type) # "automatic" >>> print(response.root[1].name) # "approve-deploy" Notes: - Uses default_factory=list to create empty collections when needed - Supports iteration and indexing through the root attribute - Maintains type safety for all contained TaskMetricElement objects - Enables filtering and analysis of tasks by application, workflow, or type |