diff --git a/pkg/internal/directory/service_mapping.go b/pkg/internal/directory/service_mapping.go index 7ed88bb..5439934 100644 --- a/pkg/internal/directory/service_mapping.go +++ b/pkg/internal/directory/service_mapping.go @@ -6,6 +6,7 @@ import ( "git.solsynth.dev/hypernet/nexus/pkg/nex" "git.solsynth.dev/hypernet/nexus/pkg/proto" "github.com/goccy/go-json" + "github.com/rs/zerolog/log" clientv3 "go.etcd.io/etcd/client/v3" "math/rand" "time" @@ -115,6 +116,11 @@ func BroadcastEvent(event string, data any) error { return err } + log.Debug(). + Int("destinations", len(resp.Kvs)). + Str("event", event). + Msg("Broadcasting event from internal...") + for _, val := range resp.Kvs { var instance ServiceInstance if err := json.Unmarshal(val.Value, &instance); err != nil { diff --git a/pkg/internal/directory/service_rpc.go b/pkg/internal/directory/service_rpc.go index d94bfb9..c8cc5a2 100644 --- a/pkg/internal/directory/service_rpc.go +++ b/pkg/internal/directory/service_rpc.go @@ -102,6 +102,10 @@ func (v *ServiceRpcServer) RemoveService(ctx context.Context, request *proto.Rem func (v *ServiceRpcServer) BroadcastEvent(ctx context.Context, in *proto.EventInfo) (*proto.EventResponse, error) { services := ListServiceInstance() + log.Debug(). + Int("destinations", len(services)). + Str("event", in.GetEvent()). + Msg("Broadcasting event...") for _, service := range services { conn, err := service.GetGrpcConn() if err != nil {