---
title: "Get Execution Metrics"
method: GET
path: "/v1/triggers/{trigger_id}/metrics"
tags: ["v1", "protected", "triggers"]
---

# Get Execution Metrics

`GET /v1/triggers/{trigger_id}/metrics`

Get execution metrics for a trigger.

Returns aggregated counts, success rate, execution time and spend. Spend is
the cost of the tasks those runs created, joined at read time — a run is
recorded when its task starts, the bill accrues afterwards.

Args:
    trigger_id: The unique identifier of the trigger
    hours: Time period in hours to analyze; omitted means the whole history
    user_context: Authentication context
    trigger_service: Injected trigger service
    db_session: Session used for the spend join

Returns:
    Execution metrics for the trigger

Raises:
    HTTPException: If trigger not found

## Path parameters

- `trigger_id` string, uuid, required

## Query parameters

- `hours` integer, nullable — Time period in hours (max 1 year). Omit for the trigger's whole history.

## Response `200`

Successful Response

- ExecutionMetricsResponse — Response model for execution metrics.
  - `avg_cost_usd` number — Spend per run that produced a costed task.
  - `avg_execution_time_ms` number, required
  - `costed_executions` integer — Runs whose task reported a cost; the divisor behind avg_cost_usd.
  - `failed_executions` integer, required
  - `failure_rate` number, required — Percentage, 0-100.
  - `max_execution_time_ms` integer, required
  - `min_execution_time_ms` integer, required
  - `period_hours` integer, nullable — Window these metrics cover. Null means the whole history.
  - `success_rate` number, required — Percentage, 0-100.
  - `successful_executions` integer, required
  - `timeout_executions` integer, required
  - `total_cost_usd` number — Spend of the tasks these runs created.
  - `total_executions` integer, required
  - `trigger_id` string, uuid, required

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-21** `11817368931f` — 3 breaking, 5 info
  - for the `query` request parameter `hours`, default value `24` was removed
  - the response property `period_hours` became optional for the status `200`
  - response property `period_hours` list-of-types was widened by adding types `null` to media type `application/json` of response `200`
  - `query` request parameter `hours` list-of-types was widened by adding types `null`
  - …4 more

[Change history](https://skmtc.dev/agentarea/apis/agentarea-api/changes/v1/triggers/:trigger_id/metrics/get.md)

---

[API](https://skmtc.dev/agentarea/apis/agentarea-api.md) · [All operations](https://skmtc.dev/agentarea/apis/agentarea-api/llms.txt) · [OpenAPI document](https://skmtc.dev/agentarea/apis/agentarea-api/revisions/ebd031ab895b?raw)
