From 17f4b02d871a61c326797f70b25d1c8547e2b228 Mon Sep 17 00:00:00 2001 From: CharlesCheung <61726649+CharlesCheung96@users.noreply.github.com> Date: Thu, 28 Dec 2023 15:45:28 +0800 Subject: [PATCH] add more deploy info to ticdc (#1632) --- pkg/utils/topology/ticdc.go | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/pkg/utils/topology/ticdc.go b/pkg/utils/topology/ticdc.go index d7ccc54cee..fa59dd863b 100644 --- a/pkg/utils/topology/ticdc.go +++ b/pkg/utils/topology/ticdc.go @@ -70,9 +70,12 @@ func FetchTiCDCTopology(ctx context.Context, etcdClient *clientv3.Client) ([]TiC func parseTiCDCInfo(clusterName string, value []byte) (*TiCDCInfo, error) { ds := struct { - ID string `json:"id"` - Address string `json:"address"` - Version string `json:"version"` + ID string `json:"id"` + Address string `json:"address"` + Version string `json:"version"` + GitHash string `json:"git-hash"` + DeployPath string `json:"deploy-path"` + StartTimestamp int64 `json:"start-timestamp"` }{} err := json.Unmarshal(value, &ds) @@ -85,11 +88,14 @@ func parseTiCDCInfo(clusterName string, value []byte) (*TiCDCInfo, error) { } return &TiCDCInfo{ - ClusterName: clusterName, - Version: ds.Version, - IP: hostname, - Port: port, - Status: ComponentStatusUp, - StatusPort: port, + ClusterName: clusterName, + GitHash: ds.GitHash, + Version: ds.Version, + IP: hostname, + Port: port, + DeployPath: ds.DeployPath, + Status: ComponentStatusUp, + StatusPort: port, + StartTimestamp: ds.StartTimestamp, }, nil }