Skip to content

Configure Envoy tracing from OTEL_EXPORTER_OTLP_ENDPOINT - #637

Merged
Jeff Luo (JeffLuoo) merged 3 commits into
agent-substrate:mainfrom
JeffLuoo:fix/kind-otel-endpoint-atenet-router
Jul 31, 2026
Merged

Jeff Luo (JeffLuoo) merged 3 commits into
agent-substrate:mainfrom
JeffLuoo:fix/kind-otel-endpoint-atenet-router

Conversation

@JeffLuoo

@JeffLuoo Jeff Luo (JeffLuoo) commented Jul 30, 2026 •

Copy link
Copy Markdown
Collaborator

--otlp-collector-address defaults to os.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT"), unify all stacks to use environment variables.

#563

  • Tests pass
  • Appropriate changes to documentation are included in the PR

@JeffLuoo Jeff Luo (JeffLuoo) changed the title Point atenet-router at the kind OTel collector Configure Envoy tracing from OTEL_EXPORTER_OTLP_ENDPOINT Jul 30, 2026
@JeffLuoo
Jeff Luo (JeffLuoo) force-pushed the fix/kind-otel-endpoint-atenet-router branch from 0e9e478 to 4f6186c Compare July 30, 2026 18:02

@EItanya Eitan Yarmush (EItanya) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM but will leave to Julian Gutierrez Oschmann (@juli4n) for final review

Jeff Luo (JeffLuoo) added a commit to JeffLuoo/substrate that referenced this pull request Jul 30, 2026
- Qualify the default endpoint as GKE-specific rather than universal.
- Redact the cluster IP from the sample kubectl output.
- Correct the connection-pinning claim. GKE's collector sets
  max_connection_age: 10m with the comment "Force connection recycling to
  balance load among the backends", so pinning is bounded and
  self-correcting, not permanent. Reworded to say what actually remains:
  rebalancing is periodic, so a burst inside a window still lands unevenly.
- Add "Why the Deployment Suits Substrate". Telemetry volume tracks the
  active workload, which is what an HPA measures, whereas a DaemonSet sizes
  itself to node count and keeps paying after a burst drains. It also stops
  reserving CPU and memory on the sandbox nodes provisioned for actors, and
  stays out of the cluster autoscaler's way.
- Add a filelog receiver, hostPath mounts, and a logs pipeline to the
  DaemonSet. Node-local log collection is the one thing a gateway
  categorically cannot do, so it is now the headline reason to choose one.
- Adopt managed OTel's config practices: per-signal batch sizes, memory
  limiter spike percentage, layered pod_association, deployment name from
  replicaset, running-pod filter, gRPC keepalive, and health_check. Add a
  self-metrics pipeline. Table of the GCP-specific processors deliberately
  left out, and a note that GKE spells the processor k8s_attributes while
  upstream is k8sattributes.
- Update the endpoint instructions for agent-substrate#637: atenet-router's
  --otlp-collector-address now defaults to OTEL_EXPORTER_OTLP_ENDPOINT.
- Frame the TLS gap as a TODO to align with the pod-certificate mTLS every
  other in-cluster hop already uses, rather than a settled constraint.

Part of agent-substrate#563.
The kind overlay patched OTEL_EXPORTER_OTLP_ENDPOINT for ate-api-server,
ate-controller and atelet, but not atenet-router. The router kept the base
manifest's gke-managed-otel address for both its own OTLP exporter and the
--otlp-collector-address arg that configures Envoy tracing.

The gke-managed-otel namespace does not exist on kind, which only deploys a
collector into otel-system, so the router's spans and metrics silently failed
to export and Envoy's tracing cluster pointed at an unresolvable address.

Envoy's collector address is a container arg, and args has no strategic-merge
key, so a merge patch would replace the whole list. Patch that element
positionally with a JSON6902 test guard so the build fails loudly if the base
arg order changes.
…TLP_ENDPOINT

Envoy receives its whole configuration over xDS and never reads the
router's environment, so the collector address for its tracer cluster had
to be relayed through --otlp-collector-address. That left atenet-router
with two settings for one collector -- the env var for its own spans, an
arg for Envoy's -- and every overlay had to patch both. The kind overlay
patched only the env var, leaving Envoy pointed at the gke-managed-otel
namespace that does not exist on kind.

Default the flag to OTEL_EXPORTER_OTLP_ENDPOINT, the same variable
ate-apiserver and atelet already honor, and normalize the URL form it
carries down to the bare host and port an xDS SocketAddress accepts.
Envoy's collector now follows the pod's env var, so the base manifest arg
and the kind overlay's positional JSON patch both go away.

Dropping the base arg shifts --ateapi-client-cert from args index 13 to
12, so the token-client and kind-token-client overlays, which remove it
positionally, move with it.

https is rejected rather than silently downgraded: the tracer cluster is
plaintext h2c, so honoring it would ship spans in the clear to an endpoint
that asked for TLS. An explicit empty flag still disables Envoy-side
tracing while leaving the router's own spans enabled.
--otlp-collector-address now defaults to OTEL_EXPORTER_OTLP_ENDPOINT, so
an address Envoy's tracer cannot use no longer arrives only from a
deliberate flag. Rejecting it returned an error from Run, which cobra
turns into os.Exit(1): the container exits before serving and
CrashLoopBackOffs, taking the xDS control plane for every Envoy in the
mesh with it.

An https collector is the case that matters. It is valid config for the
variable's other reader -- serverboot's exporter dials with WithInsecure
and never inspects the scheme -- so a cluster that sets it would find the
router refusing to start over an endpoint that works fine for the
router's own spans. No tracing setting is worth the data plane.

Warn and run without Envoy-side tracing instead. setOtlpCollector returns
nothing at all, so no future caller can reintroduce the startup failure,
and it clears any previously configured collector rather than leaving a
stale one behind. Spans are still never downgraded to plaintext, which
was the point of rejecting https in the first place; Envoy simply reports
none.
@JeffLuoo
Jeff Luo (JeffLuoo) force-pushed the fix/kind-otel-endpoint-atenet-router branch from bf1df24 to fead1ed Compare July 31, 2026 16:57
@JeffLuoo
Jeff Luo (JeffLuoo) merged commit a98f85b into agent-substrate:main Jul 31, 2026
11 checks passed
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.

4 participants