Skip to content

Reason codes and timeline fields

Generated from: budget/reasons.go, circuit/types.go, classify/, retry/, integrations/grpc/grpc.go, observe/types.go.

These reason codes and timeline fields are part of the v1 telemetry contract. Changes are breaking.

Outcome reasons

These values appear in observe.AttemptRecord.Outcome.Reason.

Static reasons

  • abort
  • classifier_type_mismatch
  • context_canceled
  • context_deadline_exceeded
  • http_5xx
  • http_non_idempotent
  • http_non_retryable_status
  • http_transport_error
  • non_retryable_error
  • panic_in_classifier
  • retryable_error
  • success
  • unknown_outcome

Pattern reasons

  • grpc_<code>
  • http_<status>

Budget reasons

These values appear in observe.BudgetDecisionEvent.Reason and observe.AttemptRecord.BudgetReason.

  • allowed
  • budget_denied
  • budget_nil
  • budget_not_found
  • budget_registry_nil
  • no_budget
  • panic_in_budget

Circuit reasons

These values appear on retry.CircuitOpenError.Reason.

  • circuit_half_open_probe_limit
  • circuit_open

Budget decision modes

These values appear in observe.BudgetDecisionEvent.Mode.

  • allow
  • allow_unsafe
  • deny
  • fallback
  • standard
  • unknown

Timeline fields

observe.Timeline

Field Type Notes
Key policy.PolicyKey Policy key for the call.
PolicyID string Policy identifier (if set).
Start time.Time Call start time.
End time.Time Call end time.
Attributes map[string]string Attributes holds call-level metadata (policy source, fallbacks, normalization notes, etc.).
Attempts []AttemptRecord Per-attempt records in execution order.
FinalErr error Final error returned to the caller.

observe.AttemptRecord

Field Type Notes
Attempt int Attempt index (0-based).
StartTime time.Time Attempt start time.
EndTime time.Time Attempt end time.
IsHedge bool Whether this attempt is a hedge.
HedgeIndex int Hedge index within the attempt group.
Outcome classify.Outcome Classification outcome for this attempt.
Err error Error returned by the attempt (if any).
Backoff time.Duration Backoff delay before this attempt.
BudgetAllowed bool Whether budget gating allowed this attempt.
BudgetReason string Budget decision reason (see budget reasons).

observe.BudgetDecisionEvent

Field Type Notes
Key policy.PolicyKey Policy key for the attempted call.
Attempt int Attempt index (0-based).
Kind budget.AttemptKind Retry or hedge attempt.
BudgetName string Budget registry name.
Cost int Units requested from the budget.
Mode string "standard", "allow", "deny", "fallback", "allow_unsafe", "unknown"
Allowed bool Whether the attempt was allowed.
Reason string Decision reason (see budget reasons).