@@ -354,6 +354,10 @@ type ProxyTelemetry struct {
354354
355355 // Metrics defines metrics configuration for managed proxies.
356356 Metrics * ProxyMetrics `json:"metrics,omitempty"`
357+
358+ // RequestID configures Envoy request ID behavior.
359+ // +optional
360+ RequestID * RequestIDSettings `json:"requestID,omitempty"`
357361}
358362
359363// EnvoyProxyProviderType defines the types of providers supported by Envoy Proxy.
@@ -369,6 +373,44 @@ const (
369373 EnvoyProxyProviderTypeHost EnvoyProxyProviderType = "Host"
370374)
371375
376+ // RequestIDSettings defines configuration for Envoy's UUID request ID extension.
377+ type RequestIDSettings struct {
378+ // Tracing configures Envoy's behavior for the UUID request ID extension,
379+ // including whether the trace sampling decision is packed into the UUID and
380+ // whether `X-Request-ID` is used for trace sampling decisions.
381+ //
382+ // When omitted, the default behavior is `PackAndSample`, which alters the UUID
383+ // to contain the trace sampling decision and uses `X-Request-ID` for stable
384+ // trace sampling.
385+ //
386+ // +optional
387+ Tracing * RequestIDExtensionAction `json:"tracing,omitempty"`
388+ }
389+
390+ // RequestIDExtensionAction defines how the UUID request ID extension behaves
391+ // with respect to packing the trace reason into the UUID and using the
392+ // request ID for trace sampling decisions.
393+ //
394+ // +kubebuilder:validation:Enum=PackAndSample;Sample;Pack;Disable
395+ type RequestIDExtensionAction string
396+
397+ const (
398+ // PackAndSample enables both behaviors:
399+ // - Alters the UUID to contain the trace sampling decision
400+ // - Uses `X-Request-ID` for trace sampling
401+ RequestIDExtensionActionPackAndSample RequestIDExtensionAction = "PackAndSample"
402+ // Sample uses `X-Request-ID` for trace sampling decisions, but does NOT alter
403+ // the UUID to pack the trace sampling decision.
404+ RequestIDExtensionActionSample RequestIDExtensionAction = "Sample"
405+ // Pack alters the UUID to contain the trace sampling decision, but does NOT
406+ // use `X-Request-ID` for trace sampling decisions.
407+ RequestIDExtensionActionPack RequestIDExtensionAction = "Pack"
408+ // Disable disables both behaviors:
409+ // - Does not alter the UUID
410+ // - Does not use `X-Request-ID` for trace sampling
411+ RequestIDExtensionActionDisable RequestIDExtensionAction = "Disable"
412+ )
413+
372414// EnvoyProxyProvider defines the desired state of a resource provider.
373415// +union
374416type EnvoyProxyProvider struct {
0 commit comments