telemetry

package
v2.617.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 5 Imported by: 0

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

func Open(driverName, dataSourceName string, opts ...Option) (*sql.DB, error)

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

func RegisterDBStatsMetrics(db *sql.DB, opts ...Option) (metrics.Registration, error)

RegisterDBStatsMetrics registers OpenTelemetry DB stats metrics for db.

This is a thin wrapper around otelsql.RegisterDBStatsMetrics.

func WrapDriver added in v2.340.0

func WrapDriver(driver driver.Driver, opts ...Option) driver.Driver

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

type Option = otelsql.Option

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.

Jump to

Keyboard shortcuts

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