bunotel

package module
v0.0.0-...-4fd101a Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: BSD-2-Clause Imports: 17 Imported by: 0

README

OpenTelemetry instrumentation for Bun

See example for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(h *QueryHook)

func WithAttributes

func WithAttributes(attrs ...attribute.KeyValue) Option

WithAttributes configures attributes that are used to create a span.

func WithDBName

func WithDBName(name string) Option

WithDBName configures a db.name attribute.

func WithFormattedQueries

func WithFormattedQueries(format bool) Option

WithFormattedQueries enables formatting of the query that is added as the statement attribute to the trace. This means that all placeholders and arguments will be filled first and the query will contain all information as sent to the database.

type QueryHook

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

func NewQueryHook

func NewQueryHook(opts ...Option) *QueryHook

func (*QueryHook) AfterQuery

func (h *QueryHook) AfterQuery(ctx context.Context, event *bun.QueryEvent)

func (*QueryHook) BeforeQuery

func (h *QueryHook) BeforeQuery(ctx context.Context, event *bun.QueryEvent) context.Context

func (*QueryHook) Init

func (h *QueryHook) Init(db *bun.DB)

Jump to

Keyboard shortcuts

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