Documentation ¶
Index ¶
- func AWS(config cfg.Config, c *client.Client)
- func AddProvider(name string, provider Provider)
- func ContextTraceFieldsResolver(ctx context.Context) map[string]interface{}
- func ContextWithSpan(ctx context.Context, span Span) context.Context
- func ContextWithTrace(ctx context.Context, trace *Trace) context.Context
- func NewAwsTracerWithInterfaces(logger log.Logger, appId cfg.AppId, settings *XRaySettings) (*awsTracer, error)
- func TraceToString(trace *Trace) string
- type ContextMissingWarnSamplingConfig
- type ContextMissingWarnStrategy
- type LoggerErrorHandler
- type MessageWithTraceEncoder
- func (m MessageWithTraceEncoder) Decode(ctx context.Context, _ interface{}, attributes map[string]interface{}) (context.Context, map[string]interface{}, error)
- func (m MessageWithTraceEncoder) Encode(ctx context.Context, _ interface{}, attributes map[string]interface{}) (context.Context, map[string]interface{}, error)
- type Provider
- type SampleRule
- type SamplingConfiguration
- type Span
- type Trace
- type TraceAble
- type TraceIdErrorReturnStrategy
- type TraceIdErrorStrategy
- type TraceIdErrorWarningStrategy
- type Tracer
- type TracerSettings
- type XRaySettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddProvider ¶
func TraceToString ¶
Types ¶
type ContextMissingWarnStrategy ¶
type ContextMissingWarnStrategy struct {
// contains filtered or unexported fields
}
func NewContextMissingWarningLogStrategy ¶
func NewContextMissingWarningLogStrategy(logger log.Logger) *ContextMissingWarnStrategy
func (ContextMissingWarnStrategy) ContextMissing ¶
func (c ContextMissingWarnStrategy) ContextMissing(v interface{})
type LoggerErrorHandler ¶
type LoggerErrorHandler struct{}
func NewLoggerErrorHandler ¶
func NewLoggerErrorHandler() *LoggerErrorHandler
func (*LoggerErrorHandler) Channels ¶
func (h *LoggerErrorHandler) Channels() []string
func (*LoggerErrorHandler) Level ¶
func (h *LoggerErrorHandler) Level() int
type MessageWithTraceEncoder ¶
type MessageWithTraceEncoder struct {
// contains filtered or unexported fields
}
func NewMessageWithTraceEncoder ¶
func NewMessageWithTraceEncoder(strategy TraceIdErrorStrategy) *MessageWithTraceEncoder
type SampleRule ¶
type SampleRule struct { Description string `json:"description" cfg:"description" default:"default"` ServiceName string `json:"service_name" cfg:"service_name"` HttpMethod string `json:"http_method" cfg:"http_method"` UrlPath string `json:"url_path" cfg:"url_path"` FixedTarget uint64 `json:"fixed_target" cfg:"fixed_target" default:"1"` Rate float64 `json:"rate" cfg:"rate" default:"0.05"` }
type SamplingConfiguration ¶
type SamplingConfiguration struct { Version int `json:"version" cfg:"version" default:"1"` Default SampleRule `json:"default" cfg:"default"` Rules []SampleRule `json:"rules" cfg:"rules"` }
type Span ¶
type Span interface { AddAnnotation(key string, value string) AddError(err error) AddMetadata(key string, value interface{}) Finish() GetId() string GetTrace() *Trace }
func GetSpanFromContext ¶
type Trace ¶
type Trace struct { TraceId string `json:"traceId"` Id string `json:"id"` ParentId string `json:"parentId"` Sampled bool `json:"sampled"` }
func GetTraceFromContext ¶
func StringToTrace ¶
func (*Trace) GetParentId ¶
func (*Trace) GetSampled ¶
func (*Trace) GetTraceId ¶
type TraceIdErrorReturnStrategy ¶
type TraceIdErrorReturnStrategy struct{}
func (TraceIdErrorReturnStrategy) TraceIdInvalid ¶
func (t TraceIdErrorReturnStrategy) TraceIdInvalid(err error) error
type TraceIdErrorStrategy ¶
type TraceIdErrorWarningStrategy ¶
type TraceIdErrorWarningStrategy struct {
// contains filtered or unexported fields
}
func NewTraceIdErrorWarningStrategy ¶
func NewTraceIdErrorWarningStrategy(logger log.Logger) *TraceIdErrorWarningStrategy
func NewTraceIdErrorWarningStrategyWithInterfaces ¶
func NewTraceIdErrorWarningStrategyWithInterfaces(logger log.Logger, stacktraceProvider log.StackTraceProvider) *TraceIdErrorWarningStrategy
func (TraceIdErrorWarningStrategy) TraceIdInvalid ¶
func (t TraceIdErrorWarningStrategy) TraceIdInvalid(err error) error
type Tracer ¶
type Tracer interface { HttpHandler(h http.Handler) http.Handler StartSpan(name string) (context.Context, Span) StartSpanFromContext(ctx context.Context, name string) (context.Context, Span) StartSubSpan(ctx context.Context, name string) (context.Context, Span) }
func NewNoopTracer ¶
func NewNoopTracer() Tracer
type TracerSettings ¶
type TracerSettings struct { Provider string `cfg:"provider" default:"xray" validate:"required"` Enabled bool `cfg:"enabled" default:"false"` AddressType string `cfg:"addr_type" default:"local" validate:"required"` AddressValue string `cfg:"add_value" default:""` Sampling SamplingConfiguration `cfg:"sampling"` StreamingMaxSubsegmentCount int `cfg:"streaming_max_subsegment_count" default:"20"` }
type XRaySettings ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.