[#1613] morph: Add tracing for morph queries to neo-go

Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
Alexander Chuprov 2025-02-05 16:37:11 +03:00
parent 4de5fca547
commit 9b113c3156
Signed by: achuprov
GPG key ID: 2D916FFD803B0EDD
120 changed files with 623 additions and 562 deletions

View file

@ -39,7 +39,7 @@ const defaultSyncWorkerCount = 20
// tree IDs from the other container nodes. Returns ErrNotInContainer if the node
// is not included in the container.
func (s *Service) synchronizeAllTrees(ctx context.Context, cid cid.ID) error {
nodes, pos, err := s.getContainerNodes(cid)
nodes, pos, err := s.getContainerNodes(ctx, cid)
if err != nil {
return fmt.Errorf("can't get container nodes: %w", err)
}
@ -112,7 +112,7 @@ func (s *Service) synchronizeAllTrees(ctx context.Context, cid cid.ID) error {
// SynchronizeTree tries to synchronize log starting from the last stored height.
func (s *Service) SynchronizeTree(ctx context.Context, cid cid.ID, treeID string) error {
nodes, pos, err := s.getContainerNodes(cid)
nodes, pos, err := s.getContainerNodes(ctx, cid)
if err != nil {
return fmt.Errorf("can't get container nodes: %w", err)
}
@ -393,7 +393,7 @@ func (s *Service) syncLoop(ctx context.Context) {
start := time.Now()
cnrs, err := s.cfg.cnrSource.List()
cnrs, err := s.cfg.cnrSource.List(ctx)
if err != nil {
s.log.Error(ctx, logs.TreeCouldNotFetchContainers, zap.Error(err))
s.metrics.AddSyncDuration(time.Since(start), false)
@ -463,7 +463,7 @@ func (s *Service) removeContainers(ctx context.Context, newContainers map[cid.ID
continue
}
existed, err := containerCore.WasRemoved(s.cnrSource, cnr)
existed, err := containerCore.WasRemoved(ctx, s.cnrSource, cnr)
if err != nil {
s.log.Error(ctx, logs.TreeCouldNotCheckIfContainerExisted,
zap.Stringer("cid", cnr),
@ -493,7 +493,7 @@ func (s *Service) containersToSync(ctx context.Context, cnrs []cid.ID) (map[cid.
cnrsToSync := make([]cid.ID, 0, len(cnrs))
for _, cnr := range cnrs {
_, pos, err := s.getContainerNodes(cnr)
_, pos, err := s.getContainerNodes(ctx, cnr)
if err != nil {
s.log.Error(ctx, logs.TreeCouldNotCalculateContainerNodes,
zap.Stringer("cid", cnr),