testtelemetry

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package testtelemetry provides deterministic in-memory providers for tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Harness

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

Harness owns deterministic trace and metric providers and their readers.

func New

func New() *Harness

New constructs an isolated in-memory telemetry harness.

func (*Harness) MeterProvider

func (h *Harness) MeterProvider() metricapi.MeterProvider

MeterProvider returns a standard OpenTelemetry meter provider.

func (*Harness) Metrics

Metrics synchronously collects current metric data.

func (*Harness) ResetSpans

func (h *Harness) ResetSpans()

ResetSpans removes all recorded spans.

func (*Harness) Shutdown

func (h *Harness) Shutdown(ctx context.Context) error

Shutdown releases both providers and aggregates failures.

func (*Harness) Spans

func (h *Harness) Spans() tracetest.SpanStubs

Spans returns immutable snapshots of all ended spans.

func (*Harness) TracerProvider

func (h *Harness) TracerProvider() traceapi.TracerProvider

TracerProvider returns a standard OpenTelemetry tracer provider.

Jump to

Keyboard shortcuts

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