-
Notifications
You must be signed in to change notification settings - Fork 60
metrics,grafana: add ticdc_arch to build info #4266
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3540,7 +3540,7 @@ | |
| "pluginVersion": "7.5.17", | ||
| "targets": [ | ||
| { | ||
| "expr": "max by (instance, kernel_type, git_hash, release_version, utc_build_time) (ticdc_server_build_info{k8s_cluster=\"$k8s_cluster\", sharedpool_id=\"$tidb_cluster\", job=~\".*ticdc.*\", instance=~\"$ticdc_instance\"})", | ||
| "expr": "max by (instance, ticdc_arch, kernel_type, git_hash, release_version, utc_build_time) (ticdc_server_build_info{k8s_cluster=\"$k8s_cluster\", sharedpool_id=\"$tidb_cluster\", job=~\".*ticdc.*\", instance=~\"$ticdc_instance\"}) or (max by (instance, ticdc_arch, kernel_type, git_hash, release_version, utc_build_time) (label_replace(label_replace(label_replace(label_replace(label_replace(ticdc_server_etcd_health_check_duration_count{k8s_cluster=\"$k8s_cluster\", sharedpool_id=\"$tidb_cluster\", job=~\".*ticdc.*\", instance=~\"$ticdc_instance\"}, \"ticdc_arch\", \"oldarch\", \"instance\", \".*\"), \"kernel_type\", \"unknown\", \"instance\", \".*\"), \"git_hash\", \"unknown\", \"instance\", \".*\"), \"release_version\", \"unknown\", \"instance\", \".*\"), \"utc_build_time\", \"unknown\", \"instance\", \".*\"))) unless on (instance) ticdc_server_build_info{k8s_cluster=\"$k8s_cluster\", sharedpool_id=\"$tidb_cluster\", job=~\".*ticdc.*\", instance=~\"$ticdc_instance\"})", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to the other dashboard file, this PromQL query is very long and complex due to the nested Consider using a Prometheus recording rule to abstract away this complexity. A recording rule could generate a clean metric for old-architecture nodes, which would make this dashboard query much simpler. If that's not an option, at least a comment in the panel description explaining the query would be beneficial. |
||
| "format": "time_series", | ||
| "instant": true, | ||
| "refId": "A" | ||
|
|
@@ -3562,11 +3562,12 @@ | |
| "__name__": true | ||
| }, | ||
| "indexByName": { | ||
| "git_hash": 2, | ||
| "git_hash": 3, | ||
| "instance": 0, | ||
| "kernel_type": 1, | ||
| "release_version": 3, | ||
| "utc_build_time": 4 | ||
| "kernel_type": 2, | ||
| "release_version": 4, | ||
| "ticdc_arch": 1, | ||
| "utc_build_time": 5 | ||
| }, | ||
| "renameByName": {} | ||
| } | ||
|
|
@@ -25515,4 +25516,4 @@ | |
| "title": "${DS_TEST-CLUSTER}-TiCDC-New-Arch", | ||
| "uid": "YiGL8hBZ0aac", | ||
| "version": 38 | ||
| } | ||
| } | ||
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.
The new PromQL query is functionally correct for providing a fallback for older TiCDC versions. However, its length and the deeply nested
label_replacecalls make it difficult to read and maintain.For improved readability, you could consider using a recording rule in Prometheus to pre-calculate the fallback metric with the necessary labels. This would simplify the dashboard query significantly.
If a recording rule is not feasible, adding comments within the Grafana panel's description explaining the query logic would be helpful for future maintenance.