Get Task Metrics for Task
get_task_metrics_for_taskRetrieve task execution metrics by name across workflows to monitor performance, identify bottlenecks, and optimize automation processes.
Instructions
Get all task metrics for the named task from Workflow Engine.
Retrieves task execution metrics filtered by a specific task name, providing detailed performance insights for that particular task across all workflows where it appears.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the task to retrieve task metrics for |
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 |