AsperforMias opened a new pull request, #3847: URL: https://github.com/apache/dubbo-go/pull/3847
### Description With application-level service discovery, `RegisterService` registers instances without publishing a register event, so `dubbo_registry_register_requests_total` and `dubbo_register_rt_milliseconds` are never exported. Dubbo Admin's "注册实例次数" and "实例注册时长" panels are empty for every Dubbo-go application. Dubbo Java counts instance registration as a register request in `AbstractServiceDiscovery#register`. This PR publishes `NewRegisterEvent` around each `ServiceDiscovery.Register` call, with its real start time and result. It also fixes the service-level event in `Register`: it was published with `time.Now()` as its start time (so `dubbo_register_service_rt_milliseconds` recorded ~0) and always reported success. It now times the `ServiceNameMapping.Map` call and reports its result. Verified with Nacos and Dubbo Admin `develop` (65bce33), two providers of one application: - before: no `dubbo_registry_register_requests_total`; `dubbo_register_service_rt_milliseconds_sum` = 8.3e-05 - after: `dubbo_registry_register_requests_total` = 1 and `dubbo_register_rt_milliseconds_sum` ≈ 3 ms per instance; `dubbo_register_service_rt_milliseconds_sum` ≈ 125 ms; the two Admin panels show data The new tests fail without the change. ### Checklist - [x] I confirm the target branch is `develop` - [x] I have run `make fmt` to format my code - [x] I have run `make test` to run local tests (all packages pass except `TestDubboProtocol_Refer` and `TestDubboProtocolReferNoConnect` in `protocol/dubbo`, which also fail on the base commit locally because port 20000 is taken by another process on my machine) - [x] I have added tests that prove my fix is effective or that my feature works -- 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]
