Skip to content

feat(controlplane): support HPA controller logs parsing and timeline mapping - #932

Merged
kyasbal merged 3 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-qvtnmnmplvun
Sep 1, 2026
Merged

kyasbal merged 3 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-qvtnmnmplvun

Conversation

@kyasbal

@kyasbal kyasbal commented Sep 1, 2026

Copy link
Copy Markdown
Member

Summary

Add support for parsing GKE HPA controller logs (atomicRecommendation and finalRecommendation), generating readable tag-style summaries ([HPA Final], [HPA Metric]), and mapping logs to the appropriate timelines.

Changes

  • Log Field Extraction: Added extraction of atomicRecommendation and finalRecommendation structures from jsonPayload.
  • Summary Generation:
    • [HPA Final] <namespace>/<hpa>: <targetRef> <from> -> <to> replicas (or = <replicas> replicas when maintained).
    • [HPA Metric] <namespace>/<hpa>: <metricName> (<current> / target <target>) -> <replicas> replicas.
  • Timeline Mapping:
    • Control plane component timeline: controlplanes/hpa-controller
    • HPA resource timeline: autoscaling/v2/horizontalpodautoscaler/<namespace>/<name>
    • Target workload timeline (when targetRef has valid apiVersion): <targetAPIVersion>/<kind>/<namespace>/<name>
  • Tests: Added comprehensive unit tests in contract and impl packages covering field extraction, summary formatting, log ingestion, and timeline mapping.

@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 support for processing and visualizing Kubernetes Horizontal Pod Autoscaler (HPA) controller logs. It adds HPA-specific log extraction, log filtering, grouping, and timeline mapping tasks, allowing HPA recommendations (both atomic and final) to be mapped to resource timelines. The feedback suggests improving the extraction of utilization metrics by using -1 as a sentinel value to correctly distinguish between unpopulated fields and valid 0% utilization values, updating the corresponding tests, and optimizing log ingestion by checking the component type before attempting to extract HPA-specific fields.

…mapping

Add parsing for GKE HPA controller logs (atomicRecommendation and finalRecommendation), generate tag-style summaries ([HPA Final], [HPA Metric]), and map logs to the HPA resource timeline, target workload timeline, and control plane component timeline.
@kyasbal
kyasbal merged commit 7ee3c14 into GoogleCloudPlatform:main Sep 1, 2026
16 checks passed
@kyasbal
kyasbal deleted the push-qvtnmnmplvun branch September 1, 2026 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant