Skip to content
Open
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 cmd/cdc/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (o *options) run(cmd *cobra.Command) error {
logger.StartLogFileMonitor(ctx, loggerConfig.File, 30*time.Second)

version.LogVersionInfo("Change Data Capture (CDC)")
metrics.BuildInfo.WithLabelValues(version.ReleaseVersion, version.GitHash, version.BuildTS, kerneltype.Name()).Set(1)
metrics.BuildInfo.WithLabelValues(version.ReleaseVersion, version.GitHash, version.BuildTS, kerneltype.Name(), "newarch").Set(1)
log.Info("The TiCDC release version", zap.String("ReleaseVersion", version.ReleaseVersion))

util.LogHTTPProxies()
Expand Down
11 changes: 6 additions & 5 deletions metrics/grafana/ticdc_new_arch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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\", tidb_cluster=\"$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\", tidb_cluster=\"$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\", tidb_cluster=\"$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\", tidb_cluster=\"$tidb_cluster\", job=~\".*ticdc.*\", instance=~\"$ticdc_instance\"})",
"format": "time_series",
"instant": true,
"refId": "A"
Expand All @@ -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": {}
}
Expand Down
11 changes: 6 additions & 5 deletions metrics/nextgengrafana/ticdc_new_arch_next_gen.json
Original file line number Diff line number Diff line change
Expand Up @@ -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\"})",
"format": "time_series",
"instant": true,
"refId": "A"
Expand All @@ -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": {}
}
Expand Down
7 changes: 4 additions & 3 deletions pkg/metrics/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,17 @@ var (
Help: "The value of GOMAXPROCS",
})

// buildInfo is a metric with a constant '1' value, labeled by the build metadata.
// It is used by dashboards to identify the exact binary running on each TiCDC server.
// BuildInfo is a metric with a constant '1' value, labeled by the build metadata.
// It is used by dashboards to identify the exact binary running on each TiCDC server,
// including whether the process is running in TiCDC's new or old architecture mode.
BuildInfo = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "ticdc",
Subsystem: "server",
Name: "build_info",
Help: "TiCDC build information as labels.",
},
[]string{"release_version", "git_hash", "utc_build_time", "kernel_type"},
[]string{"release_version", "git_hash", "utc_build_time", "kernel_type", "ticdc_arch"},
)
)

Expand Down
Loading