Documentation ¶
Index ¶
- func EndSpan(span oteltrace.Span, success bool)
- func GetPropagator(ctx context.Context) propagation.TextMapPropagator
- func GetProvider(ctx context.Context) *sdktrace.TracerProvider
- func GetSpan(ctx context.Context) oteltrace.Span
- func GetTraceId(ctx context.Context) string
- func GetTracer(ctx context.Context) oteltrace.Tracer
- func NewFileExporter(outputPath string, opts ...stdouttrace.Option) sdktrace.SpanExporter
- func NewJaegerExporter(opt jaeger.EndpointOption) sdktrace.SpanExporter
- func NewJaegerMid(traceRaw []byte) (asynq.MiddlewareFunc, error)
- func NewNoopExporter() sdktrace.SpanExporter
- func NewSpan(ctx context.Context, name string) (context.Context, oteltrace.Span)
- type NoopExporter
- type Option
- type TraceConfig
- type TraceMiddleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPropagator ¶ added in v0.0.2
func GetPropagator(ctx context.Context) propagation.TextMapPropagator
func GetProvider ¶ added in v0.0.2
func GetProvider(ctx context.Context) *sdktrace.TracerProvider
func GetTraceId ¶
func NewFileExporter ¶ added in v0.0.4
func NewFileExporter(outputPath string, opts ...stdouttrace.Option) sdktrace.SpanExporter
NewFileExporter create a file exporter whose default output is stdout.
func NewJaegerExporter ¶ added in v0.0.4
func NewJaegerExporter(opt jaeger.EndpointOption) sdktrace.SpanExporter
NewJaegerExporter Create jaeger exporter with bellow condition.
1: If no option provided, then export to jaeger agent at localhost:6831 2: Jaeger agent
If no jaeger agent host was provided, then use localhost If no jaeger agent port was provided, then use 6831
3: Jaeger collector
If no jaeger collector endpoint was provided, then use http://localhost:14268/api/traces
func NewJaegerMid ¶
func NewJaegerMid(traceRaw []byte) (asynq.MiddlewareFunc, error)
func NewNoopExporter ¶ added in v0.0.4
func NewNoopExporter() sdktrace.SpanExporter
NewNoopExporter create a noop exporter
Types ¶
type NoopExporter ¶ added in v0.0.4
type NoopExporter struct{}
NoopExporter noop
func (*NoopExporter) ExportSpans ¶ added in v0.0.4
func (nsb *NoopExporter) ExportSpans(context.Context, []sdktrace.ReadOnlySpan) error
ExportSpans handles export of SpanSnapshots by dropping them.
type Option ¶ added in v0.0.4
type Option func(*TraceMiddleware)
Option is used while creating middleware as param
func ToOptions ¶ added in v0.0.4
func ToOptions(config *TraceConfig) []Option
ToOptions convert BootConfig into Option list
func WithExporter ¶ added in v0.0.4
func WithExporter(exporter sdktrace.SpanExporter) Option
WithExporter Provide sdktrace.SpanExporter.
type TraceConfig ¶
type TraceConfig struct { Asynq struct { Trace struct { Enabled bool `yaml:"enabled" json:"enabled"` ServiceName string `yaml:"serviceName"` ServiceVersion string `yaml:"serviceVersion"` Exporter struct { File struct { Enabled bool `yaml:"enabled" json:"enabled"` OutputPath string `yaml:"outputPath" json:"outputPath"` } `yaml:"file" json:"file"` Jaeger struct { Agent struct { Enabled bool `yaml:"enabled" json:"enabled"` Host string `yaml:"host" json:"host"` Port int `yaml:"port" json:"port"` } `yaml:"agent" json:"agent"` Collector struct { Enabled bool `yaml:"enabled" json:"enabled"` Endpoint string `yaml:"endpoint" json:"endpoint"` Username string `yaml:"username" json:"username"` Password string `yaml:"password" json:"password"` } `yaml:"collector" json:"collector"` } `yaml:"jaeger" json:"jaeger"` } `yaml:"exporter" json:"exporter"` } `yaml:"trace"` } `yaml:"asynq"` }
type TraceMiddleware ¶
type TraceMiddleware struct {
// contains filtered or unexported fields
}
func (*TraceMiddleware) Middleware ¶
func (m *TraceMiddleware) Middleware(h asynq.Handler) asynq.Handler
Click to show internal directories.
Click to hide internal directories.