gw auth api ord inv db
Some paths require a wider view.
Return on a larger screen.

Where the Collector Runs

The river must flow somewhere. Close to the source, or gathered at the mouth.
Each position serves a different purpose.
kubernetes concepts
Node 1 (machine) Pod api-svc Pod orders-svc Pod (with sidecar) app collector Node 2 (machine) Pod payment-svc Pod inventory-svc Pod = containers running together Node = machine running pods Sidecar = extra container in same pod
Agent Mode per node / per pod
Node api-svc orders-svc Collector (agent) localhost:4317 forwards to gateway
One collector per node (DaemonSet) or per pod (sidecar). Apps send to localhost. Lightweight processing.
Gateway Mode centralized
Agent (Node 1) Agent (Node 2) Agent (Node 3) Load Balancer Collector (gateway replica 1) Collector (gateway replica 2) Backends (Jaeger, Prometheus...)
Centralized collector deployment. Multiple replicas behind a load balancer. Heavy processing that needs data from many services.

Your team needs lightweight batching close to each application. Which deployment mode?

Agent mode puts a collector right next to your apps. Batching, basic enrichment, and retry logic happen at the source — lightweight work that does not need a global view.

You need to sample traces that span 12 different services. Which deployment mode?

To sample a complete trace, you need to see all of its spans. An agent on a single node only sees local spans. A gateway sees spans from every service — it can make sampling decisions with the full picture.

the layered pattern
Applications Agent Collectors Gateway Collector Backends api-svc orders-svc payment-svc inventory-svc Agent (Node 1) batch, enrich Agent (Node 2) batch, enrich Gateway sample, route, aggregate (full trace view) Jaeger Prometheus Loki local (localhost) network export

Agent mode handles the lightweight work close to the source. Gateway mode handles the heavy processing that requires seeing the whole picture.

In practice, agents forward to gateways. Each position in the flow serves its purpose.

Continue →