observes

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecorateStruct

func DecorateStruct[T any](obj T, opt TracingDecoratorOption) T

func NewSentry

func NewSentry(opt *SentryOptions) error

NewSentry is the register sentry

func NewTracer

func NewTracer(opt *TracerOption) error

Types

type Layer

type Layer int
const (
	LayerUnknown Layer = iota
	LayerHandler
	LayerService
	LayerRepo
)

func (Layer) String

func (l Layer) String() string

type MethodCall

type MethodCall struct {
	Layer Layer
	Name  string
}

type SentryOptions

type SentryOptions struct {
	Dsn         string
	Name        string
	Release     string
	Environment string
}

type TracerOption

type TracerOption struct {
	URL                string
	Name               string
	Version            string
	Branch             string
	Revision           string
	Environment        string
	SamplingRate       float64
	MaxAttributes      int
	BatchTimeout       time.Duration
	ExportTimeout      time.Duration
	MaxExportBatchSize int
}

type TracingContext

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

func NewTracingContext

func NewTracingContext(ctx context.Context, name string, maxAttrs int) *TracingContext

func (*TracingContext) AddMethodCall

func (tc *TracingContext) AddMethodCall(layer Layer, name string)

func (*TracingContext) Context

func (tc *TracingContext) Context() context.Context

func (*TracingContext) End

func (tc *TracingContext) End()

func (*TracingContext) SetAttributes

func (tc *TracingContext) SetAttributes(attributes ...attribute.KeyValue)

func (*TracingContext) SetStatus

func (tc *TracingContext) SetStatus(code codes.Code, description string)

type TracingDecoratorOption

type TracingDecoratorOption struct {
	Layer                    Layer
	CreateSpanForEachMethod  bool
	RecordMethodParams       bool
	RecordMethodReturnValues bool
}

Jump to

Keyboard shortcuts

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