linkerd2-proxy/linkerd
Eliza Weisman de97063b50
trace: never log access log spans to stdout (#2244)
Currently, `tracing` spans are used to record HTTP access log entries.
These spans are recorded at the `INFO` level, in order to allow the use
of fast-path filtering for the more verbose `DEBUG` and `TRACE` levels
when running with the default tracing filter configuration
(`linkerd=info`) --- if no events will ever be enabled at a given level,
`tracing` can skip them more efficiently than when events with some
targets are enabled at that level. The access log spans are recorded
with a separate `_access_log` target, so that the default `linkerd=info`
filter does not enable them.

However, when running with a custom filter configuration that enables
`info` for all targets, the access log spans will be enabled even if
access logging is disabled. This means that these spans will be recorded
when they may not be needed to generate an access log. They also make
logs significantly more verbose when `DEBUG` events are enabled (only
debug and higher events will occur in these spans), which can make the
logs harder to parse.

This branch changes the per-layer filter used by the stdout logging
layer to explicitly disable the `_access_log` trace target, regardless
of the rest of the filter configuration. This way, a custom filter
configuration that globally enables the `INFO` level will not enable the
access log spans, and the spans will not be included in stdout logs even
if access logging is enabled. Since the layer that actually generates
the access log has its own, separate per-layer filter, the access log
spans will still be enabled _for that layer_, if and only if access
logging is actually enabled.

A potential longer-term solution is to rewrite the access logging code
to not use `tracing`, as was originally proposed. At the time, we opted
to use `tracing` to generate the access log because it seemed desirable
to have a single set of diagnostics that can generate different outputs.
However, in practice, it's probably better to keep general-purpose
debugging logs and access logging separate, as they are separate
concerns. A purpose-built implementation of access logging could avoid
issues like this one, and would also probably be more efficient --- it
wouldn't need to allocate strings to represent access log spans, and
could instead just store structured data that's formatted directly to
the output. But, the filtering change solves the immediate problem.
2023-02-17 13:25:28 -08:00
..
addr Make NameAddr cheaper to clone (#2121) 2023-01-04 19:20:27 -08:00
app gateway: Fix URI form for gatewayed HTTP/1 requests (#2241) 2023-02-17 11:01:18 -08:00
conditional ci: change how warnings are denied on CI (#1662) 2022-05-16 15:58:50 -07:00
detect Use a cascading stack with protocol detection (#2221) 2023-02-13 12:45:05 -08:00
distribute Implement `Hash` for configuration types (#2135) 2023-01-06 14:19:19 -08:00
dns build(deps): bump trust-dns-resolver from 0.21.2 to 0.22.0 (#1925) 2022-09-09 11:53:45 -07:00
duplex ci: change how warnings are denied on CI (#1662) 2022-05-16 15:58:50 -07:00
errno dev: Update dev tooling (#1820) 2022-07-11 09:51:58 -07:00
error ci: change how warnings are denied on CI (#1662) 2022-05-16 15:58:50 -07:00
error-respond ci: change how warnings are denied on CI (#1662) 2022-05-16 15:58:50 -07:00
exp-backoff ci: change how warnings are denied on CI (#1662) 2022-05-16 15:58:50 -07:00
http-access-log ci: change how warnings are denied on CI (#1662) 2022-05-16 15:58:50 -07:00
http-box outbound: Lint stack target types (#2226) 2023-02-13 20:03:00 -08:00
http-classify ci: change how warnings are denied on CI (#1662) 2022-05-16 15:58:50 -07:00
http-metrics Update to Rust 1.63 (#1900) 2022-08-17 16:26:48 -07:00
http-retry retry gRPC requests are immediately terminated by trailers (#1706) 2022-06-22 15:08:21 -07:00
http-route Update `linkerd2-proxy-api` to v0.8.0 (#2223) 2023-02-13 17:25:44 -08:00
identity ci: change how warnings are denied on CI (#1662) 2022-05-16 15:58:50 -07:00
idle-cache Cache discovery results independently of proxy stacks (#2195) 2023-01-30 13:11:26 -08:00
io dev: Update to dev:v32 with Rust 1.64 (#1961) 2022-10-21 10:21:12 -07:00
meshtls Add the `meshtls-boring-fips` feature flag (#2168) 2023-01-24 12:11:19 -08:00
metrics Make all comment delimeters uniform (#2120) 2023-01-04 19:00:18 -08:00
opencensus chore: update `tonic`, `prost`, and `proxy-api` (#1868) 2022-08-05 10:00:40 -07:00
proxy gateway: Fix URI form for gatewayed HTTP/1 requests (#2241) 2023-02-17 11:01:18 -08:00
reconnect ci: change how warnings are denied on CI (#1662) 2022-05-16 15:58:50 -07:00
retry retry gRPC requests are immediately terminated by trailers (#1706) 2022-06-22 15:08:21 -07:00
router Support router-scoped caches (#2128) 2023-01-06 12:28:15 -08:00
service-profiles Update `linkerd2-proxy-api` to v0.8.0 (#2223) 2023-02-13 17:25:44 -08:00
signal ci: change how warnings are denied on CI (#1662) 2022-05-16 15:58:50 -07:00
stack outbound: Lint stack target types (#2226) 2023-02-13 20:03:00 -08:00
system ci: change how warnings are denied on CI (#1662) 2022-05-16 15:58:50 -07:00
tls Update to Rust 1.63 (#1900) 2022-08-17 16:26:48 -07:00
tonic-watch stack: Unify AnnotateError and MapErr (#2180) 2023-01-23 17:05:48 -08:00
trace-context Add traceparent header parsing for w3c tracecontext (#2179) 2023-02-09 10:07:43 +00:00
tracing trace: never log access log spans to stdout (#2244) 2023-02-17 13:25:28 -08:00
transport-header build(deps): bump prost-build from 0.11.3 to 0.11.4 (#2063) 2022-12-12 13:28:14 -08:00
transport-metrics Update to Rust 1.63 (#1900) 2022-08-17 16:26:48 -07:00