Skip to content

fix: deduplicate controller dashboard state metrics across replicas - #8

Open
ANAMASGARD wants to merge 1 commit into
kgateway-dev:mainfrom
ANAMASGARD:fix/4-controller-metrics-replica-duplication
Open

ANAMASGARD wants to merge 1 commit into
kgateway-dev:mainfrom
ANAMASGARD:fix/4-controller-metrics-replica-duplication

Conversation

@ANAMASGARD

Copy link
Copy Markdown

Description

Fix controller dashboard counts being multiplied by the number of controller replicas. For example, three replicas reporting nine HTTPRoutes now display 9 instead of 27.

Update managed-resource, XDS snapshot-resource, and routing-domain queries to deduplicate observations with max per logical identity before summing distinct identities. Preserve exported_namespace to prevent undercounting when Prometheus renames conflicting namespace labels. Process-local operation metrics remain additive.

Add local regression tests that evaluate the actual dashboard expressions using promtool.

Fixes #4.

Change Type

/kind fix

Changelog

Fix inflated controller dashboard resource and routing-domain counts when running multiple controller replicas.

Additional Notes

Validation passed:

  • All 12 test methods, covering 50 PromQL result assertions and syntax checks for all 43 dashboard expressions.
  • Prometheus scrape-to-query integration using three simulated controller endpoints and packaged dashboard queries, with both honor_labels modes.
  • Helm lint, default/disabled/custom rendering, chart packaging, and packaged-dashboard integrity.

Deduplication assumes replicas observe the same controller domain. Live kgateway/Grafana deployment testing was not performed.

Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com>
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.

controller metrics are multiplied by replica count

1 participant