Skip to content

feat: display the summary of envoy access logs - #887

Merged
kyasbal merged 1 commit into
GoogleCloudPlatform:mainfrom
K53:push-nrzyyymlptzs
Aug 20, 2026
Merged

kyasbal merged 1 commit into
GoogleCloudPlatform:mainfrom
K53:push-nrzyyymlptzs

Conversation

@K53

@K53 K53 commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Text Envoy log parsing & summary: Added EnvoyAccessLogTextParser to 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/).
  • Common Envoy utilities: Extracted Envoy response flag definitions and summary formatting logic into pkg/core/inspection/logutil/envoy.go to 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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread pkg/core/inspection/logutil/envoy.go Resolved
@K53
K53 force-pushed the push-nrzyyymlptzs branch 2 times, most recently from e692983 to 55738a6 Compare August 17, 2026 07:48
@K53 K53 added the area:backend-parser Log parsers and log timeline mapper tasks label Aug 17, 2026
Comment thread pkg/core/inspection/logutil/envoy.go Outdated
)

// 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread pkg/core/inspection/logutil/envoy.go Outdated
summary := fmt.Sprintf("%d %s %s", statusCode, method, requestURL)
if responseFlags != "" && responseFlags != EnvoyResponseFlagNoError {
flagMessage := FormatEnvoyResponseFlags(responseFlags)
summary = fmt.Sprintf("【%s(%s)】", flagMessage, responseFlags) + summary

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@K53
K53 force-pushed the push-nrzyyymlptzs branch from 55738a6 to d91ce24 Compare August 20, 2026 14:28
@kyasbal
kyasbal added this pull request to the merge queue Aug 20, 2026
Merged via the queue into GoogleCloudPlatform:main with commit 4cbb0c5 Aug 20, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend-parser Log parsers and log timeline mapper tasks

2 participants