Skip to content

epic: Tracing observability PoC with K8s agentic networking #619

Closed

Description

@evaline-ju

Problem

The upstream k8s agentic networking group has been working on proposals around access policies related to tool authorization and tracing observability.

A quickstart was put together with access policies for tools. We would like to leverage this for trying out a PoC on tracing observability while leveraging Kagenti components, allowing for benefits to both the upstream community and Kagenti plans.

design

The light purple portions are the parts we would like to leverage from Kagenti examples and MCP gateway:
Image

This is an update of the mermaid diagram from the quickstart:

---
config:
  theme: mc
---
graph TD
    subgraph Kubernetes Cluster
        subgraph agentic-net-system ns
            Controller(agentic-networking-controller)
        end

        subgraph quickstart-ns
            Agent(Kagenti Agent)
            Envoy(MCP gateway)
            Envoy --> Decision{Policy Allowed?}
            LocalMCP(Local MCP Server)
            LocalKagentiMCP(Kagenti MCP tool)
        end
        K8sAPI(Kubernetes API Server)
    end

    User([User]) -- "1. kubectl apply" --> K8sAPI
    K8sAPI -- "2. Watches resources" --> Controller
    Controller -- "3. Provisions Envoy" --> Envoy
    Controller -- "4. Translates policy to xDS config" --> Envoy

    Agent -- "5. Tool call" --> Envoy

    Decision -- "Yes" --> LocalMCP
    Decision -- "Yes" --> LocalKagentiMCP(Kagenti MCP tool)
    Decision -- "Yes" --> RemoteMCP(Remote MCP Server)
    Decision -- "No" --> Forbidden(Response: 403 Forbidden)

    style User fill:#f9f,stroke:#333,stroke-width:2px
    style RemoteMCP fill:#f9f,stroke:#333,stroke-width:2px
    style Agent fill:#bbf,stroke:#333,stroke-width:2px,color:#000000
    style LocalKagentiMCP fill:#bbf,stroke:#333,stroke-width:2px,color:#000000
    style Envoy fill:#bbf,stroke:#333,stroke-width:2px,color:#000000

Goals and non-goals

Goals

  • Validate we can run the upstream quickstart
  • Swap out the quickstart ADK agent for a Kagenti A2A agent and check that access policies can still be applied
    • This may require updates to the Kagenti agent deployments like a ServiceAccount and updated MCP_URL to the envoy proxy as well as testing whether separate namespaces affect components talking to each other
  • Swap out to a different MCP tool server if needed
  • Swap envoy proxy out to MCP gateway (especially if there are MCP spans available)
    • Any adjustments that have to be made particularly to the quickstart gateway can help inform whether there are gaps that could be accounted for at the MCP gateway or platform level (or envoy proxy/gateway in general), if appropriate
  • Ideally trace an agent call through gateways/envoy proxies to a tool e2e
    • Be able to identify any gaps (and in which components) that prevent complete tracing (what is required of individual agent vs. tool implementations? what can we trace at the gateway level or mandate of a platform?)

Success criteria

  • GenAI semantic convention trace spans can be available for an agent->tool call as documented in https://github.com/kubernetes-sigs/kube-agentic-networking/pull/33, including GenAI agent, GenAI LLM, MCP, and security rule spans as appropriate
    OR
  • Clear gaps in ability to provide GenAI semantic convention spans are identified with follow-ups in individual components

Stories to be associated with this epic

  • Get quickstart running as-is if possible
  • Swap out quickstart agent for Kagenti agent (by simple replacement or move Kagenti agent+observability-related deployments to a new cluster running just the quickstart) and see what traces are available and can be linked
  • Swap out quickstart tools for an instrumented tool and see what traces are available and can be linked
  • Swap out quickstart envoy proxy for MCP gateway [may be combined with the above to provide more traces]

Additional Context

Benefits for upstream community:

  • Reference implementation can be made more flexible to agent implementations
  • Use an agent that already has instrumentation and connections to platform with observability tools (OpenTelemetry collector, Phoenix or MLFlow etc.)
  • Show e2e tracing and ideally feedback for access policy violations/failures

Benefits for Kagenti community:

  • Make sure Kagenti platform components can work with upstream-proposed access policies
  • Any changes that have to be made for the individual agents/tools can be considered for platform improvement
  • Progress tracing observability initiative

Potentially related MCP gateway issues noted here:

Activity

  1. moved this from Backlog to Ready in Rossoctl Issue Prioritizationon Feb 9, 2026
  2. rubambiza commented on Feb 9, 2026

    @rubambiza
    Contributor

    Got the Quickstart working with Hugging Face models.

  3. evaline-ju commented on Feb 9, 2026

    @evaline-ju
    ContributorAuthor

    Quickstart was working for me as of Feb. 5 with an agent image leveraging gemini-2.5-flash - link to discussion in upstream kubernetes slack

  4. evaline-ju commented on Feb 12, 2026

    @evaline-ju
    ContributorAuthor

    Swap out the quickstart ADK agent for a (Kagenti) A2A agent and check that access policies can still be applied

    I attempted to apply the network policies to an existing kind cluster namespace already with an A2A LangGraph weather agent calling out to an MCP server with a get_weather tool. Firstly the agent was directly calling the tool, and the agent had some existing instrumentation through LangChainInstrumentor. I pointed the agent to calling the tool through an envoy proxy provided through the upstream controller.

    Notes:

    • To work with the quickstart controller following the upstream quickstart's step 3, I first updated my agent deployed with a service account then had to update my agent to be able to read a x-k8s-sa-token header with the service account token. [Edit] This is leveraged by the jwt_authn filter in the current controller listener
    • I was able to toggle the availability of the single get_weather tool via the XAccessPolicy and get a client 403 error for access to the tool when it was not specified.
    • This error doesn't currently propagate particularly neatly, and to note, Arize-Phoenix leverages OpenInference format. The current platform MLFlow integration does not seem to appear on default for kind cluster so this was not leveraged/tried yet
    Image Image Agent attributes: Image
  5. moved this from Ready to In progress in Rossoctl Issue Prioritizationon Feb 16, 2026
  6. evaline-ju commented on Feb 18, 2026

    @evaline-ju
    ContributorAuthor

    Hitting some obstacles with leveraging MCP gateway in Kagenti (#720 - resolved, #718 - resolved per team members but not verified by me yet)

    Seeing some errors like flag provided but not defined: -mcp-broker-config-address from trying to leverage MCP gateway images built via make build-image from https://github.com/Kuadrant/mcp-gateway/pull/595 since Kagenti was on 0.4.0 - may be blocked on #616 upgrade, but I was able to test MCP gateway otel tracing https://github.com/Kuadrant/mcp-gateway/pull/595 after forcing a chart ugprade.

    One of the main issues was identified in #667 of how the original/root span will be instantiated and if this can be easily instantiated outside the individual agent implementations. There are iterative ways to test traceparent header being forwarded from agent -> envoy to be leveraged by MCP gateway. First is to try to pass the Langchain instantiated traceparent (within agent implementation) on the MCP tool calls. However, this could be a bit limiting if there's already an existing span context, depending on the origin of the call to the agent. Approaches to #667 explored various ways to build on that.

  7. evaline-ju commented on Feb 25, 2026

    @evaline-ju
    ContributorAuthor

    mtls auth was recently merged upstream https://github.com/kubernetes-sigs/kube-agentic-networking/pull/93/ and required kube 1.35 requiring an update done in kagenti #757 to be compatible. The strategies for auth are still different in the upstream reference implementation vs. kagenti which has made trying out kagenti agents with the upstream controller and policies more difficult.

  8. evaline-ju commented on Mar 4, 2026

    @evaline-ju
    ContributorAuthor

    Less directly related to the upstream reference implementation but in order to trace Kagenti agent -> MCP gateway, some gaps need to be closed:

    • feat: Configure Istio to export Envoy traces to OTel Collector for Kind clusters #795 (merged) to allow Envoy proxy traces to be available
      • Open question on whether default Envoy spans should be available (with Istio there appears to be issues with the metadata exchange filter in Ambient mode), static cluster use resulted in many spans to the point of potential spam
    • MCP gateway spans are not yet in a release/chart and the broker-router image has to be updated manually for Kagenti from MCP gateway mainline
      • Next chart will have to be checked for opentelemetry env vars, or they will have to be patched in on the kagenti side
    • Example agent needs to pass the traceparent through on MCP tool calls, or MCP gateway spans will show up separately - draft feat: Trace weather agent to MCP gateway tool calls examples#145
    • LangGraph - > MCP appears to have issues - there are some relevant upstream issues https://github.com/modelcontextprotocol/python-sdk/issues/1969 which got closed in favor of https://github.com/modelcontextprotocol/python-sdk/issues/1684 - potentially relevant PR to track https://github.com/modelcontextprotocol/python-sdk/pull/1996
  9. evaline-ju commented on Apr 22, 2026

    @evaline-ju
    ContributorAuthor

    Example Phoenix trace:
    Image

    The existing weather-service agent LangGraph spans have not been addressed - checking on the previously linked issues, there appears to be a new merged PR https://github.com/modelcontextprotocol/python-sdk/pull/2298 in the last few weeks that could address some of the previously observed LangGraph issues (not an immediate priority at this time).

    The implication on upstream k8s agentic networking's implementation will require further thought. With Envoy proxy used as the gateway, providing particular GenAI semantic conventions will likely require different strategy than used for MCP gateway. In some initial experimentation, I ran into trouble with shadow rules to log the access policy rule names when there was no positive "match" of rules. Today, the MCP gateway also does not itself provide the mcp.authorization.rule spans as detailed in this proposal: https://kube-agentic-networking.sigs.k8s.io/proposals/0033-observability/

  10. added
    epic
    on Apr 29, 2026
  11. moved this from In progress to Epics in Rossoctl Issue Prioritizationon May 21, 2026
  12. evaline-ju commented on Jun 24, 2026

    @evaline-ju
    ContributorAuthor

    Closing this epic based on the progress made and as the goals have been explored, but the implementations between k8s agentic networking and kagenti today have diverged to the point that they are better tracked independently at this time.

    Progress summary:

    • The upstream quickstart was validated with a kagenti agent and the Envoy proxy, and access policies were confirmed to apply.
    • For kagenti, agent → gateway → tool traces were linked end-to-end via traceparent header propagation primarily with the weather example, with MLFlow and Phoenix traces visible across the kagenti components
    • Gateway-level tracing with authorization span attributes is being implemented upstream in Implement gateway-level authorization tracing for agent tool calls kubernetes-sigs/kube-agentic-networking#280. This is primarily to enable agent → Envoy gateway authorization spans

    Future: The upstream group has been progressing on the XAccessPolicy CR (now v1alpha1) as a Kubernetes-native way to express MCP-level authorization policy scoped to specific methods and tool names, with sources as ServiceAccount or SPIFFE identity, and an ExternalAuth option for delegating to an external policy engine. kagenti could consider this CR for a standard policy interface eventually but likely implemented through the MCP gateway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Observabilityepic

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions