Skip to content

fix: use awf.usage namespace for cache/reasoning OTEL attributes#3495

Merged
lpcox merged 1 commit into
mainfrom
fix/otel-custom-cache-attrs
May 21, 2026
Merged

fix: use awf.usage namespace for cache/reasoning OTEL attributes#3495
lpcox merged 1 commit into
mainfrom
fix/otel-custom-cache-attrs

Conversation

@lpcox
Copy link
Copy Markdown
Collaborator

@lpcox lpcox commented May 21, 2026

Sentry only surfaces well-known gen_ai.usage.* attributes (input_tokens, output_tokens, total_tokens) and drops custom additions to that namespace.

Moves cache and reasoning attributes to awf.usage.* namespace:

  • awf.usage.cache_read_tokens
  • awf.usage.cache_write_tokens
  • awf.usage.reasoning_tokens

These will appear as regular span tags in Sentry.

Sentry only surfaces well-known gen_ai.usage.* attributes (input_tokens,
output_tokens, total_tokens) and drops custom additions to that namespace.

Move cache and reasoning token attributes to awf.usage.* namespace where
Sentry will display them as regular span tags:

- awf.usage.cache_read_tokens
- awf.usage.cache_write_tokens
- awf.usage.reasoning_tokens

Keep gen_ai.usage.input_tokens and gen_ai.usage.output_tokens on the
standard namespace since Sentry recognizes those.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 21, 2026 00:35
@lpcox lpcox merged commit 475a7d2 into main May 21, 2026
35 of 36 checks passed
@lpcox lpcox deleted the fix/otel-custom-cache-attrs branch May 21, 2026 00:36
@github-actions
Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 95.75% 95.83% 📈 +0.08%
Statements 95.58% 95.65% 📈 +0.07%
Functions 96.88% 96.88% ➡️ +0.00%
Branches 89.30% 89.34% 📈 +0.04%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/config-writer.ts 83.0% → 85.6% (+2.54%) 83.0% → 85.6% (+2.54%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results

✅ GitHub API test — 2 PR entries confirmed
✅ Playwright test — GitHub page title verified
✅ File verification — smoke test marker present

Result: PASS

💥 [THE END] — Illustrated by Smoke Claude

@github-actions
Copy link
Copy Markdown
Contributor

🔬 Smoke Test Results

PR: fix: use awf.usage namespace for cache/reasoning OTEL attributes — @lpcox

Test Result
GitHub MCP connectivity
GitHub.com HTTP connectivity ⚠️ (pre-step data not expanded)
File write/read ⚠️ (pre-step data not expanded)

Overall: PARTIAL — MCP connectivity confirmed; pre-step outputs were not substituted (template vars unexpanded), so HTTP and file tests could not be verified.

📰 BREAKING: Report filed by Smoke Copilot

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Offline) Mode

  • ✅ GitHub MCP: PR fix: use awf.usage namespace for cache/reasoning OTEL attributes #3495 "fix: use awf.usage namespace for cache/reasoning OTEL attributes" confirmed
  • ⚠️ HTTP connectivity: pre-step output not interpolated (template vars unexpanded)
  • ⚠️ File write/read: pre-step output not interpolated (template vars unexpanded)
  • ✅ BYOK inference: responding via api-proxy → api.githubcopilot.com (COPILOT_OFFLINE=true)

Running in BYOK offline mode (COPILOT_OFFLINE=true) via api-proxy → api.githubcopilot.com

PR author: @lpcox | Status: PARTIAL (core BYOK path ✅, pre-step data unavailable)

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test: API Proxy OpenTelemetry Tracing

Scenario Result Notes
✅ Module Loading Pass otel.js exports: startRequestSpan, setTokenAttributes, endSpan, endSpanError, shutdown, isEnabled + internals
✅ Test Suite Pass 32/32 tests passed in otel.test.js
✅ Env Var Forwarding Pass src/services/api-proxy-service.ts forwards OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, OTEL_SERVICE_NAME, GITHUB_AW_OTEL_TRACE_ID, GITHUB_AW_OTEL_PARENT_SPAN_ID
✅ Token Tracker Integration Pass onUsage callback exists at line 232 of token-tracker-http.js
✅ Graceful Degradation Pass isEnabled() export present; file fallback to /var/log/api-proxy/otel.jsonl when no endpoint configured

All scenarios pass. OTEL tracing integration is functioning correctly.

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test: FAIL
✅ GitHub PR review: fix: use awf.usage namespace for cache/reasoning OTEL attributes; fix: flatten OTEL cache attribute names for Sentry compatibility
❌ safeinputs-gh: tool unavailable
✅ Playwright/File/Bash/Build: passed
❌ Tavily/Discussion safe-input: required tools unavailable

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex

@github-actions
Copy link
Copy Markdown
Contributor

Chroot Version Comparison

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.3
Node.js v24.15.0 v20.20.2
Go go1.22.12 go1.22.12

Result: ❌ Not all versions matched — Python and Node.js versions differ between host and chroot environments.

Tested by Smoke Chroot

@github-actions
Copy link
Copy Markdown
Contributor

Gemini Engine Smoke Test Results

  • GitHub MCP Testing: ❌ (Tool mcpscripts not found)
  • GitHub.com Connectivity: ❌ (SSL error 35)
  • File Writing Testing: ✅
  • Bash Tool Testing: ✅

Overall status: FAIL

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • localhost

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

💎 Faceted by Smoke Gemini

@github-actions
Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color 1/1 passed ✅ PASS
Go env 1/1 passed ✅ PASS
Go uuid 1/1 passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx All passed ✅ PASS
Node.js execa All passed ✅ PASS
Node.js p-limit All passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Generated by Build Test Suite for issue #3495 · ● 8.1M ·

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test: GitHub Actions Services Connectivity

Check Result
Redis PING ❌ TIMEOUT
PostgreSQL pg_isready ❌ TIMEOUT
PostgreSQL SELECT 1 ❌ TIMEOUT

Overall: FAILhost.docker.internal is not reachable from this runner environment. Service containers may not be running or network routing is unavailable.

🔌 Service connectivity validated by Smoke Services

@lpcox lpcox review requested due to automatic review settings May 21, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant