From 02d25cf306cdabbdf39230814ece8b3d51c229f0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Jun 2026 13:29:04 +0000 Subject: [PATCH 1/3] Update daily token consumption report to use AIC metrics Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> --- .../daily-token-consumption-report.lock.yml | 36 ++++----- .../daily-token-consumption-report.md | 80 ++++++++----------- 2 files changed, 53 insertions(+), 63 deletions(-) diff --git a/.github/workflows/daily-token-consumption-report.lock.yml b/.github/workflows/daily-token-consumption-report.lock.yml index ffed5e87ca4..0bae19fdb66 100644 --- a/.github/workflows/daily-token-consumption-report.lock.yml +++ b/.github/workflows/daily-token-consumption-report.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"d76d78a5fcbfd612d0ebf2e2cbfc272f6ae524a3d5aa68ae03575fe9eea42314","body_hash":"4c9c98823fa707e811e89857104e120c8beafd8c71b07cb6f18a0cea5c4806c2","strict":true,"agent_id":"claude","engine_versions":{"claude":"2.1.168"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"d76d78a5fcbfd612d0ebf2e2cbfc272f6ae524a3d5aa68ae03575fe9eea42314","body_hash":"f85165065fdad9f2e35fa1b86ec77166a43ee7eedcf486ba1c05f27321970b82","strict":true,"agent_id":"claude","engine_versions":{"claude":"2.1.168"}} # gh-aw-manifest: {"version":1,"secrets":["ANTHROPIC_API_KEY","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GH_AW_OTEL_GRAFANA_AUTHORIZATION","GH_AW_OTEL_GRAFANA_ENDPOINT","GH_AW_OTEL_SENTRY_AUTHORIZATION","GH_AW_OTEL_SENTRY_ENDPOINT","GITHUB_TOKEN","SENTRY_ACCESS_TOKEN","SENTRY_OPENAI_API_KEY"],"actions":[{"repo":"actions/checkout","sha":"df4cb1c069e1874edd31b4311f1884172cec0e10","version":"v6.0.3"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.0"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.0"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.0"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.25","digest":"sha256:c10331ad17668ef89f38f5e356678788a40b0cd5fef96e8f92e1d9c1de47cbaa","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.25@sha256:c10331ad17668ef89f38f5e356678788a40b0cd5fef96e8f92e1d9c1de47cbaa"},{"image":"ghcr.io/github/github-mcp-server:v1.1.2","digest":"sha256:30197479d8036c7811892bc07e06f9a05c9ef3cdd79bc59f256d50647f95788c","pinned_image":"ghcr.io/github/github-mcp-server:v1.1.2@sha256:30197479d8036c7811892bc07e06f9a05c9ef3cdd79bc59f256d50647f95788c"},{"image":"node:lts-alpine","digest":"sha256:2bdb65ed1dab192432bc31c95f94155ca5ad7fc1392fb7eb7526ab682fa5bf14","pinned_image":"node:lts-alpine@sha256:2bdb65ed1dab192432bc31c95f94155ca5ad7fc1392fb7eb7526ab682fa5bf14"}]} # ___ _ _ # / _ \ | | (_) @@ -60,7 +60,7 @@ # - ghcr.io/github/github-mcp-server:v1.1.2@sha256:30197479d8036c7811892bc07e06f9a05c9ef3cdd79bc59f256d50647f95788c # - node:lts-alpine@sha256:2bdb65ed1dab192432bc31c95f94155ca5ad7fc1392fb7eb7526ab682fa5bf14 -name: "Daily Token Consumption Report (Sentry OTel)" +name: "Daily AIC Consumption Report (Sentry OTel)" on: schedule: - cron: "51 11 * * 1-5" @@ -78,12 +78,12 @@ permissions: {} concurrency: group: "gh-aw-${{ github.workflow }}" -run-name: "Daily Token Consumption Report (Sentry OTel)" +run-name: "Daily AIC Consumption Report (Sentry OTel)" env: OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.GH_AW_OTEL_SENTRY_ENDPOINT }} OTEL_SERVICE_NAME: gh-aw.daily-token-consumption-report - OTEL_RESOURCE_ATTRIBUTES: 'gh-aw.workflow.name=Daily Token Consumption Report (Sentry OTel),gh-aw.repository=${{ github.repository }},gh-aw.run.id=${{ github.run_id }},github.run_id=${{ github.run_id }},gh-aw.engine.id=claude' + OTEL_RESOURCE_ATTRIBUTES: 'gh-aw.workflow.name=Daily AIC Consumption Report (Sentry OTel),gh-aw.repository=${{ github.repository }},gh-aw.run.id=${{ github.run_id }},github.run_id=${{ github.run_id }},gh-aw.engine.id=claude' OTEL_EXPORTER_OTLP_HEADERS: x-sentry-auth=${{ secrets.GH_AW_OTEL_SENTRY_AUTHORIZATION }} GH_AW_OTLP_ALL_HEADERS: x-sentry-auth=${{ secrets.GH_AW_OTEL_SENTRY_AUTHORIZATION }},Authorization=${{ secrets.GH_AW_OTEL_GRAFANA_AUTHORIZATION }} GH_AW_OTLP_ENDPOINTS: '[{"url":"${{ secrets.GH_AW_OTEL_SENTRY_ENDPOINT }}","headers":"x-sentry-auth=${{ secrets.GH_AW_OTEL_SENTRY_AUTHORIZATION }}"},{"url":"${{ secrets.GH_AW_OTEL_GRAFANA_ENDPOINT }}","headers":"Authorization=${{ secrets.GH_AW_OTEL_GRAFANA_AUTHORIZATION }}"}]' @@ -126,7 +126,7 @@ jobs: job-name: ${{ github.job }} safe-output-artifact-client: ${{ env.GH_AW_MAX_DAILY_AI_CREDITS != '' }} env: - GH_AW_SETUP_WORKFLOW_NAME: "Daily Token Consumption Report (Sentry OTel)" + GH_AW_SETUP_WORKFLOW_NAME: "Daily AIC Consumption Report (Sentry OTel)" GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/daily-token-consumption-report.lock.yml@${{ github.ref }} GH_AW_INFO_VERSION: "2.1.168" GH_AW_INFO_AWF_VERSION: "v0.27.0" @@ -141,7 +141,7 @@ jobs: GH_AW_INFO_MODEL: ${{ vars.GH_AW_MODEL_AGENT_CLAUDE || vars.GH_AW_DEFAULT_MODEL_CLAUDE || 'agent' }} GH_AW_INFO_VERSION: "2.1.168" GH_AW_INFO_AGENT_VERSION: "2.1.168" - GH_AW_INFO_WORKFLOW_NAME: "Daily Token Consumption Report (Sentry OTel)" + GH_AW_INFO_WORKFLOW_NAME: "Daily AIC Consumption Report (Sentry OTel)" GH_AW_INFO_EXPERIMENTAL: "false" GH_AW_INFO_SUPPORTS_TOOLS_ALLOWLIST: "true" GH_AW_INFO_STAGED: "false" @@ -164,7 +164,7 @@ jobs: if: ${{ env.GH_AW_MAX_DAILY_AI_CREDITS != '' }} uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: - GH_AW_WORKFLOW_NAME: "Daily Token Consumption Report (Sentry OTel)" + GH_AW_WORKFLOW_NAME: "Daily AIC Consumption Report (Sentry OTel)" GH_AW_WORKFLOW_ID: "daily-token-consumption-report" GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} GH_AW_WORKFLOW_DISPATCH_AW_CONTEXT: ${{ github.event.inputs.aw_context || '' }} @@ -416,7 +416,7 @@ jobs: trace-id: ${{ needs.activation.outputs.setup-trace-id }} parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }} env: - GH_AW_SETUP_WORKFLOW_NAME: "Daily Token Consumption Report (Sentry OTel)" + GH_AW_SETUP_WORKFLOW_NAME: "Daily AIC Consumption Report (Sentry OTel)" GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/daily-token-consumption-report.lock.yml@${{ github.ref }} GH_AW_INFO_VERSION: "2.1.168" GH_AW_INFO_AWF_VERSION: "v0.27.0" @@ -1222,7 +1222,7 @@ jobs: trace-id: ${{ needs.activation.outputs.setup-trace-id }} parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }} env: - GH_AW_SETUP_WORKFLOW_NAME: "Daily Token Consumption Report (Sentry OTel)" + GH_AW_SETUP_WORKFLOW_NAME: "Daily AIC Consumption Report (Sentry OTel)" GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/daily-token-consumption-report.lock.yml@${{ github.ref }} GH_AW_INFO_VERSION: "2.1.168" GH_AW_INFO_AWF_VERSION: "v0.27.0" @@ -1281,7 +1281,7 @@ jobs: env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} GH_AW_NOOP_MAX: "1" - GH_AW_WORKFLOW_NAME: "Daily Token Consumption Report (Sentry OTel)" + GH_AW_WORKFLOW_NAME: "Daily AIC Consumption Report (Sentry OTel)" GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/daily-token-consumption-report.md" GH_AW_TRACKER_ID: "daily-token-consumption-report" GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} @@ -1303,7 +1303,7 @@ jobs: uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} - GH_AW_WORKFLOW_NAME: "Daily Token Consumption Report (Sentry OTel)" + GH_AW_WORKFLOW_NAME: "Daily AIC Consumption Report (Sentry OTel)" GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/daily-token-consumption-report.md" GH_AW_TRACKER_ID: "daily-token-consumption-report" GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} @@ -1322,7 +1322,7 @@ jobs: env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} GH_AW_MISSING_TOOL_CREATE_ISSUE: "true" - GH_AW_WORKFLOW_NAME: "Daily Token Consumption Report (Sentry OTel)" + GH_AW_WORKFLOW_NAME: "Daily AIC Consumption Report (Sentry OTel)" GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/daily-token-consumption-report.md" GH_AW_TRACKER_ID: "daily-token-consumption-report" with: @@ -1338,7 +1338,7 @@ jobs: env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} GH_AW_REPORT_INCOMPLETE_CREATE_ISSUE: "true" - GH_AW_WORKFLOW_NAME: "Daily Token Consumption Report (Sentry OTel)" + GH_AW_WORKFLOW_NAME: "Daily AIC Consumption Report (Sentry OTel)" GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/daily-token-consumption-report.md" GH_AW_TRACKER_ID: "daily-token-consumption-report" with: @@ -1354,7 +1354,7 @@ jobs: uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} - GH_AW_WORKFLOW_NAME: "Daily Token Consumption Report (Sentry OTel)" + GH_AW_WORKFLOW_NAME: "Daily AIC Consumption Report (Sentry OTel)" GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/daily-token-consumption-report.md" GH_AW_TRACKER_ID: "daily-token-consumption-report" GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} @@ -1424,7 +1424,7 @@ jobs: trace-id: ${{ needs.activation.outputs.setup-trace-id }} parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }} env: - GH_AW_SETUP_WORKFLOW_NAME: "Daily Token Consumption Report (Sentry OTel)" + GH_AW_SETUP_WORKFLOW_NAME: "Daily AIC Consumption Report (Sentry OTel)" GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/daily-token-consumption-report.lock.yml@${{ github.ref }} GH_AW_INFO_VERSION: "2.1.168" GH_AW_INFO_AWF_VERSION: "v0.27.0" @@ -1497,7 +1497,7 @@ jobs: if: always() && steps.detection_guard.outputs.run_detection == 'true' uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: - WORKFLOW_NAME: "Daily Token Consumption Report (Sentry OTel)" + WORKFLOW_NAME: "Daily AIC Consumption Report (Sentry OTel)" WORKFLOW_DESCRIPTION: "Daily report of token consumption across all agentic workflows using OTel telemetry stored in Sentry" HAS_PATCH: ${{ needs.agent.outputs.has_patch }} with: @@ -1670,7 +1670,7 @@ jobs: GH_AW_TRACKER_ID: "daily-token-consumption-report" GH_AW_WORKFLOW_EMOJI: "📊" GH_AW_WORKFLOW_ID: "daily-token-consumption-report" - GH_AW_WORKFLOW_NAME: "Daily Token Consumption Report (Sentry OTel)" + GH_AW_WORKFLOW_NAME: "Daily AIC Consumption Report (Sentry OTel)" GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/daily-token-consumption-report.md" outputs: code_push_failure_count: ${{ steps.process_safe_outputs.outputs.code_push_failure_count }} @@ -1698,7 +1698,7 @@ jobs: trace-id: ${{ needs.activation.outputs.setup-trace-id }} parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }} env: - GH_AW_SETUP_WORKFLOW_NAME: "Daily Token Consumption Report (Sentry OTel)" + GH_AW_SETUP_WORKFLOW_NAME: "Daily AIC Consumption Report (Sentry OTel)" GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/daily-token-consumption-report.lock.yml@${{ github.ref }} GH_AW_INFO_VERSION: "2.1.168" GH_AW_INFO_AWF_VERSION: "v0.27.0" diff --git a/.github/workflows/daily-token-consumption-report.md b/.github/workflows/daily-token-consumption-report.md index fbe500334fb..98f915f16d6 100644 --- a/.github/workflows/daily-token-consumption-report.md +++ b/.github/workflows/daily-token-consumption-report.md @@ -34,9 +34,9 @@ imports: {{#runtime-import? .github/shared-instructions.md}} -# Daily Token Consumption Report (Sentry OTel) +# Daily AIC Consumption Report (Sentry OTel) -You are an observability analyst. Generate a daily token consumption report across all agentic workflows in this repository using OpenTelemetry telemetry in Sentry. +You are an observability analyst. Generate a daily AI Credits (AIC) consumption report across all agentic workflows in this repository using OpenTelemetry telemetry in Sentry. ## Context @@ -47,8 +47,8 @@ You are an observability analyst. Generate a daily token consumption report acro ## Mission 1. Query Sentry telemetry for the last 24 hours. -2. Aggregate token usage by workflow. -3. Identify top token consumers and anomalous usage. +2. Aggregate AIC usage by workflow. +3. Identify top AIC consumers and anomalous usage. 4. Publish a concise daily GitHub issue report. ## Data Collection @@ -70,7 +70,7 @@ If `search_events` is **not available** (the tool is absent from the available t - `organizationSlug`: the org discovered in Step 1 - `dataset: spans` - `query`: a filter for AI/LLM spans with token data; start with `span.op:ai*` and also try `span.op:gen_ai*` if the first returns no results; if neither matches, try an empty query and filter client-side for records with token fields -- `fields`: include token-related fields such as `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`, `gen_ai.usage.total_tokens`, `ai.input_tokens`, `ai.output_tokens`, `ai.total_tokens`, `github.workflow`, `github.run_id`, `span.op`, `span.description`, `timestamp`; omit fields that return errors and retry with remaining fields +- `fields`: include AIC/cost fields such as `gh-aw.aic`, `gh_aw.aic`, `aic`, `agent_usage.aic`, plus workflow metadata (`github.workflow`, `github.run_id`, `span.op`, `span.description`, `timestamp`); omit fields that return errors and retry with remaining fields - `sort`: `-timestamp` - Use pagination to cover the last 24 hours @@ -78,9 +78,9 @@ If `dataset: spans` returns no usable records with either tool, retry with `data Treat "no usable records" as either: - zero events returned after pagination, or -- events returned but none contain any recognized token fields. +- events returned but none contain any recognized AIC fields. -### Step 3: Extract Workflow + Token Fields +### Step 3: Extract Workflow + AIC Fields For each event/span, derive: @@ -93,18 +93,14 @@ For each event/span, derive: - **Run ID** using: - `github.run_id` - `gh_aw.run_id` -- **Token counts** with precedence to avoid double counting: - - Prefer explicit totals first: `ai.total_tokens` → `gen_ai.usage.total_tokens` → `usage.total_tokens` → `total_tokens`. - - For input tokens: `ai.input_tokens` → `gen_ai.usage.input_tokens` → `usage.input_tokens` → `prompt_tokens`. - - For output tokens: `ai.output_tokens` → `gen_ai.usage.output_tokens` → `usage.output_tokens` → `completion_tokens`. - - If only total is present and input/output are missing, keep input/output at `0` and use total. - - If input and output are present but total is missing, set total = input + output. - - Do not sum overlapping aliases for the same token type. -- Recognized token fields: - - `ai.input_tokens`, `ai.output_tokens`, `ai.total_tokens` - - `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`, `gen_ai.usage.total_tokens` - - `usage.input_tokens`, `usage.output_tokens`, `usage.total_tokens` - - `prompt_tokens`, `completion_tokens`, `total_tokens` +- **AIC value** with precedence: + - Prefer `gh-aw.aic` → `gh_aw.aic` → `agent_usage.aic` → `aic`. + - If none are present, use `0`. +- Recognized AIC fields: + - `gh-aw.aic` + - `gh_aw.aic` + - `agent_usage.aic` + - `aic` Normalize missing values to `0`. @@ -113,66 +109,60 @@ Normalize missing values to `0`. Calculate: - `total_events_analyzed` -- `events_with_token_data` +- `events_with_aic_data` - `events_missing_workflow` -- `total_input_tokens` -- `total_output_tokens` -- `total_tokens` +- `total_aic` - `workflow_count` (unique workflows) -- `top_workflows_by_tokens` (top 10) -- `avg_tokens_per_event` -- `p95_tokens_per_event` +- `top_workflows_by_aic` (top 10) +- `avg_aic_per_event` +- `p95_aic_per_event` For each workflow include: - workflow name - event count -- input tokens -- output tokens -- total tokens -- average tokens/event -- highest-token event (with run id if available) +- total AIC +- average AIC/event +- highest-AIC event (with run id if available) ## Report Output Create exactly one issue titled: -`[token-consumption] Daily Token Consumption Report - YYYY-MM-DD` +`[token-consumption] Daily AIC Consumption Report - YYYY-MM-DD` **Report Formatting**: Use h3 (###) or lower for all headers to maintain proper document hierarchy. Use progressive disclosure — keep Executive Summary, Key Metrics, and Recommendations always visible, and wrap verbose details in `
Section Name` blocks. Use this body structure: ### Executive Summary -- Total tokens, workflow count, and high-level trend notes. +- Total AIC, workflow count, and high-level trend notes. ### Key Metrics | Metric | Value | |---|---| | Events analyzed | ... | -| Events with token data | ... | -| Total input tokens | ... | -| Total output tokens | ... | -| Total tokens | ... | +| Events with AIC data | ... | +| Total AIC | ... | | Unique workflows | ... | -| Avg tokens/event | ... | -| P95 tokens/event | ... | +| Avg AIC/event | ... | +| P95 AIC/event | ... | -### Top 10 Workflows by Token Consumption -| Workflow | Events | Input Tokens | Output Tokens | Total Tokens | Avg/Event | -|---|---:|---:|---:|---:|---:| +### Top 10 Workflows by AIC Consumption +| Workflow | Events | Total AIC | Avg AIC/Event | +|---|---:|---:|---:| | ... |
Data Quality and Gaps - Events missing workflow identifiers -- Events missing token attributes +- Events missing AIC attributes - Any assumptions or fallback fields used
### Recommendations -- 2-4 concrete actions to reduce token usage for the highest consumers. +- 2-4 concrete actions to reduce AIC usage for the highest consumers. ### References - Include up to three relevant links (Sentry query links and/or run links when available). @@ -180,7 +170,7 @@ Use this body structure: ## Guardrails - Be explicit when telemetry fields are absent or ambiguous. -- Never invent token values. +- Never invent AIC values. - Keep the report concise and actionable. - Use `###` or lower headers only. From 81ae5651801777ee97b8ac0385ec95de9260e5f7 Mon Sep 17 00:00:00 2001 From: Mara Nikola Kiefer <8320933+mnkiefer@users.noreply.github.com> Date: Wed, 10 Jun 2026 15:36:27 +0200 Subject: [PATCH 2/3] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/daily-token-consumption-report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/daily-token-consumption-report.md b/.github/workflows/daily-token-consumption-report.md index 98f915f16d6..35939e0275b 100644 --- a/.github/workflows/daily-token-consumption-report.md +++ b/.github/workflows/daily-token-consumption-report.md @@ -69,7 +69,7 @@ First, attempt to call `search_events` using: If `search_events` is **not available** (the tool is absent from the available tool list because no embedded LLM provider is configured), fall back to `list_events` with direct Sentry query syntax: - `organizationSlug`: the org discovered in Step 1 - `dataset: spans` -- `query`: a filter for AI/LLM spans with token data; start with `span.op:ai*` and also try `span.op:gen_ai*` if the first returns no results; if neither matches, try an empty query and filter client-side for records with token fields +- `query`: a filter for AI/LLM spans with AIC/cost data; start with `span.op:ai*` and also try `span.op:gen_ai*` if the first returns no results; if neither matches, try an empty query and filter client-side for records with AIC fields - `fields`: include AIC/cost fields such as `gh-aw.aic`, `gh_aw.aic`, `aic`, `agent_usage.aic`, plus workflow metadata (`github.workflow`, `github.run_id`, `span.op`, `span.description`, `timestamp`); omit fields that return errors and retry with remaining fields - `sort`: `-timestamp` - Use pagination to cover the last 24 hours From 479747f18766cbe4c6edbb79351b131e194307b7 Mon Sep 17 00:00:00 2001 From: Mara Nikola Kiefer <8320933+mnkiefer@users.noreply.github.com> Date: Wed, 10 Jun 2026 15:36:40 +0200 Subject: [PATCH 3/3] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/daily-token-consumption-report.lock.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/daily-token-consumption-report.lock.yml b/.github/workflows/daily-token-consumption-report.lock.yml index 0bae19fdb66..c45ca284c49 100644 --- a/.github/workflows/daily-token-consumption-report.lock.yml +++ b/.github/workflows/daily-token-consumption-report.lock.yml @@ -1498,7 +1498,7 @@ jobs: uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: WORKFLOW_NAME: "Daily AIC Consumption Report (Sentry OTel)" - WORKFLOW_DESCRIPTION: "Daily report of token consumption across all agentic workflows using OTel telemetry stored in Sentry" + WORKFLOW_DESCRIPTION: "Daily report of AI Credits (AIC) consumption across all agentic workflows using OTel telemetry stored in Sentry" HAS_PATCH: ${{ needs.agent.outputs.has_patch }} with: script: |