Documentation ¶
Overview ¶
Package provider
Package provider
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewJaegerProvider ¶
func NewJaegerProvider(serviceName, endpoint string, options ...Option) (*sdkTrace.TracerProvider, error)
NewJaegerProvider returns an OpenTelemetry TracerProvider configured to use the Jaeger exporter that will send spans to the provided url. The returned TracerProvider will also use a Resource configured with all the information about the application.
func NewTracerProvider ¶
func NewTracerProvider(ctx context.Context, client otlptrace.Client, serviceName string) (*sdkTrace.TracerProvider, error)
NewTracerProvider serviceName 服务名称,一般是apollo上面的服务名称,注意冲突 http:
client := otlptracehttp.NewClient(
otlptracehttp.WithEndpoint(endpoint), otlptracehttp.WithInsecure(), otlptracehttp.WithRetry(otlptracehttp.RetryConfig{ Enabled: true, InitialInterval: 1 * time.Second, MaxInterval: 1 * time.Second, MaxElapsedTime: 0, }))
grpc: client := otlptracegrpc.NewClient(
otlptracegrpc.WithEndpoint(endpoint), otlptracegrpc.WithInsecure(), otlptracegrpc.WithReconnectionPeriod(50*time.Millisecond), otlptracegrpc.WithRetry(otlptracegrpc.RetryConfig{ Enabled: true, InitialInterval: 1 * time.Second, MaxInterval: 1 * time.Second, MaxElapsedTime: 0, }))
Types ¶
type IDGenerator ¶
type IDGenerator struct{}
func NewIDGenerator ¶
func NewIDGenerator() *IDGenerator
Click to show internal directories.
Click to hide internal directories.