@@ -156,9 +156,20 @@ spec:
156156 accessLog :
157157 settings :
158158 - sinks :
159+ # File sink: the test still scrapes stdout to derive the
160+ # expected metric values (bytes, duration, project_name).
159161 - type : File
160162 file :
161163 path : /dev/stdout
164+ # OpenTelemetry sink: Envoy pushes the access log to the
165+ # node-local Vector agent automatically, exercising the
166+ # real production ingestion path (no manual forwarding).
167+ - type : OpenTelemetry
168+ openTelemetry :
169+ host : billing-usage-collector-vector.billing-system.svc.cluster.local
170+ port : 4317
171+ resources :
172+ service.name : nso-httproute-signals
162173 format :
163174 type : JSON
164175 json :
@@ -534,26 +545,31 @@ spec:
534545 curl -kvf -H \"Host: ${PRIMARY_HOSTNAME}\" -d 'hello world' http://\${GATEWAY_SERVICE_NAME}.\${GATEWAY_SERVICE_NAMESPACE}.svc.cluster.local/delay/2; \
535546 "
536547
537- # Verify Vector processes it and check exact counts
548+ # Verify Vector emitted the CloudEvents. Envoy pushed the access log to
549+ # Vector automatically via its OpenTelemetry sink when the request above
550+ # was served, so this step only derives the expected values and polls the
551+ # mock billing gateway for the result.
538552 - script :
539553 timeout : 45s
540554 cluster : nso-infra
541555 env :
542556 - name : DOWNSTREAM_NAMESPACE
543557 value : ($downstreamNamespaceName)
544- - name : STANDARD_NAMESPACE
545- value : ($namespace)
546558 content : |
547559 # =====================================================================
548560 # Validates the full HTTP metering pipeline, end to end:
549561 #
550- # Envoy access log --(raw POST )--> Vector /logs source
562+ # Envoy access log --(OTLP push )--> Vector opentelemetry source
551563 # | |
552- # | (one JSON line per request) | (VRL transform fans the
553- # | | single log line out into
564+ # | (also written to stdout for | (VRL transform fans the
565+ # | capturing expected values) | log record out into
554566 # v v CloudEvents)
555567 # captured here (STEP 1-2) mock-billing-gateway (STEP 4)
556568 #
569+ # Envoy pushes the access log to Vector automatically (OpenTelemetry
570+ # sink on custom-proxy-config -> billing-usage-collector-vector:4317)
571+ # when the request is served -- the test does NOT forward it manually.
572+ #
557573 # A single access log line is expected to produce FOUR CloudEvents,
558574 # one per usage dimension, all sharing the same subject
559575 # ("projects/<project-control-plane-namespace-uid>"):
@@ -605,13 +621,12 @@ spec:
605621 echo " - Duration ms (expected): $DURATION_MS ($EXPECTED_DURATION seconds)"
606622 echo " - Project name (expected): $PROJECT_NAME"
607623
608- # --- STEP 3: feed the raw access log into Vector --------------------
609- # POST the exact captured line to Vector's http_server /logs source.
610- # Vector's VRL transform parses it and emits the four CloudEvents to
611- # the mock-billing-gateway sink.
612- kubectl -n $STANDARD_NAMESPACE exec -i test-pod -- sh -c " \
613- curl -v -X POST -H 'Content-Type: application/json' -d '$ENVOY_LOG' http://billing-usage-collector-vector.billing-system.svc.cluster.local:9881/logs \
614- "
624+ # --- STEP 3: (no manual forwarding) --------------------------------
625+ # The request above already caused Envoy to push this access log to
626+ # Vector automatically via its OpenTelemetry sink (custom-proxy-config
627+ # -> billing-usage-collector-vector:4317). Vector's VRL transform
628+ # parses it and emits the four CloudEvents to the mock-billing-gateway
629+ # sink, so there is nothing to POST here -- we just poll for the result.
615630
616631 # --- STEP 4: verify the CloudEvents the mock billing gateway received
617632 # Poll the mock gateway's request log (Vector may take a moment to
0 commit comments