forked from TrueCloudLab/frostfs-node
[#242] node: Add tracing spans
Add tracing spans for PUT requests. Add tracing spans for DELETE requests. Add tracing spans for SELECT requests. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
200fc8b882
commit
d62c6e4ce6
122 changed files with 863 additions and 417 deletions
|
@ -1,12 +1,14 @@
|
|||
package searchsvc
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func (exec *execCtx) executeLocal() {
|
||||
ids, err := exec.svc.localStorage.search(exec)
|
||||
func (exec *execCtx) executeLocal(ctx context.Context) {
|
||||
ids, err := exec.svc.localStorage.search(ctx, exec)
|
||||
|
||||
if err != nil {
|
||||
exec.status = statusUndefined
|
||||
|
|
|
@ -27,7 +27,7 @@ func (exec *execCtx) execute(ctx context.Context) {
|
|||
exec.log.Debug(logs.ServingRequest)
|
||||
|
||||
// perform local operation
|
||||
exec.executeLocal()
|
||||
exec.executeLocal(ctx)
|
||||
|
||||
exec.analyzeStatus(ctx, true)
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ func (c *testClientCache) get(info clientcore.NodeInfo) (searchClient, error) {
|
|||
return v, nil
|
||||
}
|
||||
|
||||
func (s *testStorage) search(exec *execCtx) ([]oid.ID, error) {
|
||||
func (s *testStorage) search(_ context.Context, exec *execCtx) ([]oid.ID, error) {
|
||||
v, ok := s.items[exec.containerID().EncodeToString()]
|
||||
if !ok {
|
||||
return nil, nil
|
||||
|
|
|
@ -37,7 +37,7 @@ type cfg struct {
|
|||
log *logger.Logger
|
||||
|
||||
localStorage interface {
|
||||
search(*execCtx) ([]oid.ID, error)
|
||||
search(context.Context, *execCtx) ([]oid.ID, error)
|
||||
}
|
||||
|
||||
clientConstructor interface {
|
||||
|
|
|
@ -117,12 +117,12 @@ func (c *clientWrapper) searchObjects(ctx context.Context, exec *execCtx, info c
|
|||
return res.IDList(), nil
|
||||
}
|
||||
|
||||
func (e *storageEngineWrapper) search(exec *execCtx) ([]oid.ID, error) {
|
||||
func (e *storageEngineWrapper) search(ctx context.Context, exec *execCtx) ([]oid.ID, error) {
|
||||
var selectPrm engine.SelectPrm
|
||||
selectPrm.WithFilters(exec.searchFilters())
|
||||
selectPrm.WithContainerID(exec.containerID())
|
||||
|
||||
r, err := e.storage.Select(selectPrm)
|
||||
r, err := e.storage.Select(ctx, selectPrm)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue