Skip to content

Introduce a readiness endpoint that tracks metric stabilization - #46

Open
mraerino wants to merge 4 commits into
developfrom
readiness-stabilized
Open

Introduce a readiness endpoint that tracks metric stabilization#46
mraerino wants to merge 4 commits into
developfrom
readiness-stabilized

Conversation

@mraerino

Copy link
Copy Markdown
Member

Description

ref https://linear.app/supabase/issue/NET-510/cloudflare-exporter-delay-new-pod-readiness-until-metrics-stabilize

Adds a readiness HTTP endpoint that can be used in a readiness probe to keep the old pod around until the new pod has stabilized its push metrics

@mraerino mraerino self-assigned this Aug 13, 2026
@mraerino
mraerino requested a review from a team as a code owner August 13, 2026 15:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds an HTTP readiness endpoint intended for Kubernetes readiness probes, so a new pod can be held “not ready” until the VictoriaMetrics push-based (converge) metric pipelines have stabilized.

Changes:

  • Introduces readinessTracker and a /ready JSON endpoint that returns 200 only after required components have stabilized.
  • Wires converge runners to notify readiness once stabilization occurs.
  • Enables an optional Helm readinessProbe (default enabled) that probes GET /ready, and adds a basic HTTP test for the new endpoint.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/basic_tests.yml Adds a basic HTTP check for /ready.
readiness.go Implements readiness tracking and an HTTP handler emitting JSON readiness state.
readiness_test.go Unit tests for readiness tracking stickiness/idempotency.
main.go Instantiates readiness tracker, exposes /ready, and passes tracker into converge setup.
converge.go Adds a stability notifier into converge setup and forwards it to converge.Run.
charts/cloudflare-exporter/values.yaml Adds configurable readinessProbe values and docs.
charts/cloudflare-exporter/templates/deployment.yaml Conditionally renders a container readinessProbe for /ready.
charts/cloudflare-exporter/Chart.yaml Bumps chart version to 0.2.3.
Suppressed comments (1)

main.go:288

  • The TODO comment here becomes unnecessary (and the current "todo" prefix may be flagged by comment/style linters). If readiness gating is driven solely by whether vm_push_endpoint is configured, this can be expressed without the TODO block.
	// todo: this is a bad way to check for intended push failure
	// ideally converge setup wouldn't be attempted with this option empty
	if viper.GetString(argVMPushEndpoint) != "" {

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread converge.go
Comment thread main.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread main.go
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.

3 participants