otel

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package otel supports OpenTelemetry tracing and metrics for the Go Cloud Development Kit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesMeasure added in v0.43.0

func BytesMeasure(pkg string, provider string, meterName string, description string) metric.Int64Counter

BytesMeasure creates a counter for bytes measurements.

func CounterView added in v0.43.0

func CounterView(pkg string, meterName string, description string) []sdkmetric.View

CounterView returns summation views that add up individual measurements the counter takes.

func DimensionlessMeasure added in v0.43.0

func DimensionlessMeasure(pkg string, provider string, meterName string, description string) metric.Int64Counter

DimensionlessMeasure creates a simple counter specifically for dimensionless measurements.

func LatencyMeasure added in v0.43.0

func LatencyMeasure(pkg string, provider string) metric.Float64Histogram

LatencyMeasure returns the measure for method call latency used by Go CDK APIs.

func ProviderName

func ProviderName(driver any) string

ProviderName returns the name of the provider associated with the driver value. It is intended to be used as the provider argument to NewTracer. It actually returns the package path of the driver's type.

func Views added in v0.43.0

func Views(pkg string) []sdkmetric.View

Types

type Tracer

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

Tracer provides OpenTelemetry tracing for Go CDK packages.

func NewTracer

func NewTracer(pkg string, provider string) *Tracer

NewTracer creates a new Tracer for a package and provider.

func (*Tracer) End

func (t *Tracer) End(ctx context.Context, span trace.Span, err error)

End completes a span with error information if applicable.

func (*Tracer) Start

func (t *Tracer) Start(ctx context.Context, methodName string) (context.Context, trace.Span)

Start creates and starts a new span and returns the updated context and span.

Jump to

Keyboard shortcuts

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