feat: json logging format #3137
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.47) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 274 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.336
Real PR Conversation Timeline
1 comments
"Review active on #3137"
general
weight: 0.35
CatherineF-dev
<!-- Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://git.k8s.io/community/contributors/guide/pull-requests.md#the-pull-request-submit-process and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide
2. If you want faster PR reviews, read how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews
3. Follow the instructions for writing a release note: https://git.k8s.io/community/contributors/guide/pull-requests.md#write-release-notes-if-needed
4. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
-->
<!-- markdownlint-disable-next-line MD041 -->
What this PR does / why we need it:
Adds a
--logging-formatflag (textdefault,json) so log aggregators can parse kube-state-metrics output as structured JSON. Uses component-base's JSON logger, same flag name as kubelet/kube-apiserver. Existing klog flags (-v,--log_dir, ...) keep working;-vis carried over in JSON mode. Also migrates remainingklog.Warning/Infolncalls to structuredInfoS.<!-- If you are adding a new metric, provide the use case of that metric. -->
How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)
Which issue(s) this PR fixes: (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged)Fixes #1485
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Added a
--logging-formatoption supporting text (the default) and JSON output. Selecting a format preserves the configured verbosity.Updates
Expanded command-line documentation to describe the logging format option.
Updated operational messages to use structured logging. Probe failures and ignored configuration-file errors are now reported at info level.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->