Forward OTEL trace context through nested AWF agent env passthrough - #6830
Conversation
There was a problem hiding this comment.
Pull request overview
Adds nested AWF OpenTelemetry context propagation from the agent environment to the API proxy.
Changes:
- Forwards AW trace endpoint and parent-context variables.
- Adds focused regression tests.
- Updates smoke workflow validation.
Show a summary per file
| File | Description |
|---|---|
src/services/api-proxy-env-config.test.ts |
Tests endpoint forwarding. |
src/services/agent-environment/env-passthrough.ts |
Adds trace variables to passthrough. |
src/services/agent-environment/env-passthrough.test.ts |
Tests nested trace propagation. |
.github/workflows/smoke-otel-tracing.md |
Updates smoke validation path. |
.github/workflows/smoke-otel-tracing.lock.yml |
Regenerates the compiled workflow. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Balanced
| 'DOCKER_API_VERSION', | ||
| 'DOCKER_DEFAULT_PLATFORM', | ||
| 'COPILOT_OTEL_FILE_EXPORTER_PATH', | ||
| 'GH_AW_OTLP_ENDPOINTS', |
| if grep -q 'GH_AW_OTLP_ENDPOINTS\|GITHUB_AW_OTEL_TRACE_ID\|GITHUB_AW_OTEL_PARENT_SPAN_ID' src/services/agent-environment/env-passthrough.ts \ | ||
| && grep -q 'GH_AW_OTLP_ENDPOINTS\|OTEL_EXPORTER_OTLP_ENDPOINT\|GITHUB_AW_OTEL_TRACE_ID' src/services/api-proxy-env-config.ts; then | ||
| echo "✅ OTEL env vars are forwarded through agent passthrough and into api-proxy" | ||
| else | ||
| echo "⚠️ OTEL env vars not yet forwarded (expected during development)" | ||
| echo "⚠️ OTEL env vars not yet forwarded through the full agent → api-proxy path (expected during development)" |
|
@copilot address review feedback |
Addressed both review comments in commit
|
|
✅ Copilot review passed with no inline comments. @copilot Add the |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
|
🔌 Smoke Services — Service connectivity failed |
|
❌ Smoke Copilot BYOK reports failed. BYOK mode investigation needed... |
|
❌ Smoke Claude failed |
|
❌ Smoke Gemini reports failed. Facets need polishing... |
|
❌ Contribution Check failed. Please review the logs for details. |
|
🛡️ Smoke Copilot Network Isolation reports failed while checking network isolation. Investigate the egress model. |
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... |
|
Chroot tests failed Smoke Chroot failed - See logs for details. |
|
📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident... |
|
EGRESS_RESULT allow=pass deny=pass ✅ Allowed domain (api.github.com) reachable: Overall: PASS
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
Smoke Test: Claude Engine Validation
Overall result: ✅ PASS
|
Smoke Test: Copilot BYOK (Direct) Mode ✅ PASS
Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY) with api-proxy credential injection.
|
|
Smoke Test: Copilot Engine —
Overall: PASS
|
Smoke Test: GitHub Actions Services Connectivity
Overall: FAIL — host.docker.internal did not resolve from the AWF sandbox.
|
|
✅ fix: upgrade cli-proxy gh to 2.97.0 Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
Chroot Version Comparison Results
Overall: FAILED — Node.js version mismatch between host and chroot environments.
|
Smoke Test: API Proxy OpenTelemetry Tracing — Results
Summary: All 5 scenarios pass. OTEL integration (module init, span creation code paths, token usage attributes, env var propagation, and test coverage) verified working; graceful degradation confirmed since no live API traffic occurred in this run.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS Note: Java Maven builds required
|
|
Docker Sbx Smoke Test —
Overall: PASS
|
|
|
|
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)
|
Gemini Engine Smoke Test Results
Overall Status: PASS
|
The smoke OTel tracing flow was losing trace configuration before the api-proxy sidecar started: nested AWF runs were not passing
GH_AW_OTLP_ENDPOINTSor the GitHub AW trace context into the agent container, so the sidecar could not emit spans under the workflow trace. This PR wires that missing hop and aligns the smoke check with the actual forwarding path.Agent → sidecar trace-context propagation
OTEL_tracing vars tosrc/services/agent-environment/env-passthrough.ts:GH_AW_OTLP_ENDPOINTSGITHUB_AW_OTEL_TRACE_IDGITHUB_AW_OTEL_PARENT_SPAN_IDapi-proxy-env-configRegression coverage
GH_AW_OTLP_ENDPOINTSassertion in api-proxy OTEL env config tests.Smoke workflow validation
smoke-otel-tracingto validate the real implementation path instead of grepping the wrapper service file:src/services/agent-environment/env-passthrough.tssrc/services/api-proxy-env-config.ts