Skip to content

feat: add smoke-otel-tracing workflow for OTel/OTLP/Sentry validation - #4626

Merged
lpcox merged 1 commit into
mainfrom
feat/smoke-otel-tracing
Apr 27, 2026
Merged

feat: add smoke-otel-tracing workflow for OTel/OTLP/Sentry validation#4626
lpcox merged 1 commit into
mainfrom
feat/smoke-otel-tracing

Conversation

@lpcox

@lpcox lpcox commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a weekly smoke test workflow (smoke-otel-tracing.md) that validates the MCP Gateway's OpenTelemetry tracing across 8 scenarios.

Motivation

Investigation of gh-aw action run #24940914427 revealed:

  1. MCPG tracing initializes correctly but gateway spans don't link to the parent trace (parent context is on process-level ctx, not per-request)
  2. Routed mode lacks tool-level span instrumentation (mcp.tool_call only exists in unified mode)
  3. Sentry MCP backend returns 401 due to expired SENTRY_API_KEY (#28517)

Recent gh-aw OTel changes that affect MCPG:

  • #28524: observability.otlp.headers now supports object form — MCPG receives the normalized string
  • #28511: Agent span uses gen_ai.* semantic conventions — emitted by JS layer, MCPG spans should be siblings in same trace

Test Scenarios

# Scenario What it validates
1 Provider init Noop vs SDK provider, sampler selection
2 Parent context traceId/spanId → W3C remote span context
3 HTTP handler spans WrapHTTPHandler creates gateway.request spans
4 Tool call spans callBackendTool creates mcp.tool_call spans (unified)
5 Header parsing Comma-separated OTLP export headers
6 HTTP backend auth Sentry-pattern env var expansion for auth headers
7 Graceful shutdown Provider.Shutdown flushes buffered spans
8 Binary integration awmg accepts OTel config via stdin JSON

Known Gaps (documented, not filed as issues)

  • Routed mode has no tool-level spans (by design for now)
  • Parent trace linkage requires traceparent request headers
  • Schema URL conflict warning (non-fatal, OTel SDK version skew)

Verification

  • make agent-finished ✅ — all checks pass
  • gh aw compile smoke-otel-tracing ✅ — compiles cleanly

Weekly smoke test that validates the MCP Gateway's OpenTelemetry tracing:
- Provider initialization (noop vs SDK, sampler selection)
- W3C parent context propagation (traceId/spanId resolution)
- HTTP handler span creation (WrapHTTPHandler)
- Tool call span instrumentation (unified mode callBackendTool)
- OTLP header parsing (comma-separated key=value format)
- HTTP backend auth (Sentry-pattern env var expansion)
- Graceful shutdown with span flush
- Binary integration with stdin JSON OTel config

Motivated by investigation of gh-aw action run #24940914427 which
revealed that MCPG tracing initializes correctly but spans may not
link to the parent trace, and routed mode lacks tool-level spans.

Documents known gaps (routed mode instrumentation, parent trace
linkage, schema URL conflict) so the agent doesn't file false issues.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 27, 2026 00:57
@lpcox
lpcox merged commit 8fa056a into main Apr 27, 2026
11 checks passed
@lpcox
lpcox deleted the feat/smoke-otel-tracing branch April 27, 2026 01:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new weekly Agentic Workflow smoke test to validate MCP Gateway OpenTelemetry tracing behavior (provider init, context propagation, HTTP/tool spans, and related auth/shutdown scenarios) to catch regressions seen in recent investigations.

Changes:

  • Added a new smoke-otel-tracing workflow definition in gh-aw markdown format with 8 tracing validation scenarios.
  • Added the compiled .lock.yml workflow artifact for deterministic execution in GitHub Actions.
Show a summary per file
File Description
.github/workflows/smoke-otel-tracing.md Defines the weekly smoke workflow prompt/runbook and safe-outputs settings for OTel tracing validation.
.github/workflows/smoke-otel-tracing.lock.yml Compiled workflow used by GitHub Actions to execute the smoke test.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 4

Verify that `internal/tracing/` correctly initializes the OTLP provider:

```bash
cd /Users/lpcox/Desktop/ai/gh-aw-mcpg
Comment on lines +121 to +128
### Scenario 4: Tool Call Span Instrumentation (Unified Mode)

Verify that `callBackendTool` in `internal/server/unified.go` creates `mcp.tool_call` and
`gateway.backend.execute` spans with the correct attributes:

```bash
go test -v -run 'TestCallBackend|TestToolCall|TestCircuitBreaker' ./internal/server/ 2>&1
```
object form from #28524):

```bash
go test -v -run 'TestParseHeaders' ./internal/tracing/ 2>&1
Comment on lines +436 to +437
- name: Download container images
run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.28@sha256:a8834e285807654bf680154faa710d43fe4365a0868142f5c20e48c85e137a7a ghcr.io/github/gh-aw-firewall/api-proxy:0.25.28@sha256:93290f2393752252911bd7c39a047f776c0b53063575e7bde4e304962a9a61cb ghcr.io/github/gh-aw-firewall/squid:0.25.28@sha256:844c18280f82cd1b06345eb2f4e91966b34185bfc51c9f237c3e022e848fb474 ghcr.io/github/gh-aw-mcpg:v0.3.0 ghcr.io/github/github-mcp-server:v1.0.2 node:lts-alpine@sha256:01743339035a5c3c11a373cd7c83aeab6ed1457b55da6a69e014a95ac4e4700b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants