telemetry

package
v1.70.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: Apache-2.0 Imports: 26 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AttrMethodKey  = attribute.Key("frame_method")
	AttrPackageKey = attribute.Key("frame_package")
	AttrStatusKey  = attribute.Key("frame_status")
	AttrErrorKey   = attribute.Key("frame_error")
)

Common attribute keys used across the frame.

Functions

func BytesMeasure

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

BytesMeasure creates a counter for bytes measurements.

func CounterView

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

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

func DimensionlessMeasure

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

DimensionlessMeasure creates a simple counter specifically for dimensionless measurements.

func ErrorCode added in v1.59.3

func ErrorCode(err error) string

func LatencyMeasure

func LatencyMeasure(pkg string) metric.Float64Histogram

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

func Views

func Views(pkg string) []sdkmetric.View

Types

type Manager added in v1.63.0

type Manager interface {
	Init(ctx context.Context) error
	Disabled() bool
	LogHandler() slog.Handler
}

func NewManager added in v1.63.0

func NewManager(ctx context.Context, cfg config.ConfigurationTelemetry, opts ...Option) Manager

NewManager creates a new telemetry setup manager.

type Option added in v1.63.0

type Option func(ctx context.Context, m *manager)

func WithDisableTracing added in v1.63.0

func WithDisableTracing() Option

WithDisableTracing disable tracing for the service.

func WithMetricsReader added in v1.63.0

func WithMetricsReader(reader sdkmetrics.Reader) Option

WithMetricsReader specifies the metrics reader for the service.

func WithPropagationTextMap added in v1.63.0

func WithPropagationTextMap(carrier propagation.TextMapPropagator) Option

WithPropagationTextMap specifies the trace baggage carrier exporter to use.

func WithServiceEnvironment added in v1.63.0

func WithServiceEnvironment(env string) Option

WithServiceEnvironment sets the service environment for resource tagging.

func WithServiceName added in v1.63.0

func WithServiceName(name string) Option

WithServiceName sets the service name for resource tagging.

func WithServiceVersion added in v1.63.0

func WithServiceVersion(version string) Option

WithServiceVersion sets the service version for resource tagging.

func WithTraceExporter added in v1.63.0

func WithTraceExporter(exporter sdktrace.SpanExporter) Option

WithTraceExporter specifies the trace exporter to use.

func WithTraceLogsExporter added in v1.63.0

func WithTraceLogsExporter(exporter sdklogs.Exporter) Option

WithTraceLogsExporter specifies the trace logs exporter for the service.

func WithTraceSampler added in v1.63.0

func WithTraceSampler(sampler sdktrace.Sampler) Option

WithTraceSampler specifies the trace sampler to use.

type Tracer

type Tracer interface {
	Start(ctx context.Context, methodName string, options ...trace.SpanStartOption) (context.Context, trace.Span)
	End(ctx context.Context, span trace.Span, err error, options ...trace.SpanEndOption)
}

func NewTracer

func NewTracer(name string, options ...trace.TracerOption) Tracer

NewTracer creates a new tracer for a package.

Jump to

Keyboard shortcuts

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