Skip to content

feat(bumblebee): alert on a coding agent creator's spend per day - #2238

Draft
teemow wants to merge 1 commit into
mainfrom
gs-38073-cost
Draft

teemow wants to merge 1 commit into
mainfrom
gs-38073-cost

Conversation

@teemow

@teemow teemow commented Oct 18, 2026

Copy link
Copy Markdown
Member

Towards: https://github.com/giantswarm/giantswarm/issues/38073

Problem

A coding agent's turn spends model tokens on the platform's provider key. A single turn is bounded; what one person's Sessions spend over a day is not, and nothing measured it per person until now.

Proposed solution

AgentPlatformCreatorSpendHigh fires on the kagent controller's kagent_session_turn_cost_usd_total (giantswarm/kagent-upstream#697): what each turn cost as its runtime reported it, per Agent (k8s_namespace_name, gen_ai_agent_name) and the Session's creator (enduser_id).

  • Summed per creator across Agents, more than 50 US dollars within 24 hours.
  • increase() handles the controller restarts that reset the counter. It misses the first turn of a new series, one turn's cost, which a day's threshold absorbs.
  • severity: notify, Slack only, business hours. Nothing is down; the response is a word with the person, or the coding-agents kill-switch runbook when nobody explains the spend. Its Alerts table gains this row in a sibling change.
  • The cost is the runtime's estimate at the model's list price, not a bill.

The creator label and the threshold are defaults, open for review: an answer changes them forward in a later PR.

Checklist

  • Update CHANGELOG.md
  • Add unit tests (make test-rules passes on every provider; make test-inhibitions test-runbooks pass)
  • Follow alert structure
  • Dashboard: the agent-platform overview, no new panel yet
  • agentlab proof: pending

Signed-off-by: Timo Derstappen <teemow@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant