Skip to content

feat: Approach A - AuthBridge ext_proc root span for zero-agent OTEL observability - #668

Closed
Ladas wants to merge 45 commits into
rossoctl:mainfrom
Ladas:feat/otel-authbridge-root-span-667
Closed

Ladas wants to merge 45 commits into
rossoctl:mainfrom
Ladas:feat/otel-authbridge-root-span-667

Conversation

@Ladas

@Ladas Ladas commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Approach A for issue #667: Extend the existing AuthBridge ext_proc gRPC server (Go) to create OTEL root spans for agent requests, enabling MLflow/Phoenix GenAI observability with zero agent code changes.

  • Extend ext_proc to parse A2A JSON-RPC request/response bodies
  • Create root span with gen_ai.agent.invoke naming and all required attributes
  • Inject W3C traceparent header so agent auto-instrumented spans become children
  • Agent needs only: OTEL SDK + auto-instrumentation (LangChain/OpenAI) - no custom code

See design doc for full architecture.

Related

Test plan

  • Deploy weather agent WITHOUT observability.py (only auto-instrumentation)
  • Verify AuthBridge ext_proc creates root span with MLflow attributes
  • Run MLflow E2E tests (pytest -m observability)
  • Compare trace tree structure with baseline (PR 114)
  • Parametrize tests across multiple agent variants

🤖 Generated with Claude Code

@Ladas

Ladas commented Feb 12, 2026

Copy link
Copy Markdown
Contributor Author

/run-e2e

@github-actions github-actions Bot added the safe-to-test Maintainer reviewed - safe to run E2E tests label Feb 12, 2026
@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Started

Triggered by: @Ladas
Commit: c64035ceaa99305aa0124d6b4915c2c662c19b89
Workflow Run: View logs

Tests are running on OpenShift 4.20.11. This typically takes 30-45 minutes.


To re-run tests after new commits, comment /run-e2e again.

@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Failed

Commit: c64035ceaa99305aa0124d6b4915c2c662c19b89
Result: Tests failed - please check the logs
Workflow Run: View logs


To re-run tests after fixing issues, comment /run-e2e again.

@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Passed

Commit: c64035ceaa99305aa0124d6b4915c2c662c19b89
Result: All tests passed
Workflow Run: View logs

The safe-to-test label indicates this commit has been approved for E2E testing.


If you push new commits, the label will be removed and you'll need to comment /run-e2e again.

@Ladas
Ladas force-pushed the feat/otel-authbridge-root-span-667 branch from c64035c to 1d10b0c Compare February 13, 2026 14:07
@github-actions github-actions Bot removed the safe-to-test Maintainer reviewed - safe to run E2E tests label Feb 13, 2026
@github-actions

Copy link
Copy Markdown

New Commits Detected

The safe-to-test label has been automatically removed because new commits were pushed.

New HEAD: 1d10b0c

For maintainers: Please review the new changes and comment /run-e2e to trigger E2E tests.

Security checklist

Before running E2E tests, verify the PR does NOT contain:

  • Changes to .github/workflows/ that bypass security
  • Changes to .github/scripts/ that could exfiltrate secrets
  • curl, wget, or nc commands to external URLs in scripts
  • Base64 encoding of environment variables
  • Printing secrets to logs (echo $SECRET)
  • Suspicious package installations

This is an automated security measure to prevent TOCTOU attacks

@Ladas
Ladas force-pushed the feat/otel-authbridge-root-span-667 branch 3 times, most recently from 761b423 to b31d995 Compare February 15, 2026 14:41
@Ladas

Ladas commented Feb 15, 2026

Copy link
Copy Markdown
Contributor Author

/run-e2e

@github-actions github-actions Bot added the safe-to-test Maintainer reviewed - safe to run E2E tests label Feb 15, 2026
@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Started

Triggered by: @Ladas
Commit: 870b0f68aee960fa926a5136de2bb6237be36f99
Workflow Run: View logs

Tests are running on OpenShift 4.20.11. This typically takes 30-45 minutes.


To re-run tests after new commits, comment /run-e2e again.

@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Failed

Commit: 870b0f68aee960fa926a5136de2bb6237be36f99
Result: Tests failed - please check the logs
Workflow Run: View logs


To re-run tests after fixing issues, comment /run-e2e again.

@github-actions github-actions Bot removed the safe-to-test Maintainer reviewed - safe to run E2E tests label Feb 15, 2026
@github-actions

Copy link
Copy Markdown

New Commits Detected

The safe-to-test label has been automatically removed because new commits were pushed.

New HEAD: 0eedb65

For maintainers: Please review the new changes and comment /run-e2e to trigger E2E tests.

Security checklist

Before running E2E tests, verify the PR does NOT contain:

  • Changes to .github/workflows/ that bypass security
  • Changes to .github/scripts/ that could exfiltrate secrets
  • curl, wget, or nc commands to external URLs in scripts
  • Base64 encoding of environment variables
  • Printing secrets to logs (echo $SECRET)
  • Suspicious package installations

This is an automated security measure to prevent TOCTOU attacks

@Ladas

Ladas commented Feb 15, 2026

Copy link
Copy Markdown
Contributor Author

/run-e2e

@github-actions github-actions Bot added the safe-to-test Maintainer reviewed - safe to run E2E tests label Feb 15, 2026
@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Started

Triggered by: @Ladas
Commit: 0eedb65e2594d72d3b3b00b5dc9b2123edfb27b5
Workflow Run: View logs

Tests are running on OpenShift 4.20.11. This typically takes 30-45 minutes.


To re-run tests after new commits, comment /run-e2e again.

@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Failed

Commit: 0eedb65e2594d72d3b3b00b5dc9b2123edfb27b5
Result: Tests failed - please check the logs
Workflow Run: View logs


To re-run tests after fixing issues, comment /run-e2e again.

@Ladas

Ladas commented Feb 16, 2026

Copy link
Copy Markdown
Contributor Author

/run-e2e

@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Started

Triggered by: @Ladas
Commit: 0eedb65e2594d72d3b3b00b5dc9b2123edfb27b5
Workflow Run: View logs

Tests are running on OpenShift 4.20.11. This typically takes 30-45 minutes.


To re-run tests after new commits, comment /run-e2e again.

Ladas and others added 12 commits February 18, 2026 16:57
When the resubscribe SSE stream returns no events (EventQueue already
closed), fall back to a single tasks/get call after 3s. The shielded
agent execution saves the completed task to the InMemoryTaskStore,
so tasks/get can retrieve the artifact with the output.

Removes the 5s Playwright wait — no longer needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
- Set gen_ai.conversation.id from SSE response contextId (server-assigned)
- Fall back to tasks/get when resubscribe returns no events on disconnect
- Remove 5s Playwright wait — tasks/get recovers output from task store

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
Per https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/:
- Chat spans: "chat {model}" (was "gen_ai.chat")
- Tool spans: "execute_tool {name}" (was "gen_ai.tool.{name}")
- Root span: "invoke_agent {name}" (unchanged)

Also adds gen_ai.request.model attribute on LLM spans.

Phoenix/OpenInference attributes added to collector transform:
- openinference.span.kind (AGENT/LLM/TOOL) from span name patterns
- input.value / output.value from gen_ai.prompt / gen_ai.completion

MLflow transform updated to match new span name patterns.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
The span names changed per OTel GenAI spec:
- "invoke_agent {name}" (root)
- "chat {model}" (LLM)
- "execute_tool {name}" (tool)

Add these to GENAI_SPAN_PATTERNS so has_genai_spans() detects them.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
Rewrite otel-authbridge-root-span.md to reflect the current state:
- Zero OTEL agent (no deps, no auto-instrumentation)
- JSON event serialization from LangGraph
- Nested child spans from SSE stream parsing
- GenAI spec span naming (chat/execute_tool/invoke_agent)
- OTEL Collector transforms for MLflow and Phoenix
- Client disconnect recovery via tasks/get fallback

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
The else-if branch for content-only AI messages was unconditionally
setting spanName = "chat", overriding the "chat {model}" name that
was already set from response_metadata. Only set fallback name when
spanName is empty.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
MLflow's chat-sessions UI requires mlflow.trace.session to be set by
the span producer, not by collector transforms. Set it alongside
gen_ai.conversation.id in the ext_proc.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
MLflow's OTLP handler extracts session.id from span attributes to
populate trace_request_metadata (per mlflow/mlflow#20803). The ext_proc
sets only gen_ai.conversation.id; the collector transforms derive
session.id from it for both MLflow and Phoenix pipelines.

Removes mlflow.trace.session from ext_proc — it was a span attribute
that MLflow's OTLP handler doesn't promote to trace metadata.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
Replace on-cluster OpenShift Build with pre-built image from
quay.io/lsmola/otel-ext-proc:latest. The source code lives in
kagenti-extensions repo (PR rossoctl#119).

Remove the oc start-build logic from the deploy script — no longer
needed since the image is pulled from a registry.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
The OTEL ext_proc source code has been integrated into
kagenti-extensions/AuthBridge/AuthProxy/go-processor/ as targeted
additions to the existing ext_proc (PR rossoctl#119). Remove the standalone
copy from this repo.

The pre-built image at quay.io/ladas/otel-ext-proc:latest is built
from the extensions repo.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
Add OTEL_INSTRUMENT=none env var to weather-service base deployment.

Add weather_service_variants_ocp.yaml with two additional deployments:
- weather-service-oi: OTEL_INSTRUMENT=openinference (LangChainInstrumentor)
- weather-service-oai: OTEL_INSTRUMENT=openai (OpenAIInstrumentor)

Each variant shares the same agent image but with different auto-
instrumentation config. All include envoy + otel-ext-proc sidecars.
Enables side-by-side comparison of trace output across modes.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
@Ladas
Ladas force-pushed the feat/otel-authbridge-root-span-667 branch from 3be772e to 293bbbf Compare February 18, 2026 19:07
@Ladas

Ladas commented Feb 18, 2026

Copy link
Copy Markdown
Contributor Author

/run-e2e

@github-actions github-actions Bot added the safe-to-test Maintainer reviewed - safe to run E2E tests label Feb 18, 2026
@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Started

Triggered by: @Ladas
Commit: 293bbbf0a624772e9830502946d139029d68c89c
Workflow Run: View logs

Tests are running on OpenShift 4.20.11. This typically takes 30-45 minutes.


To re-run tests after new commits, comment /run-e2e again.

@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Failed

Commit: 293bbbf0a624772e9830502946d139029d68c89c
Result: Tests failed - please check the logs
Workflow Run: View logs


To re-run tests after fixing issues, comment /run-e2e again.

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this PR is still relevant, please comment or remove the stale label.

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown

This pull request was closed because it has been stale for 14 days with no activity. Feel free to reopen if this is still relevant.

@github-actions github-actions Bot closed this May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe-to-test Maintainer reviewed - safe to run E2E tests stale

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant