-
Notifications
You must be signed in to change notification settings - Fork 20
docs: enhance access log fields with comprehensive Envoy field documentation #1898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
desimone
wants to merge
1
commit into
main
Choose a base branch
from
desimone/1605-envoy-access-log-fields
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,22 @@ access_log_fields: | |
ACCESS_LOG_FIELDS=headers.user-agent,headers.content-type | ||
``` | ||
|
||
**Extended Envoy fields example:** | ||
|
||
```yaml | ||
access_log_fields: | ||
- authority | ||
- path | ||
- response-code | ||
- protocol | ||
- upstream-response-time | ||
- response-flags | ||
``` | ||
|
||
```bash | ||
ACCESS_LOG_FIELDS=authority,path,response-code,protocol,upstream-response-time,response-flags | ||
``` | ||
|
||
</TabItem> | ||
<TabItem label="Enterprise" value="Enterprise"> | ||
|
||
|
@@ -79,20 +95,34 @@ accessLogFields: | |
- path | ||
``` | ||
|
||
**Custom headers example** | ||
**Custom headers example:** | ||
|
||
```yaml | ||
accessLogFields: | ||
- headers.user-agent | ||
- headers.content-type | ||
``` | ||
|
||
**Extended Envoy fields example:** | ||
|
||
```yaml | ||
accessLogFields: | ||
- authority | ||
- path | ||
- response-code | ||
- protocol | ||
- upstream-response-time | ||
- response-flags | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
## Access log fields and defaults | ||
|
||
The table below lists all available access log fields: | ||
The table below lists all available access log fields. These fields are powered by Envoy's access logging capabilities and can be customized to include only the information you need. | ||
|
||
### Standard Fields | ||
|
||
| **Field name** | **Description** | **Default field** | | ||
| :-- | :-- | :-- | | ||
|
@@ -110,6 +140,34 @@ The table below lists all available access log fields: | |
| `upstream-cluster` | The cluster the request was sent to (the cluster name is assigned by Pomerium, for example `route-3bb74f76f9d71f9c` or `pomerium-control-plane-http`) | Yes | | ||
| `user-agent` | The User-Agent field sent by the user's browser | Yes | | ||
| `query` | The HTTP request query (for example, `?test=one&other=13`) | No | | ||
|
||
### Extended Envoy Fields | ||
|
||
These additional fields are available through Envoy's access logging system: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this mean? None of these are in the list of access log fields we support. |
||
|
||
| **Field name** | **Description** | **Default field** | | ||
| :-- | :-- | :-- | | ||
| `bytes-received` | Total bytes received by Envoy from the downstream client | No | | ||
| `bytes-sent` | Total bytes sent by Envoy to the downstream client | No | | ||
| `connection-termination-details` | Connection termination details as set by Envoy (see [Envoy docs](https://www.envoyproxy.io/docs/envoy/latest/api-v3/data/accesslog/v3/accesslog.proto#data-accesslog-v3-connectionproperties)) | No | | ||
| `downstream-local-address` | Local address of the downstream connection | No | | ||
| `downstream-remote-address` | Remote address of the downstream connection | No | | ||
| `protocol` | HTTP protocol version (HTTP/1.1, HTTP/2, etc.) | No | | ||
| `request-duration` | Time spent receiving the request from the downstream client in milliseconds | No | | ||
| `response-duration` | Time spent sending the response to the downstream client in milliseconds | No | | ||
| `response-flags` | Additional details about the response or connection as set by Envoy (see [Envoy docs](https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#config-access-log-format-response-flags)) | No | | ||
| `route-name` | Name of the route that matched the request | No | | ||
| `start-time` | Request start time including milliseconds | No | | ||
| `upstream-host` | The upstream host that handled the request | No | | ||
| `upstream-local-address` | Local address of the upstream connection | No | | ||
| `upstream-remote-address` | Remote address of the upstream connection | No | | ||
| `upstream-request-attempt-count` | Number of times the request was attempted upstream | No | | ||
| `upstream-response-time` | Time spent waiting for the upstream response in milliseconds | No | | ||
|
||
### Custom Fields | ||
|
||
| **Field name** | **Description** | **Default field** | | ||
| :-- | :-- | :-- | | ||
| [`headers.{CustomHeaderName}`](#log-custom-headers-fields) | An HTTP Request Header identified by the `HeaderName` (for example, `headers.X-Amzn-Trace-Id` might return `Root=1-64c03960-37809588421513e42f260f56`) | No | | ||
|
||
:::danger | ||
|
@@ -118,6 +176,42 @@ Query parameters often contain sensitive information. Do not enable the `query` | |
|
||
::: | ||
|
||
## Using Extended Envoy Fields | ||
|
||
The extended Envoy fields provide additional insights into request processing and can be useful for: | ||
|
||
- **Performance monitoring**: Use `request-duration`, `response-duration`, and `upstream-response-time` to identify slow requests | ||
- **Debugging connectivity**: Use `downstream-local-address`, `upstream-host`, and `response-flags` to troubleshoot connection issues | ||
- **Protocol analysis**: Use `protocol` to monitor HTTP version usage across your applications | ||
- **Load balancing**: Use `upstream-request-attempt-count` and `route-name` to understand request routing patterns | ||
|
||
### Example with extended fields | ||
|
||
When using extended Envoy fields, your access logs might look like this: | ||
|
||
```json | ||
{ | ||
"level": "info", | ||
"service": "envoy", | ||
"authority": "verify.pomerium.com", | ||
"path": "/api/status", | ||
"response-code": 200, | ||
"protocol": "HTTP/2", | ||
"upstream-response-time": 45, | ||
"response-flags": "-", | ||
"route-name": "verify-route", | ||
"upstream-host": "10.0.1.15:8080", | ||
"time": "2023-08-04T12:15:30-04:00", | ||
"message": "http-request" | ||
} | ||
``` | ||
|
||
:::tip Performance optimization | ||
|
||
Use the timing fields (`request-duration`, `response-duration`, `upstream-response-time`) to identify performance bottlenecks in your application stack. | ||
|
||
::: | ||
|
||
## Access log behavior | ||
|
||
### Find access logs | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think these fields are currently supported: