Modo-me commented on code in PR #3605:
URL: https://github.com/apache/dubbo-go/pull/3605#discussion_r3762333686
##########
metadata/report_instance.go:
##########
@@ -160,15 +160,40 @@ func (d *DelegateMetadataReport)
GetAppMetadata(application, revision string) (*
}
func (d *DelegateMetadataReport) GetServiceAppMapping(application string,
group string, listener mapping.MappingListener) (*gxset.HashSet, error) {
- return d.instance.GetServiceAppMapping(application, group, listener)
+ event :=
metadataMetrics.NewMetadataMetricTimeEvent(metadataMetrics.MetadataMappingGet)
+ event.Attachment[constant.InterfaceKey] = application
+ event.Attachment[constant.GroupKey] = group
+ if listener != nil {
+ event.Name = metadataMetrics.MetadataMappingListen
+ }
+ set, err := d.instance.GetServiceAppMapping(application, group,
listener)
+ event.Succ = err == nil
+ event.End = time.Now()
+ metrics.Publish(event)
+ return set, err
Review Comment:
已把mapping
操作的metrics都移至上层service_name_mapping.go进行聚合,按业务操作类型打点,原本除了Get以外Map和Remove也有类似的问题。显式把
operation 传入 delegate/指标事件这个方案没采用,因为传入
operation实际也相当于在上层进行聚合,但是该方案需要的改动过大,需要改动调用链路上的所有函数
同时加强了在多report场景下Get操作的可观测粒度:对每个 report 错误打日志并标识标识具体 report,以及在事件上标记 partial
failure
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]