Expose created time and updated time to proxy metrics (#9727)

Signed-off-by: dragondriver <jiquan.long@zilliz.com>
pull/9746/head
dragondriver 2021-10-12 19:31:25 +08:00 committed by GitHub
parent 3437761108
commit 7543122186
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View File

@ -65,8 +65,9 @@ func getSystemInfoMetrics(
SystemVersion: os.Getenv(metricsinfo.GitCommitEnvKey),
DeployMode: os.Getenv(metricsinfo.DeployModeEnvKey),
},
// TODO(dragondriver): CreatedTime & UpdatedTime, easy but time-costing
Type: typeutil.ProxyRole,
CreatedTime: Params.CreatedTime.String(),
UpdatedTime: Params.UpdatedTime.String(),
Type: typeutil.ProxyRole,
},
SystemConfigurations: metricsinfo.ProxyConfiguration{
DefaultPartitionName: Params.DefaultPartitionName,

View File

@ -65,6 +65,9 @@ type ParamTable struct {
MaxTaskNum int64
PulsarMaxMessageSize int
CreatedTime time.Time
UpdatedTime time.Time
}
var Params ParamTable

View File

@ -316,6 +316,9 @@ func (node *Proxy) Start() error {
cb()
}
Params.CreatedTime = time.Now()
Params.UpdatedTime = time.Now()
node.UpdateStateCode(internalpb.StateCode_Healthy)
log.Debug("Proxy", zap.Any("State", node.stateCode.Load()))