dsoteldecorator

package module
v0.0.0-...-5581225 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

README

go-ds-otelwrapper

Add opentelemetry to any datastore

Get started

Use the Wrap method to decorate your datastore.

myds := datastore.Datastore{}
newds := Wrap(&myds)

Every method starts a new span annotated by the method name

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OtelDatastore

type OtelDatastore struct {
	// contains filtered or unexported fields
}

func Wrap

func Wrap(ds datastore.Datastore, tracer trace.Tracer) *OtelDatastore

func (*OtelDatastore) Close

func (o *OtelDatastore) Close() error

func (*OtelDatastore) Delete

func (o *OtelDatastore) Delete(ctx context.Context, key datastore.Key) error

func (*OtelDatastore) Get

func (o *OtelDatastore) Get(ctx context.Context, key datastore.Key) (value []byte, err error)

func (*OtelDatastore) GetSize

func (o *OtelDatastore) GetSize(ctx context.Context, key datastore.Key) (size int, err error)

func (*OtelDatastore) Has

func (o *OtelDatastore) Has(ctx context.Context, key datastore.Key) (exists bool, err error)

func (*OtelDatastore) Put

func (o *OtelDatastore) Put(ctx context.Context, key datastore.Key, value []byte) error

func (*OtelDatastore) Query

func (o *OtelDatastore) Query(ctx context.Context, q query.Query) (query.Results, error)

func (*OtelDatastore) Sync

func (o *OtelDatastore) Sync(ctx context.Context, prefix datastore.Key) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL