otelutil

package
v0.0.0-...-269704d Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OTelSQLOpenPostgres

func OTelSQLOpenPostgres(connectionURL string) (*sql.DB, error)

OTelSQLOpen is database/sql.Open, with instrumentation.

func OtelRedisInstrumentMetrics

func OtelRedisInstrumentMetrics(client *redis.Client) error

InstrumentMetrics is based on https://github.com/redis/go-redis/blob/v9.7.0/extra/redisotel/metrics.go With the following modifications

1. Added the ability to get extra attributes from context. 2. Convert some metric to use the semconv v1.28.0

func SetupOTelSDKGlobally

func SetupOTelSDKGlobally(ctx context.Context) (outCtx context.Context, shutdown func(context.Context) error, err error)

SetupOTelSDKGlobally sets up the global propagator and the global meter provider. Setting these globally allows us to define metric globally. Additionally, it returns a context that MUST BE used as the background context. The returned context contains a *sdkresource.Resource. The returned context contains a *otelhttp.Labeler.

Types

This section is empty.

Jump to

Keyboard shortcuts

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