close
Skip to content

feat: doc includes usage detail of given metric in dashboards#3710

Merged
Hardikl merged 12 commits intomainfrom
hl_doc
Jun 24, 2025
Merged

feat: doc includes usage detail of given metric in dashboards#3710
Hardikl merged 12 commits intomainfrom
hl_doc

Conversation

@Hardikl
Copy link
Copy Markdown
Contributor

@Hardikl Hardikl commented Jun 16, 2025

No description provided.

@cla-bot cla-bot bot added the cla-signed label Jun 16, 2025
@Hardikl Hardikl linked an issue Jun 16, 2025 that may be closed by this pull request
@Hardikl
Copy link
Copy Markdown
Contributor Author

Hardikl commented Jun 17, 2025

updating the counter.yaml file to support the dashboard doc for generated metrics.

Comment thread cmd/tools/generate/counter.go Outdated
Comment thread cmd/tools/generate/counter.yaml Outdated
Comment thread cmd/tools/generate/generate.go Outdated
@cgrinds cgrinds requested a review from Copilot June 18, 2025 12:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR expands the metrics generation pipeline to track where each metric is used in Grafana dashboards and surface that usage in the generated documentation.

  • Propagate a metricsPanelMap through BuildMetrics and related functions, collecting dashboard/panel metadata.
  • Introduce visitDashboard/visitExpressions to walk JSON dashboards and fill metricsPanelMap.
  • Update the counter template and Counter type to render a “Visualized in” section listing dashboards that use each metric.

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
integration/test/alert_rule_test.go Updated test to pass a new metricsPanelMap into BuildMetrics
grafana/dashboards/cmode/flexgroup.json Fixed default row title from “Highlight” to “Highlights”
cmd/tools/grafana/metrics.go Renamed exprPExprP, enriched expression metadata, updated DoTarget/NewExpr signatures
cmd/tools/grafana/dashboard_test.go Updated tests to use the new ExprP and updated function signatures
cmd/tools/generate/generate.go Changed BuildMetrics signature, added visitDashboard call in generator, wired metricsPanelMap
cmd/tools/generate/counter.tmpl Extended the template to render a dashboard usage table per metric
cmd/tools/generate/counter.go Added PanelDef/PanelData, integrated panels into Counter, updated merging logic
cmd/tools/generate/* (various) Propagated metricsPanelMap through all process*Counters calls
Comments suppressed due to low confidence (1)

Comment thread cmd/tools/generate/generate.go Outdated
Comment thread cmd/tools/generate/counter.go Outdated
Comment thread cmd/tools/generate/counter.go Outdated
Comment thread cmd/tools/grafana/metrics.go Outdated
Comment thread cmd/tools/generate/counter.go Outdated
Comment thread cmd/tools/generate/counter.go Outdated
@rahulguptajss
Copy link
Copy Markdown
Contributor

rahulguptajss commented Jun 19, 2025

We need to have same names for panels for cases like below.

Average Disk Utilization per Aggregate
Average Disk Utilization Per Aggregate

Comment thread cmd/tools/generate/counter.go Outdated
@rahulguptajss
Copy link
Copy Markdown
Contributor

Could you check if links open in a new tab when clicked?

rahulguptajss
rahulguptajss previously approved these changes Jun 23, 2025
@Hardikl Hardikl merged commit d73af48 into main Jun 24, 2025
10 checks passed
@Hardikl Hardikl deleted the hl_doc branch June 24, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harvest should include which dashboards use a given metric

4 participants