lib

package
v1.0.1001 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: MIT Imports: 29 Imported by: 1

Documentation

Index

Constants

View Source
const MaxSpanSize = 1000 * 50

Variables

This section is empty.

Functions

func ConvertTraceIDToDatadogFormat

func ConvertTraceIDToDatadogFormat(id string) string

func GetContentType

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

func GetID

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

func NewLib

func NewLib() interfaces.Tracing

func NewOpenTelemetryOperation

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

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

func NewDatadog

func NewDatadog(option interfaces.Option) *Datadog

func (*Datadog) Closing

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

func (*Datadog) GetFormattedTraceID

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

func (*Datadog) InjectRootData

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

func (*Datadog) Log

func (c *Datadog) Log(msg string)

Log - implement datadog logger interface

func (*Datadog) Operation

func (*Datadog) SetDefaultLogs

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

func (*Datadog) Setup

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

type HttpRequestInterceptor

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

HttpRequestInterceptor for logging jaeger request

func (HttpRequestInterceptor) RoundTrip

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

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

func (*Jaeger) GetFormattedTraceID

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

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

func (*Modules) GetFormattedTraceID

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

func (*Modules) GrpcOperation

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

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

func (*OpenTelemetryOperation) Error

func (c *OpenTelemetryOperation) Error(err error)

func (*OpenTelemetryOperation) Fatal

func (c *OpenTelemetryOperation) Fatal()

func (*OpenTelemetryOperation) Finish

func (c *OpenTelemetryOperation) Finish()

func (*OpenTelemetryOperation) IncomingContext

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

func (*OpenTelemetryOperation) OutgoingContext

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

func (*OpenTelemetryOperation) Save

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

func (*OpenTelemetryOperation) SetDefaultLogs

func (c *OpenTelemetryOperation) SetDefaultLogs(skip int)

func (*OpenTelemetryOperation) SetLog

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

func (*OpenTelemetryOperation) SetTagBool

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

func (*OpenTelemetryOperation) SetTagInt

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

func (*OpenTelemetryOperation) SetTagString

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

func (*OpenTelemetryOperation) StatusOK

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

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

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

func (*Operation) SetTagInt

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

func (*Operation) SetTagString

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

func (*Operation) StatusOK

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

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

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