Skip to content

Feat/envoy logs#188

Draft
JoseSzycho wants to merge 4 commits into
feat/http-traffic-meteringfrom
feat/envoy-logs
Draft

Feat/envoy logs#188
JoseSzycho wants to merge 4 commits into
feat/http-traffic-meteringfrom
feat/envoy-logs

Conversation

@JoseSzycho

@JoseSzycho JoseSzycho commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Warning

This PR should not be merged. It has been created to show how we can capture the HTTPRoute usage signals.
Once the corresponding enhamcenete has been approved and merged into main, continue with the work on this PR.

Related to:

Summary

The billing pipeline previously could only attribute usage to a project by its control-plane namespace UID (ns-). This PR surfaces the human-readable project name as a first-class dimension on every billing CloudEvent, enabling clearer cost attribution without post-processing joins.

  • Extension server (xDS mutation): ApplyTPPRouteConfig now calls injectProjectNameMetadata on every NSO-owned route, stamping project_name into filter_metadata["datum-gateway"]["project_name"] on the Envoy route proto at xDS build time. This happens unconditionally — WAF config is an optional overlay on top.
  • Envoy access log format: the EnvoyProxy JSON format is extended with project_name: "%METADATA(ROUTE:datum-gateway:project_name)%", read directly from the xDS route metadata on every request.
  • Vector billing collector: adds a kubernetes_logs source (scoped to envoy-gateway-system) and a project_name extraction in the VRL transform, emitting it as a dimension on all four billing CloudEvents (requests, ingress-bytes, egress-bytes, connection-seconds).
  • E2E test: configures the EnvoyProxy with a File sink only (matching the production datum-downstream-gateway), asserts the project_name dimension in the received CloudEvents.

Notes

  • %METADATA(ROUTE:datum-gateway:project_name)% is used because the project name lives in xDS route metadata injected by the extension server — it is not a per-request value and does not need to travel as a header.

@JoseSzycho JoseSzycho changed the base branch from main to feat/http-traffic-metering June 17, 2026 14:05
@JoseSzycho JoseSzycho marked this pull request as draft June 17, 2026 14:08
…mplement selective WAF policy injection based on configuration.
…etes log tailing via Vector's kubernetes_logs source
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