> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentarea.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Execution Metrics

> Get execution metrics for a trigger.

Returns aggregated metrics including success rate, average execution time,
and failure counts for the specified time period.

Args:
    trigger_id: The unique identifier of the trigger
    hours: Time period in hours to analyze (default 24, max 168)
    user_context: Authentication context
    trigger_service: Injected trigger service

Returns:
    Execution metrics for the trigger

Raises:
    HTTPException: If trigger not found



## OpenAPI

````yaml /api-reference/openapi.json get /v1/triggers/{trigger_id}/metrics
openapi: 3.1.0
info:
  description: >-
    Modular and extensible framework for building AI agents. This API requires
    JWT Bearer token authentication for most endpoints. Include your JWT token
    in the Authorization header. Public endpoints include /, /health, /docs,
    /redoc, and /openapi.json.
  title: AgentArea API
  version: 0.1.0
servers: []
security:
  - bearer: []
paths:
  /v1/triggers/{trigger_id}/metrics:
    get:
      tags:
        - v1
        - protected
        - triggers
      summary: Get Execution Metrics
      description: >-
        Get execution metrics for a trigger.


        Returns aggregated metrics including success rate, average execution
        time,

        and failure counts for the specified time period.


        Args:
            trigger_id: The unique identifier of the trigger
            hours: Time period in hours to analyze (default 24, max 168)
            user_context: Authentication context
            trigger_service: Injected trigger service

        Returns:
            Execution metrics for the trigger

        Raises:
            HTTPException: If trigger not found
      operationId: get_execution_metrics_v1_triggers__trigger_id__metrics_get
      parameters:
        - in: path
          name: trigger_id
          required: true
          schema:
            format: uuid
            title: Trigger Id
            type: string
        - description: Time period in hours (max 7 days)
          in: query
          name: hours
          required: false
          schema:
            default: 24
            description: Time period in hours (max 7 days)
            maximum: 168
            minimum: 1
            title: Hours
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionMetricsResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    ExecutionMetricsResponse:
      description: Response model for execution metrics.
      properties:
        avg_execution_time_ms:
          title: Avg Execution Time Ms
          type: number
        failed_executions:
          title: Failed Executions
          type: integer
        failure_rate:
          title: Failure Rate
          type: number
        max_execution_time_ms:
          title: Max Execution Time Ms
          type: integer
        min_execution_time_ms:
          title: Min Execution Time Ms
          type: integer
        period_hours:
          title: Period Hours
          type: integer
        success_rate:
          title: Success Rate
          type: number
        successful_executions:
          title: Successful Executions
          type: integer
        timeout_executions:
          title: Timeout Executions
          type: integer
        total_executions:
          title: Total Executions
          type: integer
        trigger_id:
          format: uuid
          title: Trigger Id
          type: string
      required:
        - trigger_id
        - period_hours
        - total_executions
        - successful_executions
        - failed_executions
        - timeout_executions
        - success_rate
        - failure_rate
        - avg_execution_time_ms
        - min_execution_time_ms
        - max_execution_time_ms
      title: ExecutionMetricsResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearer:
      bearerFormat: JWT
      description: JWT Bearer token for authentication
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````