-
Notifications
You must be signed in to change notification settings - Fork 1
Add dashboards #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughA new Grafana dashboard configuration file named "telemetry.json" was added under the dashboards directory. This dashboard is designed to visualize telemetry data using four timeseries panels sourced from a Prometheus datasource, and includes a built-in annotation for alerts. Changes
Poem
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
dashboards/telemetry.json (4)
18-23
: Remove hard-coded dashboard ID for provisioning
Specifying"id": 54
can conflict when provisioning dashboards via JSON. Consider omitting theid
field and allowing Grafana to assign it automatically.
24-123
: Use a templated Prometheus datasource and fix legend formatting
- Replace the hard-coded Prometheus
uid
with a dashboard variable (e.g.,${DS_PROMETHEUS}
) for portability.- The current
"legendFormat": "{{label_name}}"
may not surfacecluster_id
. Switch to{{cluster_id}}
.Proposed diff:
--- a/dashboards/telemetry.json +++ b/dashboards/telemetry.json @@ panels[*].datasource - "uid": "10808fc2-f369-4b84-a97e-1f8c8725630a" + "uid": "${DS_PROMETHEUS}" @@ panels[*].options.legend - "legendFormat": "{{label_name}}" + "legendFormat": "{{cluster_id}}"
124-222
: Simplify PromQL and improve legend naming
The nestedsum by (cozystack_version) (count by (cluster_id, cozystack_version) ...)
can be collapsed into a single aggregation and the legend should reflect the version label:--- a/dashboards/telemetry.json +++ b/dashboards/telemetry.json @@ targets[0] - "expr": "sum by (cozystack_version) ( count by (cluster_id, cozystack_version) (cozy_cluster_info) )", - "legendFormat": "__auto", + "expr": "count(cozy_cluster_info) by (cozystack_version)", + "legendFormat": "{{cozystack_version}}",
323-341
: Introduce dashboard-level variables for interactivity
Consider adding templating variables forcluster_id
andcozystack_version
(and even the Prometheus datasource) so users can filter panels at runtime without editing the JSON.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
dashboards/telemetry.json
(1 hunks)
🔇 Additional comments (2)
dashboards/telemetry.json (2)
1-17
: Annotation configuration looks good
The built-in Grafana annotation for alerts is correctly enabled, hidden, and points to the Grafana internal datasource.
223-322
: Verify cluster-sum query and series labeling
Usinglabel_replace
to rename the metric works, but you can simplify the total‐clusters query and ensure legend clarity:--- a/dashboards/telemetry.json +++ b/dashboards/telemetry.json @@ targets[0] - "expr": "sum(\n- label_replace(\n- sum by (__name__, cluster_id) (cozy_cluster_info),\n- \"__name__\", \n- \"total_cluster_sum\", \n- \"\", \n- \"\"\n- )\n-)", + "expr": "sum(count by (cluster_id) (cozy_cluster_info))", + "legendFormat": "total_cluster_sum",Please verify this aligns with your intended total‐clusters metric.
Dashboards for telemetry have been added — including per-node, per-cluster, and per-version metrics.
Summary by CodeRabbit