tracing

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package tracing provides OpenTelemetry tracing for the unikernel engine daemon.

Index

Constants

View Source
const (
	VMLifecycleSpanName = "vm.lifecycle"
	VMCreateSpanName    = "vm.create"
	VMStartSpanName     = "vm.start"
	VMStopSpanName      = "vm.stop"
	VMKillSpanName      = "vm.kill"
	VMSignalSpanName    = "vm.signal"
	VMRemoveSpanName    = "vm.remove"
	VMMonitorSpanName   = "vm.monitor"
)

Variables

This section is empty.

Functions

func RecordError

func RecordError(span trace.Span, err error)

RecordError records an error on the span and sets its status to Error.

func SpanWithDuration

func SpanWithDuration(span trace.Span, d time.Duration)

SpanWithDuration adds a duration attribute to a span.

func SpanWithRetryAttrs

func SpanWithRetryAttrs(span trace.Span, policy vm.RestartPolicy, count int)

SpanWithRetryAttrs adds retry-related attributes to a span.

func StartVMCreateSpan

func StartVMCreateSpan(ctx context.Context, cfg vm.Config) (trace.Span, context.Context)

StartVMCreateSpan creates a span for a VM creation.

func StartVMKillSpan

func StartVMKillSpan(ctx context.Context, id string) (trace.Span, context.Context)

StartVMKillSpan creates a span for killing a VM.

func StartVMLifecycleSpan

func StartVMLifecycleSpan(ctx context.Context, v *vm.VM, event string) (trace.Span, context.Context)

StartVMLifecycleSpan creates a span for a VM lifecycle event.

func StartVMRemoveSpan

func StartVMRemoveSpan(ctx context.Context, id string) (trace.Span, context.Context)

StartVMRemoveSpan creates a span for removing a VM.

func StartVMStartSpan

func StartVMStartSpan(ctx context.Context, id string) (trace.Span, context.Context)

StartVMStartSpan creates a span for starting a VM.

func StartVMStopSpan

func StartVMStopSpan(ctx context.Context, id string) (trace.Span, context.Context)

StartVMStopSpan creates a span for stopping a VM.

func Tracer

func Tracer() trace.Tracer

Tracer returns the global tracer for the unikernel engine.

Types

type Provider

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

Provider wraps an OpenTelemetry TracerProvider with shutdown capability.

func NewProvider

func NewProvider(ctx context.Context, addr string, version string) (*Provider, error)

NewProvider creates an OTLP gRPC TracerProvider that exports to addr. If addr is empty, a no-op provider is returned.

func (*Provider) Shutdown

func (p *Provider) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the tracer provider, flushing any pending spans.

Jump to

Keyboard shortcuts

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