gotel

package module
v0.0.0-...-7e846e6 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: MIT Imports: 5 Imported by: 0

README

gotel

OpenTelemetry SDK setup and helpers for Go.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OptionFunc

type OptionFunc func() error

OptionFunc is a function that sets some option on the OpenTelemetry SDK.

type Sdk

type Sdk struct {
	Shutdown    func(context.Context) error
	RootContext context.Context
}

func Setup

func Setup(opts ...OptionFunc) (*Sdk, error)

Setup initializes the OpenTelemetry SDK. Calling Shutdown is not necessary, as it is called automatically when the RootContext is done, i.e. when the application is terminated.

Example usage:

sdk, err := gotel.Setup()
if err != nil {
    return fmt.Errorf("failed to set up OpenTelemetry: %w", err)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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