v1
protected
triggers

Get Execution 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

get/v1/triggers/{trigger_id}/metrics

Path parameters

trigger_idstring uuid required

Query parameters

hoursinteger nullable

Time period in hours (max 1 year). Omit for the trigger's whole history.

Time period in hours (max 1 year). Omit for the trigger's whole history.

Response

Successful Response

avg_cost_usdnumber

Spend per run that produced a costed task.

avg_execution_time_msnumber required
costed_executionsinteger

Runs whose task reported a cost; the divisor behind avg_cost_usd.

failed_executionsinteger required
failure_ratenumber required

Percentage, 0-100.

max_execution_time_msinteger required
min_execution_time_msinteger required
period_hoursinteger nullable

Window these metrics cover. Null means the whole history.

success_ratenumber required

Percentage, 0-100.

successful_executionsinteger required
timeout_executionsinteger required
total_cost_usdnumber

Spend of the tasks these runs created.

total_executionsinteger required
trigger_idstring uuid required

Changes