package trace
import "github.com/ipfs/go-datastore/trace"
Package trace wraps a datastore where all datastore interactions are traced with open telemetry.
Index ¶
- type Datastore
- func New(ds ds.Datastore, tracer otel.Tracer) *Datastore
- func (t *Datastore) Batch(ctx context.Context) (ds.Batch, error)
- func (t *Datastore) Check(ctx context.Context) error
- func (t *Datastore) Close() error
- func (t *Datastore) CollectGarbage(ctx context.Context) error
- func (t *Datastore) Delete(ctx context.Context, key ds.Key) error
- func (t *Datastore) DiskUsage(ctx context.Context) (uint64, error)
- func (t *Datastore) Get(ctx context.Context, key ds.Key) (value []byte, err error)
- func (t *Datastore) GetSize(ctx context.Context, key ds.Key) (int, error)
- func (t *Datastore) Has(ctx context.Context, key ds.Key) (bool, error)
- func (t *Datastore) NewTransaction(ctx context.Context, readOnly bool) (ds.Txn, error)
- func (t *Datastore) Put(ctx context.Context, key ds.Key, value []byte) error
- func (t *Datastore) Query(ctx context.Context, q dsq.Query) (dsq.Results, error)
- func (t *Datastore) Scrub(ctx context.Context) error
- func (t *Datastore) Sync(ctx context.Context, key ds.Key) error
- type Txn
- func (t *Txn) Commit(ctx context.Context) error
- func (t *Txn) Delete(ctx context.Context, key ds.Key) error
- func (t *Txn) Discard(ctx context.Context)
- func (t *Txn) Get(ctx context.Context, key ds.Key) (value []byte, err error)
- func (t *Txn) GetSize(ctx context.Context, key ds.Key) (int, error)
- func (t *Txn) Has(ctx context.Context, key ds.Key) (bool, error)
- func (t *Txn) Put(ctx context.Context, key ds.Key, value []byte) error
- func (t *Txn) Query(ctx context.Context, q dsq.Query) (dsq.Results, error)
Types ¶
type Datastore ¶
type Datastore struct {
// contains filtered or unexported fields
}
Datastore is an adapter that traces inner datastore interactions.
func New ¶
New returns a new traced datastore. All datastore interactions are traced.
func (*Datastore) Batch ¶
Batch implements the ds.Batching interface.
func (*Datastore) Check ¶
Check implements the ds.CheckedDatastore interface.
func (*Datastore) Close ¶
Close closes the inner datastore (if it implements the io.Closer interface).
func (*Datastore) CollectGarbage ¶
CollectGarbage implements the ds.GCDatastore interface.
func (*Datastore) Delete ¶
Delete implements the ds.Datastore interface.
func (*Datastore) DiskUsage ¶
DiskUsage implements the ds.PersistentDatastore interface.
func (*Datastore) Get ¶
Get implements the ds.Datastore interface.
func (*Datastore) GetSize ¶
GetSize implements the ds.Datastore interface.
func (*Datastore) Has ¶
Has implements the ds.Datastore interface.
func (*Datastore) NewTransaction ¶
NewTransaction implements the ds.TxnDatastore interface.
func (*Datastore) Put ¶
Put implements the ds.Datastore interface.
func (*Datastore) Query ¶
Query implements the ds.Datastore interface.
func (*Datastore) Scrub ¶
Scrub implements the ds.ScrubbedDatastore interface.
func (*Datastore) Sync ¶
Sync implements Datastore.Sync
type Txn ¶
type Txn struct {
// contains filtered or unexported fields
}
Txn is an adapter that traces datastore transactions
func (*Txn) Commit ¶
Commit implements the ds.Txn interface.
func (*Txn) Delete ¶
Delete implements the ds.Txn interface.
func (*Txn) Discard ¶
Discard implements the ds.Txn interface.
func (*Txn) Get ¶
Get implements the ds.Txn interface.
func (*Txn) GetSize ¶
GetSize implements the ds.Txn interface.
func (*Txn) Has ¶
Has implements the ds.Txn interface.
func (*Txn) Put ¶
Put implements the ds.Txn interface.
func (*Txn) Query ¶
Query implements the ds.Txn interface.
Source Files ¶
- Version
- v0.8.2 (latest)
- Published
- Mar 4, 2025
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 1 month ago –
Tools for package owners.