Skip to content

Fix GKE API autoscaling metrics discovery - #126

Open
Alex R (alexr17) wants to merge 1 commit into
mainfrom
alexr/gke-api-metrics-named-port
Open

Alex R (alexr17) wants to merge 1 commit into
mainfrom
alexr/gke-api-metrics-named-port

Conversation

@alexr17

@alexr17 Alex R (alexr17) commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Why autoscaling broke: #104 added the wait-for-brainstore init container, enabled by default. Because the metric endpoint used a numeric port, GKE attributed the API's metrics to that init container, so the HPA had no API metrics to scale on.

With a numeric endpoint, GKE's pod discovery can attribute API metrics to a completed init container, leaving the HPA without usable event-loop metrics.
Declare api-metrics on the API container and reference that name in AutoscalingMetric, so GKE keeps only that port's discovery target.

Configuration Expected behavior
GKE autoscaling enabled; default or custom port Named endpoint resolves the configured API metrics port
Default, ingest, background, or renamed pool Each metric definition selects its pool's API port
Startup gate enabled or disabled; sidecar present API gauges retain the API container identity
Autoscaling disabled on AWS, Azure, or GKE No autoscaling metric definition or additional metrics port
Autoscaling enabled on AWS or Azure Existing unsupported-provider validation applies
Release/custom image tags; reused or partial values No new values or image-version checks
Local collector autoscaling-0.2.2-gke.0 Gauge container Port metadata
Numeric endpoint + completed startup gate wait-for-brainstore Missing
Named endpoint + completed startup gate + sidecar api 8001
Named endpoint + sidecar api 8001

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T22:53:35.125764Z ad1b845 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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