improve(go.d/proxysql): add hostgroup summary metrics#21549
Merged
ilyam8 merged 2 commits intonetdata:masterfrom Jan 13, 2026
Merged
improve(go.d/proxysql): add hostgroup summary metrics#21549ilyam8 merged 2 commits intonetdata:masterfrom
ilyam8 merged 2 commits intonetdata:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the ProxySQL collector by adding hostgroup-level summary metrics to provide better visibility into backend server groupings and their health status.
Changes:
- Added per-hostgroup metrics showing counts of backends in each status (ONLINE, SHUNNED, OFFLINE_SOFT, OFFLINE_HARD)
- Added hostgroup label to all backend charts for improved filtering and grouping
- Implemented dynamic hostgroup chart management using a cache-based approach
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| metadata.yaml | Defines new hostgroup metric schema and adds hostgroup label to backend metrics |
| cache.go | Introduces hostgroupCache struct and management methods for tracking hostgroups |
| collector.go | Initializes the hostgroups cache map in the collector constructor |
| collect.go | Implements logic to count backends per hostgroup by status and manages hostgroup chart lifecycle |
| charts.go | Adds hostgroup chart templates and chart creation/removal methods; updates backend charts to include hostgroup label |
| collector_test.go | Adds comprehensive test expectations for the new hostgroup metrics and validates chart-metric alignment |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
1 issue found across 6 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="src/go/plugin/go.d/collector/proxysql/charts.go">
<violation number="1" location="src/go/plugin/go.d/collector/proxysql/charts.go:654">
P2: `removeHostgroupCharts` matches hostgroups by a prefix that is missing the trailing `_`, so removing hostgroup `1` will also delete charts for hostgroup `10` and any other ID sharing that prefix.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
stelfrag
approved these changes
Jan 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR:
hostgroupas a label to all backend charts for better grouping and filteringTest Plan
Additional Information
For users: How does this change affect me?
Summary by cubic
Adds hostgroup-level summary metrics to the ProxySQL collector and labels all backend charts with hostgroup for easier grouping and filtering. Also exposes per-hostgroup counts of backends by status and manages charts dynamically as hostgroups change.
Written for commit 2974dcd. Summary will update on new commits.