fix: align OTEL attributes with gen_ai semconv spec#3488
Conversation
… code The workflow was using --skip-pull with pre-built GHCR images (v0.25.29) which don't include the recently-merged otel.js module. Switch to --build-local so the api-proxy container is built from source and includes the OTEL tracing implementation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Streaming OpenAI/Copilot API responses only include usage data in the
final SSE chunk when the client sends stream_options: {include_usage: true}.
Without this, the token tracker never extracts usage and OTEL spans have
no gen_ai.usage.* attributes.
The api-proxy now injects this option automatically for OpenAI-compatible
providers (copilot, openai, opencode) when stream: true is set and
stream_options is not already present.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rename attributes to match the OpenTelemetry GenAI semantic conventions: - awf.provider → gen_ai.provider.name - gen_ai.system → removed (deprecated) - awf.cache_read_tokens → gen_ai.usage.cache_read.input_tokens - awf.cache_write_tokens → gen_ai.usage.cache_creation.input_tokens - awf.streaming → gen_ai.request.stream Add new standard attributes: - gen_ai.operation.name (set to 'chat') - gen_ai.usage.reasoning.output_tokens Reference: https://opentelemetry.io/docs/specs/semconv/registry/attributes/gen-ai/ Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
Smoke Test Results✅ GitHub API - 2 PR entries verified in recent-prs.json Result: PASS ✨
|
🔥 Smoke Test: Copilot BYOK Offline Mode
Running in BYOK offline mode ( Author: @lpcox | Overall: PARTIAL (BYOK path confirmed ✅; pre-step outputs not expanded)
|
🔬 Smoke Test Results
Overall: PASS Author: @lpcox
|
|
Smoke test: FAIL Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test: API Proxy OTEL Tracing Results
All 5 scenarios pass. OTEL tracing integration is fully functional.
|
Chroot Version Comparison — Smoke Test Results
Result: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environment.
|
|
Smoke Test: Gemini Engine Validation. Results: MCP: FAIL, Connectivity: FAIL, File Writing: PASS, Bash: PASS. Overall: FAIL. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
Smoke Test Results — Services Connectivity
Overall: FAIL
|
Aligns api-proxy OTEL span attributes with the OpenTelemetry GenAI semantic conventions:
Renamed attributes:
awf.provider→gen_ai.provider.namegen_ai.system→ removed (deprecated in spec)awf.cache_read_tokens→gen_ai.usage.cache_read.input_tokensawf.cache_write_tokens→gen_ai.usage.cache_creation.input_tokensawf.streaming→gen_ai.request.streamNew standard attributes:
gen_ai.operation.name(set tochat)gen_ai.usage.reasoning.output_tokensTests updated to match.