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 <whgriffi@microsoft.com> * address comments Signed-off-by: Whitney Griffith <whgriffi@microsoft.com> * accept rewording Signed-off-by: Whitney Griffith <whgriffi@microsoft.com> Co-authored-by: Craig Box <craig.box@gmail.com> * make gen Signed-off-by: Whitney Griffith <whgriffi@microsoft.com> --------- Signed-off-by: Whitney Griffith <whgriffi@microsoft.com> Co-authored-by: Craig Box <craig.box@gmail.com>
1 parent 446e4a5 commit 648947e

File tree

5 files changed

+31
-2
lines changed

5 files changed

+31
-2
lines changed

envoy/extensions/stackdriver/config/v1alpha1/config.pb.go

Lines changed: 14 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

envoy/extensions/stackdriver/config/v1alpha1/config.proto

Lines changed: 14 additions & 1 deletion
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

telemetry/v1alpha1/telemetry.pb.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

telemetry/v1alpha1/telemetry.pb.html

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

telemetry/v1alpha1/telemetry.proto

Lines changed: 1 addition & 0 deletions
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)