Documentation
¶
Index ¶
- type Option
- func WithAttributes(attrs ...attribute.KeyValue) Option
- func WithDBName(name string) Option
- func WithFormattedQueries(format bool) Option
- func WithMeterProvider(mp metric.MeterProvider) Option
- func WithSpanNameFormatter(f func(*bun.QueryEvent) string) Option
- func WithTracerProvider(tp trace.TracerProvider) Option
- type QueryHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶ added in v1.0.12
type Option func(h *QueryHook)
func WithAttributes ¶ added in v1.0.12
WithAttributes configures attributes that are used to create a span.
func WithDBName ¶ added in v1.0.12
WithDBName configures a db.name attribute.
func WithFormattedQueries ¶ added in v1.1.6
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.
func WithMeterProvider ¶ added in v1.1.15
func WithMeterProvider(mp metric.MeterProvider) Option
WithMeterProvider returns an Option to use the MeterProvider when creating a Meter.
func WithSpanNameFormatter ¶ added in v1.2.10
func WithSpanNameFormatter(f func(*bun.QueryEvent) string) Option
WithSpanNameFormatter takes a function that determines the span name for a given query event.
func WithTracerProvider ¶ added in v1.1.15
func WithTracerProvider(tp trace.TracerProvider) Option
WithTracerProvider returns an Option to use the TracerProvider when creating a Tracer.
type QueryHook ¶
type QueryHook struct {
// contains filtered or unexported fields
}
func NewQueryHook ¶
func (*QueryHook) AfterQuery ¶
func (h *QueryHook) AfterQuery(ctx context.Context, event *bun.QueryEvent)
func (*QueryHook) BeforeQuery ¶
Click to show internal directories.
Click to hide internal directories.