mod_trace

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

README

Documentation

Index

Constants

View Source
const (
	ModTrace = "mod_trace"
	CtxSpan  = "mod_trace.span"
)

Variables

This section is empty.

Functions

func InjectRequestHeader

func InjectRequestHeader(span opentracing.Span, r *bfe_http.Request)

InjectRequestHeaders used to inject opentracing headers into the request.

func StartSpan

func StartSpan(r *bfe_http.Request) opentracing.Span

StartSpan starts a new span

func TraceRuleCheck

func TraceRuleCheck(traceRuleFile *TraceRuleFile) error

Types

type ConfModTrace

type ConfModTrace struct {
	Basic struct {
		DataPath    string // The path of rule data
		ServiceName string // The name of this service
		TraceAgent  string // The type of trace agent: zipkin, jaeger or elastic
	}

	Log struct {
		OpenDebug bool
	}

	Zipkin  zipkin.Config  // Settings for zipkin, only useful when TraceAgent is zipkin
	Jaeger  jaeger.Config  // Settings for jaeger, only useful when TraceAgent is jaeger
	Elastic elastic.Config // Settings for elastic, only useful when TraceAgent is elastic
}

func ConfLoad

func ConfLoad(filePath string, confRoot string) (*ConfModTrace, error)

func (*ConfModTrace) Check

func (cfg *ConfModTrace) Check(confRoot string) error

func (*ConfModTrace) GetTraceConfig

func (cfg *ConfModTrace) GetTraceConfig() trace.TraceAgent

type ModuleTrace

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

func NewModuleTrace

func NewModuleTrace() *ModuleTrace

func (*ModuleTrace) Init

func (*ModuleTrace) Name

func (m *ModuleTrace) Name() string

type ModuleTraceState

type ModuleTraceState struct {
	StartSpanCount  *metrics.Counter
	FinishSpanCount *metrics.Counter
}

type ProductRuleList

type ProductRuleList map[string]TraceRuleList // product => list of trace rule list

type ProductRuleRawList

type ProductRuleRawList map[string]RuleRawList // product => raw rule list

type RuleRawList

type RuleRawList []TraceRuleRaw

type TraceRule

type TraceRule struct {
	Cond   condition.Condition
	Enable bool
}

type TraceRuleConf

type TraceRuleConf struct {
	Version string          // version
	Config  ProductRuleList // product -> rule list
}

func TraceRuleFileLoad

func TraceRuleFileLoad(filename string) (*TraceRuleConf, error)

type TraceRuleFile

type TraceRuleFile struct {
	Version string             // version
	Config  ProductRuleRawList // product -> raw rule list
}

type TraceRuleList

type TraceRuleList []TraceRule

type TraceRuleRaw

type TraceRuleRaw struct {
	Cond   string // condition
	Enable bool   // enable trace
}

type TraceRuleTable

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

func NewTraceRuleTable

func NewTraceRuleTable() *TraceRuleTable

func (*TraceRuleTable) Search

func (t *TraceRuleTable) Search(product string) (TraceRuleList, bool)

func (*TraceRuleTable) Update

func (t *TraceRuleTable) Update(ruleConf *TraceRuleConf)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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