get_task_metrics_for_app
Retrieve task execution metrics for a specified application from Workflow Engine to analyze automation performance and identify workflow trends.
Instructions
Get all task metrics for the specified application from Workflow Engine.
Retrieves task execution metrics filtered by a specific application name, providing insights into how tasks performed by that application are executing across different workflows and automation processes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the application 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 |