Skip to content

Dual-emit assignment vocabulary on header, metrics, and telemetry - #139

Open
scott-rc wants to merge 1 commit into
sc/assignment-redesignfrom
sc/assignment-redesign-2
Open

scott-rc wants to merge 1 commit into
sc/assignment-redesignfrom
sc/assignment-redesign-2

Conversation

@scott-rc

@scott-rc scott-rc commented May 7, 2026

Copy link
Copy Markdown
Contributor

Phase 2 of the assignment-redesign plan. Tenants and dashboards observing Skipper need to migrate from the legacy function vocabulary at their own pace, decoupled from the cluster upgrade.

This PR adds the canonical assignment form on every external-facing surface alongside the legacy form:

  • HTTP header dual-parse. The router accepts either x-skipper-function or x-skipper-assignment; when both are present, the canonical header wins. SetHeader dual-writes both names so receivers on either vocabulary see the body. The outbound header strip in the router's request-forwarding path deletes both before forwarding to the assigned pod.
  • Prometheus dual-label. Every Vec metric carrying function_deployment now also declares assignment_deployment; every WithLabelValues site passes the deployment value twice. Per-series cardinality is unchanged (one extra label key with the same value-set). Dashboards filtering by either name return identical data.
  • OTLP and slog dual-emit. Every site emitting the function identity group via LegacyFunctionKey.Slog/Attr now also emits the assignment group with identical contents. The captured-attrs golden in internal/key/testdata/keys.golden regenerated to assert both vocabularies appear on the same emission.
  • Fixture assign endpoint dual-parses for tenant-pod migration parity.

The cleanup plan removes the legacy half after one full deploy plus a documented deprecation window. Stacked on top of #138 (Phase 1: type rename + K8s annotation dual-write).

Test plan

  • dev test ./... -- 1227 tests pass
  • dev lint clean
  • dev kube-lint clean
  • Hot-path benchmarks unchanged within noise (AssignmentFromHeader cache-hit at ~114 ns, rewriteRequestHeaders at ~280 ns)

Plan: tmp/assignment-redesign/plan.md

Tenants and dashboards observing Skipper need to migrate from the legacy
"function" vocabulary at their own pace. Add the new "assignment" form on
every external-facing surface alongside the legacy form so rolling deploys
and dashboard migration stay decoupled from the cluster upgrade.

The router accepts either x-skipper-function or x-skipper-assignment;
when both are present the canonical header wins. SetHeader dual-writes
both names so receivers on either vocabulary see the body. The outbound
header strip removes both before forwarding to the assigned pod.

Each Vec metric carrying function_deployment now also declares
assignment_deployment; every WithLabelValues site passes the deployment
twice. Per-series cardinality is unchanged. Every site emitting the
function identity group via slog or OTLP now also emits the assignment
group with identical contents. The keys.golden capture asserts both
vocabularies appear on the same emission.

The cleanup plan removes the legacy half after one full deploy plus a
documented deprecation window.
@scott-rc

scott-rc commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

This branch has not been deployed

No deployments
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