improve(go.d/sql): add per-query execution time charts#21313
Merged
ilyam8 merged 1 commit intonetdata:masterfrom Nov 17, 2025
Merged
improve(go.d/sql): add per-query execution time charts#21313ilyam8 merged 1 commit intonetdata:masterfrom
ilyam8 merged 1 commit intonetdata:masterfrom
Conversation
05b41f2 to
1bc9ca0
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds per-query execution time charts to the SQL collector, enabling users to monitor the performance characteristics of their database queries. Each SQL query now exposes its own timing metric measured in milliseconds.
- Adds timing metric collection for both reusable queries and metric-block inline queries
- Introduces dedicated query timing charts with driver and query_id labels
- Refactors type and function names for better consistency and encapsulation
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/go/plugin/go.d/collector/sql/query.go | Renamed QueryRowsCache to unexported queryRowsCache for better encapsulation; removed unnecessary zero-duration assignment for query references |
| src/go/plugin/go.d/collector/sql/collect.go | Added collectQueryTimingMetrics function to collect and expose query execution times; updated openConnection to accept context parameter; renamed chart building functions for clarity |
| src/go/plugin/go.d/collector/sql/charts.go | Added createQueryTimingChart function to create per-query timing charts; updated priority constants and chart labels to include driver information |
| src/go/plugin/go.d/collector/sql/collector.go | Removed unused skipValues field from Collector struct |
| src/go/plugin/go.d/collector/sql/metadata.yaml | Fixed malformed markdown link by removing extra opening parenthesis in DSN parameter documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
stelfrag
approved these changes
Nov 17, 2025
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 adds query execution time charts to the generic SQL collector.
Every SQL query now exposes its own timing metric so users can understand the performance characteristics of their database queries.
Test Plan
Additional Information
For users: How does this change affect me?
Summary by cubic
Adds per-query execution time charts to the SQL collector, exposing a “duration” metric per query to help spot slow statements. Also updates chart metadata and connection handling.
New Features
Refactors
Written for commit 1bc9ca0. Summary will update automatically on new commits.