lib

package
v1.0.100 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: MIT Imports: 29 Imported by: 4

Documentation

Index

Constants

View Source
const MaxSpanSize = 1000 * 50

Variables

This section is empty.

Functions

func ConvertTraceIDToDatadogFormat added in v1.0.0

func ConvertTraceIDToDatadogFormat(id string) string

func GetContentType added in v1.0.0

func GetContentType(ctx context.Context, request *http.Request) (contentType string)

func GetID added in v1.0.0

func GetID(ctx context.Context) (id string, haveParent bool)

func NewLib

func NewLib() interfaces.Tracing

func NewOpenTelemetryOperation added in v1.0.0

func NewOpenTelemetryOperation(env, serviceName string, ctx context.Context, option interfaces.Option, storage *Storages, pbr propagation.TextMapPropagator, tracer trace.Tracer, opts ...interfaces.InteractionOption) interfaces.Interaction

Types

type Datadog added in v1.0.0

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

func NewDatadog added in v1.0.0

func NewDatadog(option interfaces.Option) *Datadog

func (*Datadog) Closing added in v1.0.0

func (c *Datadog) Closing() (err error)

func (*Datadog) GetFormattedTraceID added in v1.0.0

func (c *Datadog) GetFormattedTraceID(ctx context.Context) (id string)

func (*Datadog) InjectRootData added in v1.0.0

func (c *Datadog) InjectRootData(ctx context.Context, key string, data interface{},
	opts ...interfaces.InteractionOption)

func (*Datadog) Log added in v1.0.0

func (c *Datadog) Log(msg string)

Log - implement datadog logger interface

func (*Datadog) Operation added in v1.0.0

func (*Datadog) SetDefaultLogs added in v1.0.0

func (c *Datadog) SetDefaultLogs(span *OpenTelemetryOperation, skip int)

func (*Datadog) Setup added in v1.0.0

func (c *Datadog) Setup() (err error)

type HttpRequestInterceptor added in v1.0.0

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

HttpRequestInterceptor for logging jaeger request

func NewHttpRequestInterceptor added in v1.0.0

func NewHttpRequestInterceptor(log loggerInterfaces.Logger, core http.RoundTripper) HttpRequestInterceptor

func (HttpRequestInterceptor) RoundTrip added in v1.0.0

func (c HttpRequestInterceptor) RoundTrip(r *http.Request) (*http.Response, error)

type Jaeger

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

func NewJaeger

func NewJaeger(option interfaces.Option) *Jaeger

func (*Jaeger) Closing added in v1.0.0

func (c *Jaeger) Closing() (err error)

func (*Jaeger) GetFormattedTraceID added in v1.0.0

func (c *Jaeger) GetFormattedTraceID(ctx context.Context) (id string)

func (*Jaeger) InjectRootData

func (c *Jaeger) InjectRootData(ctx context.Context, key string, data interface{},
	opts ...interfaces.InteractionOption)

func (*Jaeger) Operation

func (*Jaeger) Setup

func (c *Jaeger) Setup() (err error)

type Modules

type Modules struct {
	Option interfaces.Option
	// contains filtered or unexported fields
}

func (*Modules) Closing

func (c *Modules) Closing() (err error)

func (*Modules) GetConfig added in v1.0.0

func (c *Modules) GetConfig() interfaces.Option

func (*Modules) GetFormattedTraceID added in v1.0.0

func (c *Modules) GetFormattedTraceID(ctx context.Context) (id string)

func (*Modules) GrpcOperation added in v0.0.5

func (c *Modules) GrpcOperation(ctx context.Context, m map[string]string, opts ...interfaces.InteractionOption) interfaces.Interaction

func (*Modules) Init

func (c *Modules) Init(option interfaces.Option)

func (*Modules) InjectRootData

func (c *Modules) InjectRootData(ctx context.Context, key string, data interface{},
	opts ...interfaces.InteractionOption)

func (*Modules) New

func (c *Modules) New() interfaces.Tracing

func (*Modules) Operation

type OpenTelemetryOperation added in v1.0.0

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

func (*OpenTelemetryOperation) Error added in v1.0.0

func (c *OpenTelemetryOperation) Error(err error)

func (*OpenTelemetryOperation) Fatal added in v1.0.0

func (c *OpenTelemetryOperation) Fatal()

func (*OpenTelemetryOperation) Finish added in v1.0.0

func (c *OpenTelemetryOperation) Finish()

func (*OpenTelemetryOperation) IncomingContext added in v1.0.0

func (c *OpenTelemetryOperation) IncomingContext() context.Context

func (*OpenTelemetryOperation) OutgoingContext added in v1.0.0

func (c *OpenTelemetryOperation) OutgoingContext() context.Context

func (*OpenTelemetryOperation) Save added in v1.0.0

func (c *OpenTelemetryOperation) Save(request *http.Request)

func (*OpenTelemetryOperation) SetDefaultLogs added in v1.0.0

func (c *OpenTelemetryOperation) SetDefaultLogs(skip int)

func (*OpenTelemetryOperation) SetLog added in v1.0.0

func (c *OpenTelemetryOperation) SetLog(key string, val interface{})

func (*OpenTelemetryOperation) SetTagBool added in v1.0.0

func (c *OpenTelemetryOperation) SetTagBool(key string, value bool)

func (*OpenTelemetryOperation) SetTagInt added in v1.0.0

func (c *OpenTelemetryOperation) SetTagInt(key string, value int)

func (*OpenTelemetryOperation) SetTagString added in v1.0.0

func (c *OpenTelemetryOperation) SetTagString(key, value string)

func (*OpenTelemetryOperation) StatusOK added in v1.0.0

func (c *OpenTelemetryOperation) StatusOK(des string)

type Operation

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

Operation - default operation is empty

func (*Operation) Error

func (c *Operation) Error(err error)

func (*Operation) Fatal added in v1.0.0

func (c *Operation) Fatal()

func (*Operation) Finish

func (c *Operation) Finish()

func (*Operation) IncomingContext

func (c *Operation) IncomingContext() context.Context

func (*Operation) OutgoingContext

func (c *Operation) OutgoingContext() context.Context

func (*Operation) SetLog

func (c *Operation) SetLog(name string, data interface{})

func (*Operation) SetTagBool added in v1.0.0

func (c *Operation) SetTagBool(key string, value bool)

func (*Operation) SetTagInt added in v1.0.0

func (c *Operation) SetTagInt(key string, value int)

func (*Operation) SetTagString added in v1.0.0

func (c *Operation) SetTagString(key, value string)

func (*Operation) StatusOK added in v1.0.0

func (c *Operation) StatusOK(data string)

type Storages

type Storages struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewStorages

func NewStorages() *Storages

func (*Storages) Count added in v0.0.7

func (c *Storages) Count() int

func (*Storages) Delete

func (c *Storages) Delete(id string)

func (*Storages) Load

func (c *Storages) Load(id string) (it interface{}, ok bool)

func (*Storages) LoadAll added in v0.0.7

func (c *Storages) LoadAll() (res []interface{})

func (*Storages) Store

func (c *Storages) Store(id string, it interface{})

Jump to

Keyboard shortcuts

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