Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion metrics/grafana/ticdc_new_arch.json
Original file line number Diff line number Diff line change
Expand Up @@ -27296,7 +27296,7 @@
]
},
"timezone": "browser",
"title": "test-cluster-TiCDC-New-Arch",
"title": "${DS_TEST-CLUSTER}-TiCDC-New-Arch",
"uid": "YiGL8hBZ0aac",
"version": 40
}
2 changes: 1 addition & 1 deletion metrics/nextgengrafana/ticdc_new_arch_next_gen.json
Original file line number Diff line number Diff line change
Expand Up @@ -27296,7 +27296,7 @@
]
},
"timezone": "browser",
"title": "test-cluster-TiCDC-New-Arch",
"title": "${DS_TEST-CLUSTER}-TiCDC-New-Arch",
"uid": "YiGL8hBZ0aac",
"version": 40
}
Original file line number Diff line number Diff line change
Expand Up @@ -11488,7 +11488,7 @@
]
},
"timezone": "browser",
"title": "test-cluster-TiCDC-New-Arch",
"title": "${DS_TEST-CLUSTER}-TiCDC-New-Arch-KeyspaceName",
"uid": "lGT5hED6vqTn",
"version": 40
}
12 changes: 12 additions & 0 deletions scripts/generate-next-gen-metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ if [ ! -f "$NEXT_GEN_SHARED_FILE" ]; then
exit 1
fi

require_file_contains() {
local file="$1"
local expected="$2"

if ! grep -Fq -- "$expected" "$file"; then
echo "Error: Generated file '$file' must contain '$expected'" >&2
exit 1
fi
}

# This jq script filters the panels in the Grafana dashboard.
# It defines a recursive function `filter_panels` that:
# 1. For panels of type "row", it recursively filters their sub-panels.
Expand All @@ -64,9 +74,11 @@ jq '

"$SED_CMD" "${SED_INPLACE_ARGS[@]}" "s/\${DS_TEST-CLUSTER}-TiCDC-New-Arch/&-KeyspaceName/" "$NEXT_GEN_USER_FILE"
"$SED_CMD" "${SED_INPLACE_ARGS[@]}" "s/YiGL8hBZ0aac/lGT5hED6vqTn/" "$NEXT_GEN_USER_FILE"
require_file_contains "$NEXT_GEN_USER_FILE" "-KeyspaceName"

echo "Userscope dashboard created at '$NEXT_GEN_USER_FILE'"

"$SED_CMD" "${SED_INPLACE_ARGS[@]}" 's/\([^$]\)tidb_cluster/\1sharedpool_id/g' "$NEXT_GEN_SHARED_FILE"
require_file_contains "$NEXT_GEN_SHARED_FILE" "sharedpool_id"

echo "Sharedscope dashboard created at '$NEXT_GEN_SHARED_FILE'"
Loading