Announcing Built On Envoy: Making Envoy Extensions Accessible to Everyone

Learn more

How the Envoy proxy handles a user request

Organizations often want to know how a service mesh can help provide better visibility into their deployments, so they can get a clearer understanding

How%20the%20Envoy%20proxy%20handles%20a%20user%20request

Organizations often want to know how a service mesh can help provide better visibility into their deployments, so they can get a clearer understanding of their user experience.

But neither metrics nor logs can provide specifics on individual cases. That’s where tracing comes in.

A trace gives a developer the full context of a user experience, by attaching a correlation ID to each user request. That correlation ID is the thread that links the trace together through multiple services.

Since all requests go through Envoy, it may seem that Envoy could provide the tracing information, but it’s not quite that simple. To Envoy, each application looks just like the network – Envoy doesn’t have any special insight into the application’s internals. This means Envoy can’t track causality: 10 requests enter a service and 100 leave it, which of the 100 relate to which of the 10? Because Envoy cannot answer that question, it cannot automatically forward trace context – or any other kind of context –  on behalf of your application. The presentation below shows this graphically:

Request Context in a Mesh

1. Tracing involves following a path through multiple services to understand the full context of the user experience. A trace begins with a user request, which is assigned a correlation ID.

Post Image
Post Image

5. Envoy is sitting right beside the application, and the two of them talk to each other. Any request that comes in goes through Envoy.

Post Image

6. The trace will show everything that happens to the user request. Since the request is going through Envoy, that will be part of the trace. After going through Envoy, the request goes to the application.

Post Image

7. Envoy can also attach additional headers to gather information about what is happening inside the app.

Post Image

8. As the request moves through the app, the app will likely contact another system to process the request.

Post Image

9. We can see inside the application that the request going out is on behalf of one that came in from the user with the trace ID 1234.

Post Image

10. Every request needs an identity, and we can see here that this request is correlated to the user.

Post Image

11. This is where things get more complicated. The application has to copy the identity for that user. It can’t get from one step to another without copying the ID.

Post Image

 12. The app sends a response to the user request, and in turn gets a response back.

Post Image

 13. The system will probably have to do multiple requests back and forth to get the full answer for the user request and return it.

Post Image

14. If this one request was all that the app was receiving, the service mesh could propagate headers and do all the tracing. But there’s never just one request coming in at a time, there’s always multiple requests happening concurrently. It’s that concurrency  — multiple things happening at one time — that causes a loss of visibility.

Post Image

15. Because Envoy can only see the network, and not inside the app, all it sees are multiple requests and responses. There’s no way for Envoy to know which of those belong to the different user requests, because they all happened at the same time. Envoy can’t put the data on the individual requests.

Post Image

16.  If we add multiple user requests at the same time, we can see the back-and-forth starts to grow rapidly.

Post Image

17. That’s why the application has to be involved, because it has to copy that data. That’s not necessarily easy to do, but there are tools built by the tracing community to make it easier. Tetrate recommends Zipkin.

Post Image

This is why the business logic itself needs to forward headers from the incoming request onto outgoing requests. There are many libraries for this for a variety of tracing systems and languages. TSB ships with Zipkin. Therefore, any of Zipkin’s listed libraries/agents would work out of the box.

For custom, non-tracing headers that need to be forwarded, you need to implement these yourself in a library your developers use.

Post Image
Post Image

Zack Butcher is a Tetrate engineer and an Istio contributor; Eileen AJ Connelly is a content writer for Tetrate. Tetrate writer Tevah Platt contributed.

Tetrate is a service mesh company that makes it easier for companies to adopt and use Istio and Envoy

Product background Product background for tablets
Building AI agents

Agent Router Enterprise provides managed LLM & MCP Gateways plus AI Guardrails in your dedicated instance. Graduate agents from prototype to production with consistent model access, governed tool use, and runtime supervision — built on Envoy AI Gateway by its creators.

  • LLM Gateway – Unified model catalog with automatic fallback across providers
  • MCP Gateway – Curated tool access with per-profile authentication and filtering
  • AI Guardrails – Enforce policies, prevent data loss, and supervise agent behavior
  • Learn more
    Replacing NGINX Ingress

    Tetrate Enterprise Gateway for Envoy (TEG) is the enterprise-ready replacement for NGINX Ingress Controller. Built on Envoy Gateway and the Kubernetes Gateway API, TEG delivers advanced traffic management, security, and observability without vendor lock-in.

  • 100% upstream Envoy Gateway – CVE-protected builds
  • Kubernetes Gateway API native – Modern, portable, and extensible ingress
  • Enterprise-grade support – 24/7 production support from Envoy experts
  • Learn more
    Decorative CTA background pattern background background
    Tetrate logo in the CTA section Tetrate logo in the CTA section for mobile

    Ready to enhance your
    network

    with more
    intelligence?