Skip to content

[token-consumption] Daily AIC Consumption Report - 2026-06-15 #39380

@github-actions

Description

@github-actions

Executive Summary

AIC consumption could not be computed for the last 24h. Across 19,313 Sentry spans from 40+ agentic workflows, the gh-aw.aic attribute was absent on every span — including the gh-aw.activation.setup span where the instrumentation code (send_otlp_span.cjs:2104-2123) states it is always emitted. The field is also registered in Sentry EAP as a string type, so it cannot be summed/averaged even when present.

  • Sentry AIC queryable: ❌ No (has:gh-aw.aic → 0 results; field typed as string)
  • Grafana AIC queryable: ❌ No (Tempo query tools tempo_* not exposed by the MCP build)
  • Total AIC: Unknown — reported as an observability gap, not zero usage. Workflows clearly ran (gen_ai spans up to ~176s duration), so real credits were consumed but are not captured in telemetry.
  • Companion checks: errors = 0, logs = 0 in the window.

Key Metrics

Metric Value
Events analyzed 19,313 spans (Sentry, canonical)
Events with AIC data 0
Events with AIC data (Sentry) 0
Events with AIC data (Grafana) 0 (backend unqueryable)
Total AIC Unknown (gap — not zero)
Unique workflows ≥40 observed (grouping truncates at 25 buckets)
Events missing workflow id 16,101 (~83%)
Avg AIC/event Unavailable (no AIC data)
P95 AIC/event Unavailable (no AIC data)

Top 10 Workflows by AIC Consumption

AIC is unavailable, so workflows are ranked by span volume as an activity proxy. AIC columns are gaps, not zeros.

Workflow Events (spans) Total AIC Avg AIC/Event
PR Sous Chef 255 n/a (gap) n/a
Smoke CI 197 n/a (gap) n/a
Design Decision Gate 🏗️ 182 n/a (gap) n/a
Matt Pocock Skills Reviewer 182 n/a (gap) n/a
Test Quality Sentinel 182 n/a (gap) n/a
PR Code Quality Reviewer 174 n/a (gap) n/a
Issue Monster 133 n/a (gap) n/a
AI Moderator 110 n/a (gap) n/a
Contribution Check 55 n/a (gap) n/a
Auto-Triage Issues 53 n/a (gap) n/a

Note: the single largest bucket is 16,101 spans with no workflow name (unattributed gen_ai/gateway.request child spans), which dwarfs every named workflow and limits per-workflow accuracy.

Grafana AIC Findings

Grafana AIC: not queryable. The Tempo datasource exists (grafanacloud-ghaw-traces, uid grafanacloud-traces), but this workflow's Grafana MCP build exposes only list_datasources / get_datasource — the tempo_get-attribute-names, tempo_traceql-search, tempo_get-attribute-values, and tempo_get-trace tools are absent, so no TraceQL query, attribute discovery, or trace fetch could be run.

  • Evidence: tempo_get-attribute-namesError: No such tool available: mcp__grafana__tempo_get-attribute-names.
  • Consequence: cannot validate whether spans carry numeric gh-aw.aic in Tempo, or whether the attribute is indexed for { span."gh-aw.aic" > 0 } queries. Recorded as an observability gap (unknown AIC), not zero.

Sentry AIC Findings

Evidence and root-cause analysis
  • span.op:gen_ai* returns 100+ spans/24h with workflow attribution, but no gh-aw.aic value on any of them.
  • has:gh-aw.aic0 results across all spans in 24h. Alternates has:aic / has:gh_aw.aic / has:agent_usage.aic → also 0.
  • sum(gh-aw.aic) fails: API error (400): gh-aw.aic is invalid for parameter 1 in sum. Its a string type field — proving EAP registered the field as string, blocking numeric rollups.
  • The gh-aw.activation.setup span (1 per run, 25 inspected) carries gh-aw.workflow.name and gh-aw.run.id but no gh-aw.aic — yet send_otlp_span.cjs:2109-2122 says owning jobs emit it as buildDoubleAttr("gh-aw.aic", aiCredits), defaulting to 0, always.
  • Representative trace 81af3fa9a3ba7d928026d730524873a9 (Smoke CI, run 27550483027) verified: continuity holds (gen_ai spans → gateway.request children), but gh-aw.aic and gen_ai.usage.total_tokens are blank on all spans, so even a token proxy is unavailable.

Likely causes (ranked):

  1. EAP field-type poisoning: an earlier build emitted gh-aw.aic as a string; EAP locks schema on first emission, so the later numeric (doubleValue) fix is rejected/shadowed.
  2. The numeric-emit action version isn't deployed/pinned by the running workflows, so the post-step span omits the attribute entirely.
  3. GH_AW_AIC env / /tmp/gh-aw/agent_usage.json not propagated to the owning post-step, so aiCredits resolves to undefined and the buildDoubleAttr line is skipped.
Data Quality and Gaps
  • Missing workflow identifiers: 16,101 / 19,313 spans (~83%) have null gh-aw.workflow.name — these are gen_ai LLM and gateway.request child spans that don't inherit run/workflow attribution.
  • Missing AIC attributes: 100% of spans lack a usable gh-aw.aic value.
  • Fallback fields used: none yielded data (aic, gh_aw.aic, agent_usage.aic, gen_ai.usage.total_tokens all empty).
  • Sentry caveat: per instructions, per-span missing AIC normalizes to 0 — but because the attribute is universally absent AND string-typed, the resulting "0" reflects an instrumentation gap, not real zero spend.
  • Grafana caveat: Tempo query tools unavailable in this MCP build; no Grafana-side validation possible.
  • Tool note: search_events (AI-powered) was not available; used list_events with direct Sentry query syntax throughout.

Recommendations

  1. Fix the EAP field type (highest priority). gh-aw.aic is string-typed in Sentry EAP, which permanently blocks sum()/avg()/percentile(). Confirm every emitting code path uses buildDoubleAttr (numeric doubleValue), then migrate/recreate the EAP attribute so the schema is float — the first-seen type is sticky.
  2. Verify the emitting action version is deployed/pinned. Ensure the workflows actually run the actions/setup version containing send_otlp_span.cjs:2109-2122; otherwise the setup span never carries gh-aw.aic. Add a CI assertion that has:gh-aw.aic returns >0 on the setup span.
  3. Propagate AIC inputs. Confirm GH_AW_AIC and /tmp/gh-aw/agent_usage.json reach the owning post-step so aiCredits is non-undefined (emitting at least 0), making gaps visible rather than absent.
  4. Close the Grafana gap. Enable the tempo_* MCP tools (or point this report at a build that has them) and confirm Tempo indexes gh-aw.aic so { span."gh-aw.aic" > 0 } is queryable; otherwise Grafana AIC reporting stays blind.
  5. Improve attribution. Propagate gh-aw.workflow.name/gh-aw.run.id to gen_ai and gateway.request child spans (currently 83% null) so per-workflow AIC can be rolled up once values exist.

References

Generated by 📊 Daily AIC Consumption Report (Sentry + Grafana OTel) · 192.9 AIC · ⌖ 30.6 AIC · ⊞ 6.8K ·

  • expires on Jun 16, 2026, 5:59 AM UTC-08:00

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions