otgorm

package
v0.0.0-...-cf1f338 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSpanAttribute

func CreateSpanAttribute(k string, v interface{}) (kv core.KeyValue)

CreateSpanAttribute creates a KeyValue for use as a span attribute

func RegisterCallbacks

func RegisterCallbacks(db *gorm.DB, t trace.Tracer, opts ...Option)

RegisterCallbacks registers the necessary callbacks in Gorm's hook system for instrumentation with OpenTelemetry Spans.

func WithContext

func WithContext(ctx context.Context, db *gorm.DB) *gorm.DB

WithContext sets the current context in the db instance for instrumentation.

Types

type AllowRoot

type AllowRoot bool

AllowRoot allows creating root spans in the absence of existing spans.

type DefaultAttributes

type DefaultAttributes []core.KeyValue

DefaultAttributes sets attributes to each span.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option allows for managing otgorm configuration using functional options.

type OptionFunc

type OptionFunc func(c *callbacks)

OptionFunc converts a regular function to an Option if it's definition is compatible.

type Query

type Query bool

Query allows recording the sql queries in spans.

type Table

type Table bool

Table allows for recording the table affected by sql queries in spans

Jump to

Keyboard shortcuts

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