Skip to content

Commit 648947e

Browse files
Update CEL documentation to capture type checking errors. (#2984)
* Update CEL documentation to capture type checking errors. Signed-off-by: Whitney Griffith <[email protected]> * address comments Signed-off-by: Whitney Griffith <[email protected]> * accept rewording Signed-off-by: Whitney Griffith <[email protected]> Co-authored-by: Craig Box <[email protected]> * make gen Signed-off-by: Whitney Griffith <[email protected]> --------- Signed-off-by: Whitney Griffith <[email protected]> Co-authored-by: Craig Box <[email protected]>
1 parent 446e4a5 commit 648947e

File tree

5 files changed

+31
-2
lines changed

5 files changed

+31
-2
lines changed

Diff for: envoy/extensions/stackdriver/config/v1alpha1/config.pb.go

+14-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: envoy/extensions/stackdriver/config/v1alpha1/config.proto

+14-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,20 @@ message PluginConfig {
127127

128128
// CEL expression for filtering access logging. If the expression evaluates
129129
// to true, an access log entry will be generated. Otherwise, no access log
130-
// entry will be generated.
130+
// entry will be generated. If there are any type errors, the CEL expression
131+
// is evaluated as false. More details on type checking can be found
132+
// at https://kubernetes.io/docs/reference/using-api/cel/#type-checking.
133+
// A common error is referring to a non-existent field in the log entry.
134+
// It's crucial to note that in Envoy, the fields that appear in access log
135+
// entries can vary. This variation is influenced by several factors,
136+
// including the protocol in use (such as HTTP or TCP), the applied filters,
137+
// and the specific configuration of the Envoy instance. Therefore, when
138+
// using CEL expressions for filtering access logs, it's essential to ensure
139+
// that the expressions accurately refer to existing fields in the log entry.
140+
// The has() macro in CEL may be used in CEL expressions to check if a field
141+
// is accessible before attempting to access the field's value.
142+
// You can also quickly test CEL expressions at the CEL Playground
143+
// at https://playcel.undistro.io/.
131144
// NOTE: Audit logs ignore configured filters.
132145
string access_logging_filter_expression = 17;
133146

Diff for: telemetry/v1alpha1/telemetry.pb.go

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: telemetry/v1alpha1/telemetry.pb.html

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: telemetry/v1alpha1/telemetry.proto

+1
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,7 @@ message AccessLogging {
670670
//
671671
// - `response.code >= 400`
672672
// - `connection.mtls && request.url_path.contains('v1beta3')`
673+
// - `!has(request.useragent) || !(request.useragent.startsWith("Amazon-Route53-Health-Check-Service"))`
673674
string expression = 1;
674675
}
675676

0 commit comments

Comments
 (0)