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
|
@ -5,6 +5,7 @@ import (
|
|||
"os"
|
||||
"sync"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/pkg/tracing"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/common"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/fstree"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode"
|
||||
|
@ -32,13 +33,13 @@ type Cache interface {
|
|||
//
|
||||
// Returns apistatus.ObjectNotFound if object is missing in the Cache.
|
||||
// Returns ErrReadOnly if the Cache is currently in the read-only mode.
|
||||
Delete(oid.Address) error
|
||||
Delete(context.Context, oid.Address) error
|
||||
Iterate(IterationPrm) error
|
||||
Put(common.PutPrm) (common.PutRes, error)
|
||||
Put(context.Context, common.PutPrm) (common.PutRes, error)
|
||||
SetMode(mode.Mode) error
|
||||
SetLogger(*logger.Logger)
|
||||
DumpInfo() Info
|
||||
Flush(bool) error
|
||||
Flush(context.Context, bool) error
|
||||
|
||||
Init() error
|
||||
Open(readOnly bool) error
|
||||
|
@ -152,7 +153,10 @@ func (c *cache) Open(readOnly bool) error {
|
|||
|
||||
// Init runs necessary services.
|
||||
func (c *cache) Init() error {
|
||||
c.initFlushMarks()
|
||||
ctx, span := tracing.StartSpanFromContext(context.TODO(), "writecache.Init")
|
||||
defer span.End()
|
||||
|
||||
c.initFlushMarks(ctx)
|
||||
c.runFlushLoop()
|
||||
return nil
|
||||
}
|
||||
|
@ -163,7 +167,7 @@ func (c *cache) Close() error {
|
|||
defer c.modeMtx.Unlock()
|
||||
|
||||
// Finish all in-progress operations.
|
||||
if err := c.setMode(mode.ReadOnly); err != nil {
|
||||
if err := c.setMode(context.TODO(), mode.ReadOnly); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue