Documentation
¶
Overview ¶
Package telemetry exposes selected github.com/XSAM/otelsql helpers through the go-service SQL import tree.
This package keeps repository SQL instrumentation on a go-service import path while preserving otelsql behavior for opening instrumented connections, wrapping drivers, and registering DB stats metrics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Open ¶ added in v2.341.0
Open opens a database/sql.DB handle with OpenTelemetry instrumentation.
Raw SQL query text capture is disabled by default. Callers that need raw statements in spans may opt in with WithSpanOptions.
func RegisterDBStatsMetrics ¶ added in v2.340.0
RegisterDBStatsMetrics registers OpenTelemetry DB stats metrics for db.
This is a thin wrapper around otelsql.RegisterDBStatsMetrics.
func WrapDriver ¶ added in v2.340.0
WrapDriver wraps a database/sql/driver.Driver with OpenTelemetry instrumentation.
Raw SQL query text capture is disabled by default. Callers that need raw statements in spans may opt in with WithSpanOptions.
Types ¶
type Option ¶ added in v2.340.0
Option is an alias of otelsql.Option.
It configures SQL OpenTelemetry instrumentation behavior such as emitted attributes and metric/tracing options.
func WithAttributes ¶ added in v2.340.0
func WithAttributes(attrs ...attributes.KeyValue) Option
WithAttributes adds static attributes to SQL telemetry spans and metrics.
This is a thin wrapper around otelsql.WithAttributes.
func WithSpanOptions ¶ added in v2.474.0
func WithSpanOptions(opts SpanOptions) Option
WithSpanOptions configures SQL tracing span behavior.
This is a thin wrapper around otelsql.WithSpanOptions.
type SpanOptions ¶ added in v2.474.0
type SpanOptions = otelsql.SpanOptions
SpanOptions is an alias of otelsql.SpanOptions.
It configures SQL tracing span behavior.