sqlx

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package sqlx wires database/sql to OpenTelemetry via XSAM/otelsql.

Two things matter here and only one is obvious. The obvious one is query spans. The less obvious one is RegisterDBStatsMetrics: connection-pool exhaustion presents as "the database is slow" while the database sits idle, and the pool gauges are the only signal that distinguishes those two.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(driverName, dsn, system string) (*sql.DB, func() error, error)

Open returns an instrumented *sql.DB and a close function.

Use the returned func instead of db.Close(): it also unregisters the pool metric callback, which otherwise keeps polling a closed pool for the life of the process.

driverName is the registered database/sql driver (e.g. "pgx"); system is the semconv value for it (e.g. "postgresql"). Pool sizing stays with the caller — SetMaxOpenConns and friends are workload-specific, and a library guessing them causes exactly the exhaustion these metrics exist to reveal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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