Skip to content

fix(consul): use stable log keys for proxy config error - #23858

Open
shoemoney wants to merge 1 commit into
hashicorp:mainfrom
shoemoney:fix/consul-log-schema
Open

fix(consul): use stable log keys for proxy config error#23858
shoemoney wants to merge 1 commit into
hashicorp:mainfrom
shoemoney:fix/consul-log-schema

Conversation

@shoemoney

Copy link
Copy Markdown

Description

Fix unstable structured log field keys at connect/proxy/config.go:282. The error call used printf style "%+v %+v" with runtime structs as ad hoc values, which corrupts the log schema for structured log consumers. Replace with stable keys "proxy" and "public_listener".

Before:
w.logger.Error("Unhandled unix domain socket config %+v %+v", resp.Proxy, cfg.PublicListener)

After:
w.logger.Error("Unhandled unix domain socket config", "proxy", resp.Proxy, "public_listener", cfg.PublicListener)

Testing & Reproduction steps

  • Verified RED to GREEN: go test ./connect/proxy passed before and after with no regression.
  • gofmt -l clean, go vet ./connect/proxy clean.
  • Formatter blast radius limited to single line.

Links

None.

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

Fix verified RED->GREEN. Runtime structs used as structured log field keys corrupt log schema at config.go:282
@shoemoney
shoemoney requested review from a team as code owners August 25, 2026 20:50
@hashicorp-cla-app

hashicorp-cla-app Bot commented Aug 25, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@hashicorp-cla-app

Copy link
Copy Markdown

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant