postgresotel

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package postgresotel adapts postgres observations to standard OpenTelemetry metrics without recording SQL, arguments, DSNs, or raw errors. New borrows a meter provider, defaulting to no-op instruments. The caller owns provider export/shutdown; this adapter does not add query tracing or a background loop.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// MeterProvider is borrowed; nil selects a no-op provider. Its shutdown is
	// caller-owned.
	MeterProvider metric.MeterProvider
}

Config selects the standard OpenTelemetry meter provider.

type Observer

type Observer struct {
	// contains filtered or unexported fields
}

Observer records bounded lifecycle and transaction metrics.

func New

func New(config Config) (*Observer, error)

New constructs an OpenTelemetry observer with standard database metric names and a no-op provider when none is supplied.

func (*Observer) Observe

func (o *Observer) Observe(ctx context.Context, observation postgres.Observation)

Observe records finite category projections synchronously using the caller context. It does not install query tracing or shut down the meter provider.

Jump to

Keyboard shortcuts

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