otelstack

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2025 License: MIT Imports: 8 Imported by: 0

README

OTEL Tescontainer stack for go

godoc license Build Status Go Coverage

The otelstack package provides an easy to use pop-up OTEL testcontainers stack for use in go

Usage

stack := New()
shutdownFunc, err := stack.Start(t.Context())
require.NotNil(t, err, "the stack must start up")

// be sure to defer shutdown of the stack
t.Cleanup(func() {
	if err := shutdownFunc(context.Background()); err != nil {
		t.Logf("error shutting down stack: %v", err)
	}
})

// For optionally setting OTEL_EXPORTER_OTLP_INSECURE and OTEL_EXPORTER_OTLP_ENDPOINT
stack.SetTestEnv(t)

// ports can be accessed as such
t.Logf("Seq ui: http://localhost:%d", stack.Seq.Ports[80].Int())
t.Logf("Jaeger ui: http://localhost:%d", stack.Seq.Ports[16686].Int())

// Continue to initialise your own otel setup here

// Your telemetry will now be sent to the stack

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() *stack

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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