attribute: document lowercased keys in headers (#2974)

* document keys

Signed-off-by: Kuat Yessenov <kuat@google.com>

* spelling

Signed-off-by: Kuat Yessenov <kuat@google.com>
This commit is contained in:
Kuat 2018-12-14 16:36:39 -08:00 committed by Frank Budinsky
parent 79cd5ced44
commit 9f98ee9afd
2 changed files with 5 additions and 4 deletions

View File

@ -46,7 +46,7 @@ deployments will have agents (Envoy or Mixer adapters) that produce these attrib
| `destination.service.uid` | string | Unique identifier of the destination service. | `istio://istio-system/services/istio-telemetry` |
| `destination.service.name` | string | Destination service name. | `istio-telemetry` |
| `destination.service.namespace` | string | Destination service namespace. | `istio-system` |
| `request.headers` | map[string, string] | HTTP request headers. For gRPC, its metadata will be here. | |
| `request.headers` | map[string, string] | HTTP request headers with lowercase keys. For gRPC, its metadata will be here. | |
| `request.id` | string | An ID for the request with statistically low probability of collision. | |
| `request.path` | string | The HTTP URL path including query string | |
| `request.url_path` | string | The path part of HTTP URL, with query string being stripped | |
@ -60,7 +60,7 @@ deployments will have agents (Envoy or Mixer adapters) that produce these attrib
| `request.total_size` | int64 | Total size of HTTP request in bytes, including request headers, body and trailers. | |
| `request.time` | timestamp | The timestamp when the destination receives the request. This should be equivalent to Firebase "now". | |
| `request.useragent` | string | The HTTP User-Agent header. | |
| `response.headers` | map[string, string] | HTTP response headers. | |
| `response.headers` | map[string, string] | HTTP response headers with lowercase keys. | |
| `response.size` | int64 | Size of the response body in bytes | |
| `response.total_size` | int64 | Total size of HTTP response in bytes, including response headers and body. | |
| `response.time` | timestamp | The timestamp when the destination produced the response. | |

View File

@ -27,7 +27,7 @@ CEXL supports the following functions.
|`!=` |Not Equals |`request.auth.principal != "admin"`
|<code>&#124;&#124;</code> |Logical OR | `(request.size == 200)` <code>&#124;&#124;</code> `(request.auth.principal == "admin")`
|`&&` |Logical AND | `(request.size == 200) && (request.auth.principal == "admin")`
|`[ ]` |Map Access | `request.headers["x-id"]`
|`[ ]` |Map Access | `request.headers["x-request-id"]`
|`+` |Add | `request.host + request.path`
|<code>&#124;</code> |First non empty | `source.labels["app"]` <code>&#124;</code> `source.labels["svc"]` <code>&#124;</code> `"unknown"`
|`match` | Glob match |`match(destination.service, "*.ns1.svc.cluster.local")` | Matches prefix or suffix based on the location of `*`
@ -41,6 +41,7 @@ CEXL supports the following functions.
|`.endsWith` | string postfix match | `destination.service.endsWith("acme")` | Checks whether `destination.service` ends with `"acme"`.
|`emptyStringMap` | Create an empty string map | `request.headers` <code>&#124;</code> `emptyStringMap()`| Use `emptyStringMap` to create an empty string map for default value of `request.headers`.
|`conditional` | Simulate ternary operator | `conditional((context.reporter.kind` <code>&#124;</code> `"inbound") == "outbound", "client", "server")` | Returns `"client"` if report kind is `outbound` otherwise returns `"server"`.
|`toLower` | Convert a string to lowercase letters | `toLower("User-Agent")` | Returns `"user-agent"`.
## Type checking
@ -62,7 +63,7 @@ For example, the expression `request.auth.principal == "user1"` fails evaluation
|Expression |Return Type |Description|
|-----------|------------|-----------|
|`request.size` <code>&#124; 200</code> | **int** | `request.size` if available, otherwise 200.
|`request.headers["X-FORWARDED-HOST"] == "myhost"`| **boolean**
|`request.headers["x-forwarded-host"] == "myhost"`| **boolean**
|`(request.headers["x-user-group"] == "admin")` <code>&#124;&#124;</code> `(request.auth.principal == "admin")`| **boolean**| True if the user is admin or in the admin group.
|`(request.auth.principal` <code>&#124;</code> `"nobody" ) == "user1"` | **boolean** | True if `request.auth.principal` is "user1", The expression will not error out if `request.auth.principal` is missing.
|`source.labels["app"]=="reviews" && source.labels["version"]=="v3"`| **boolean** | True if app label is reviews and version label is v3, false otherwise.