rkasynq

package module
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndSpan added in v0.0.2

func EndSpan(span oteltrace.Span, success bool)

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 GetSpan

func GetSpan(ctx context.Context) oteltrace.Span

func GetTraceId

func GetTraceId(ctx context.Context) string

func GetTracer added in v0.0.2

func GetTracer(ctx context.Context) oteltrace.Tracer

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

func NewSpan added in v0.0.2

func NewSpan(ctx context.Context, name string) (context.Context, oteltrace.Span)

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.

func (*NoopExporter) Shutdown added in v0.0.4

func (nsb *NoopExporter) Shutdown(context.Context) error

Shutdown stops the exporter by doing nothing.

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

Jump to

Keyboard shortcuts

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