telemetry

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 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

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

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

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

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

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

func WithSpanOptions(opts SpanOptions) Option

WithSpanOptions configures SQL tracing span behavior.

This is a thin wrapper around otelsql.WithSpanOptions.

type SpanOptions

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