Skip to content

feat: Name the upstream a request was proxied to in edge logs - #509

Draft
scotwells wants to merge 1 commit into
mainfrom
feat/upstream-attached-to-ref
Draft

scotwells wants to merge 1 commit into
mainfrom
feat/upstream-attached-to-ref

Conversation

@scotwells

Copy link
Copy Markdown
Contributor

Summary

An edge access log shows which point of presence served a request but nothing about the upstream it was proxied to, so debugging a failing response cannot tell which backend it reached.

This carries an optional, consumer-authored reference to whatever a network interface is attached to, such as a compute instance, from the claim through to the Envoy cluster the edge programs, and the networking layer copies its group, kind, and name without interpreting them.

An operator can then read the upstream's group, kind, and name from the access log next to the point of presence that served the request.

Accuracy is per rule for now: a rule resolving to one attached thing logs it, a rule spanning several logs an empty upstream, and per-endpoint accuracy needs an upstream Envoy Gateway change tracked separately.

Test plan

  • The reference projects from a claim onto its bound interface
  • A service whose members agree on one upstream stamps it, and members that disagree stamp nothing
  • The extension server writes the upstream fields into the cluster metadata the log reads
  • Generated schema, lint, and the full test suite pass

🤖 Generated with Claude Code

Edge Envoy access logs record which POP served a request but nothing
about the upstream it was proxied to, so an operator debugging a 503
cannot tell what backend the request reached.

This adds an optional, immutable, consumer-authored attachedTo reference
to NetworkInterfaceClaim, projects it onto the bound NetworkInterface,
and carries it forward through the generated EndpointSlice and into the
Envoy cluster metadata the extension server programs. The reference is
opaque: the networking operator copies apiGroup, kind, and name without
importing any consumer type or branching on a kind.

Key changes:
- add AttachedToRef and attachedTo on the claim and interface specs
- project attachedTo from claim to interface on bind, create, and sync
- set endpoint targetRef and stamp attached-to slice labels only when
  every member of a network service agrees on one reference
- read the slice labels in the extension server policy index and write
  upstream_apigroup, upstream_kind, and upstream_name into the
  datum-gateway cluster filter_metadata

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@scotwells

Copy link
Copy Markdown
Contributor Author

Downstream of this API change:

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.

1 participant