fix: update MixCoord registration in MilvusRoles (#41337)

enhance: update MixCoord registration in MilvusRoles

The `runMixCoord` function in `MilvusRoles` was updated to use the
`RegisterMixCoord` function from the `rootcoord_metrics` package instead
of `RegisterRootCoord`. This change aligns with the recent modifications
made to the `rootcoord_metrics` package.
issue:https://github.com/milvus-io/milvus/issues/41338

---------

Signed-off-by: Xianhui.Lin <xianhui.lin@zilliz.com>
pull/41369/head
Xianhui Lin 2025-04-16 19:49:54 +08:00 committed by GitHub
parent 4be6d0e967
commit deb610e5d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 6 deletions

View File

@ -183,7 +183,7 @@ func (mr *MilvusRoles) runProxy(ctx context.Context, localMsg bool, wg *sync.Wai
func (mr *MilvusRoles) runMixCoord(ctx context.Context, localMsg bool, wg *sync.WaitGroup) component {
wg.Add(1)
return runComponent(ctx, localMsg, wg, components.NewMixCoord, metrics.RegisterRootCoord)
return runComponent(ctx, localMsg, wg, components.NewMixCoord, metrics.RegisterMixCoord)
}
func (mr *MilvusRoles) runQueryNode(ctx context.Context, localMsg bool, wg *sync.WaitGroup) component {

View File

@ -113,7 +113,7 @@ func runMixCoord(ctx context.Context, localMsg bool) *grpcmixcoord.Server {
}()
wg.Wait()
metrics.RegisterRootCoord(Registry)
metrics.RegisterMixCoord(Registry)
return rc
}

View File

@ -28,12 +28,10 @@ func TestRegisterMetrics(t *testing.T) {
assert.NotPanics(t, func() {
r := prometheus.NewRegistry()
// Make sure it doesn't panic.
RegisterRootCoord(r)
RegisterMixCoord(r)
RegisterDataNode(r)
RegisterDataCoord(r)
RegisterProxy(r)
RegisterQueryNode(r)
RegisterQueryCoord(r)
RegisterMetaMetrics(r)
RegisterStorageMetrics(r)
RegisterMsgStreamMetrics(r)

View File

@ -246,7 +246,7 @@ var (
)
// RegisterRootCoord registers RootCoord metrics
func RegisterRootCoord(registry *prometheus.Registry) {
func RegisterMixCoord(registry *prometheus.Registry) {
registry.Register(RootCoordProxyCounter)
// for time tick
@ -286,6 +286,8 @@ func RegisterRootCoord(registry *prometheus.Registry) {
registry.MustRegister(DiskQuota)
RegisterStreamingServiceClient(registry)
RegisterQueryCoord(registry)
RegisterDataCoord(registry)
}
func CleanupRootCoordDBMetrics(dbName string) {