Skip to content

feat(observability): attribute token cost, budgets, and kill-switch decisions #117

Description

@robinbraemer

Outcome

Attribute tokens, cached tokens, modeled cost, budget consumption, rate limits, and kill-switch decisions to AgentOS operations without adopting content-bearing request logs.

Scope

  • Reconcile Agentgateway's model-cost catalog and native token measures with the AgentOS telemetry contract.
  • Export bounded aggregate metrics and protected per-operation spans for Mate/Assignment attribution.
  • Distinguish gateway rejection, AgentOS budget exhaustion, provider 429, and unknown/unpriced models.
  • Define pricing-version, currency, estimation/actual flags, and cache-token semantics.
  • Keep authoritative budget counters outside the fail-open telemetry path.

Acceptance criteria

  • Operators can answer which Assignment class, runtime, route, model family, and request kind consumed cost without metric-label cardinality leaks.
  • Missing or stale pricing is explicit and never reported as zero actual cost.
  • Collector/exporter outage does not reset or bypass budgets.
  • Agentgateway SQLite request logs and prompt logging are unnecessary for the supported dashboards.
  • Synthetic accounting reconciles requests, tokens, cache tokens, and cost within documented tolerances.

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions