Skip to content

Commit

Permalink
Update CEL documentation to capture type checking errors. (#2984)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
whitneygriffith and craigbox authored Nov 15, 2023
1 parent 446e4a5 commit 648947e
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
15 changes: 14 additions & 1 deletion envoy/extensions/stackdriver/config/v1alpha1/config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion envoy/extensions/stackdriver/config/v1alpha1/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,20 @@ message PluginConfig {

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

Expand Down
1 change: 1 addition & 0 deletions telemetry/v1alpha1/telemetry.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions telemetry/v1alpha1/telemetry.pb.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions telemetry/v1alpha1/telemetry.proto
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ message AccessLogging {
//
// - `response.code >= 400`
// - `connection.mtls && request.url_path.contains('v1beta3')`
// - `!has(request.useragent) || !(request.useragent.startsWith("Amazon-Route53-Health-Check-Service"))`
string expression = 1;
}

Expand Down

0 comments on commit 648947e

Please sign in to comment.