Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicSpanName ¶
BasicSpanName is common notation of <class>.<method> or <pkg>.<func>
Types ¶
type Instrumenter ¶
type Instrumenter interface {
Imports() []*types.Package
PrefixStatements(spanName string, contextName string, hasError bool, errName string) []ast.Stmt
}
Instrumenter supplies ast of Go code that will be inserted and required dependencies.
type Processor ¶
type Processor struct {
Instrumenter Instrumenter
PreserveLineNumbers bool // if true, use compile directives to preserve line numbers as if no instrumentation was applied
SpanName func(receiver, function string) string
ContextPackage, ContextType string // context is detected automatically based on matching package and symbol name
ErrorType string // error is detected by error type
}
Processor traverses AST, collects details on functions and methods, and invokes Instrumenter
Click to show internal directories.
Click to hide internal directories.