trace

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	Name        string  `json:",optional"`
	Endpoint    string  `json:",optional"`
	SamplerMode string  `json:",optional,default=never,options=ratio|always|never"`
	Sampler     float64 `json:",default=1.0"`
	Batcher     string  `json:",default=jaeger,options=zipkin|jaeger|prometheus|otelgrpc|otelhttp|file"`
	// contains filtered or unexported fields
}

func NewAgent

func NewAgent(name string, endpoint string, samplerMode string, sampler float64, batcher string, o ...TelemetryOptions) *Agent

func (*Agent) ErrorHandler added in v0.2.1

func (agent *Agent) ErrorHandler() otel.ErrorHandler

func (*Agent) Propagator added in v0.2.1

func (agent *Agent) Propagator() propagation.TextMapPropagator

func (*Agent) Shutdown added in v0.2.1

func (agent *Agent) Shutdown(ctx context.Context) error

func (*Agent) TracerProvider added in v0.2.1

func (agent *Agent) TracerProvider() *sdkTrace.TracerProvider

type TelemetryOptions

type TelemetryOptions func(*telemetryOptions)

func WithCollectorOptions

func WithCollectorOptions(opts ...otlptracehttp.Option) TelemetryOptions

func WithOtelGrpcOptions

func WithOtelGrpcOptions(opts ...otlptracegrpc.Option) TelemetryOptions

func WithOtelHttpOptions

func WithOtelHttpOptions(opts ...otlptracehttp.Option) TelemetryOptions

func WithTracerProviderOptions

func WithTracerProviderOptions(opts ...sdkTrace.TracerProviderOption) TelemetryOptions

func WithZipkinOptions

func WithZipkinOptions(opts ...zipkin.Option) TelemetryOptions

type Tracer added in v0.2.1

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

func NewTracer added in v0.2.1

func NewTracer(kind trace.SpanKind, opts ...TracerOptions) *Tracer

func (*Tracer) End added in v0.2.1

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

func (*Tracer) Start added in v0.2.1

func (t *Tracer) Start(ctx context.Context, spanName string, propagator propagation.TextMapPropagator, carrier propagation.TextMapCarrier) (context.Context, trace.Span)

type TracerOptions added in v0.2.1

type TracerOptions func(*tracerOptions)

func WithTracerAttributes added in v0.2.1

func WithTracerAttributes(attrs ...attribute.KeyValue) TracerOptions

func WithTracerName added in v0.2.1

func WithTracerName(name string) TracerOptions

func WithTracerProvider added in v0.2.1

func WithTracerProvider(tp *sdkTrace.TracerProvider) TracerOptions

func WithTracerResource added in v0.2.1

func WithTracerResource(res *resource.Resource) TracerOptions

Directories

Path Synopsis
jaeger
this is a modified version of jaeger exporter in https://github.com/zeromicro/go-zero/blob/master/core/trace/agent.go
this is a modified version of jaeger exporter in https://github.com/zeromicro/go-zero/blob/master/core/trace/agent.go

Jump to

Keyboard shortcuts

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