telemetry

package
v1.12.0 Latest Latest
Warning

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

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

Documentation

Overview

Package telemetry contains code that emits telemetry (logging, metrics, tracing).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithRPCInfo

func ContextWithRPCInfo(ctx context.Context, rpcInfo RPCInfo) context.Context

ContextWithRPCInfo will save the rpc method and service information in context.

func MustNewTracerProvider

func MustNewTracerProvider(opts ...TracerOption) *sdktrace.TracerProvider

func TraceError

func TraceError(span trace.Span, err error)

TraceError marks the span as having an error, except if the error is context.Canceled, in which case it does nothing.

Types

type RPCInfo

type RPCInfo struct {
	Method  string
	Service string
}

func RPCInfoFromContext

func RPCInfoFromContext(ctx context.Context) RPCInfo

RPCInfoFromContext returns method and service stored in context.

type TracerOption

type TracerOption func(d *customTracer)

func WithAttributes

func WithAttributes(attrs ...attribute.KeyValue) TracerOption

func WithOTLPEndpoint

func WithOTLPEndpoint(endpoint string) TracerOption

func WithOTLPInsecure

func WithOTLPInsecure() TracerOption

func WithSamplingRatio

func WithSamplingRatio(samplingRatio float64) TracerOption

Jump to

Keyboard shortcuts

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