Repository navigation
feat: display the summary of envoy access logs - #887
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a shared Envoy access log parser and response flag formatter, refactoring duplicate definitions in the CSM traffic log module and integrating the parser into the Kubernetes container log pipeline for 'istio-proxy' containers. Feedback on the changes suggests excluding non-error response flags (such as RFCF and DI) from triggering error-level severity in parseEnvoySeverity, and skipping empty segments during response flag formatting to prevent malformed output.
e692983 to
55738a6
Compare
| ) | ||
|
|
||
| // EnvoyResponseFlag represents standard Envoy response flags. | ||
| // See: https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#config-access-log-format-response-flags |
There was a problem hiding this comment.
Unfortunately the referenced document is no longer including the list of envoy response flags. Could you replace this link to something else as an alternative. (Maybe envoy source?)
| method := fields["method"] | ||
| path := fields["path"] | ||
| protocol := fields["protocol"] | ||
| responseFlags := EnvoyResponseFlag(fields["responseFlags"]) |
There was a problem hiding this comment.
This type cast is invalid.
The response is usually EnvoyResponseFlags but it can contain multiple envoy response flags. It should be just string at this point unless if we haven't split them with comma.
Some fixes would be needed in FormatEnvoySummary and FormatEnvoyResponseFlags regarding this point.
| summary := fmt.Sprintf("%d %s %s", statusCode, method, requestURL) | ||
| if responseFlags != "" && responseFlags != EnvoyResponseFlagNoError { | ||
| flagMessage := FormatEnvoyResponseFlags(responseFlags) | ||
| summary = fmt.Sprintf("【%s(%s)】", flagMessage, responseFlags) + summary |
There was a problem hiding this comment.
I prefer it to be fmt.Spirntf("【%s(%s)】%s", flagMessage, responseFlags, summary)
| Match: func(ctx ContainerLogContext) bool { | ||
| return ctx.ContainerName == "istio-proxy" | ||
| }, | ||
| Parser: logutil.NewEnvoyAccessLogTextParser(), |
There was a problem hiding this comment.
If non supported log format is ingested from a container with istio-proxy, then it would be proiblematic.
Use logutil.NewMultiTextLogParser and logutil.FallbackrawTextLogParser as the fallback.
4cbb0c5
Summary
EnvoyAccessLogTextParserto parse text access logs from container stdout and format them with response flag explanations (e.g.【Upstream connection failure(UF)】503 GET http://10.4.0.5/).pkg/core/inspection/logutil/envoy.goto share across both container logs and CSM Traffic Logs.Motivation
While CSM Traffic Logs already formatted Envoy access logs with human-readable response flags in their summaries, container stdout logs (
istio-proxy) did not parse or format them similarly. We want to align the summary experience of text-based Envoy access logs with CSM Traffic Logs.