Documentation
¶
Index ¶
- Constants
- func Emit(meta *infra.Meta, name string, status string, attrs ...Map)
- func ResolveFields(raw Any, defaults map[string]string) map[string]string
- func SpanValues(span Span, instance, flag string) map[string]Any
- func Stats() Map
- func Write(span Span)
- type Config
- type Configs
- type Connection
- type Driver
- type Handle
- type Instance
- type Module
- func (m *Module) Begin(meta *infra.Meta, name string, attrs Map) infra.TraceSpan
- func (m *Module) Close()
- func (m *Module) Config(global Map)
- func (m *Module) Open()
- func (m *Module) Register(name string, value Any)
- func (m *Module) RegisterConfig(name string, cfg Config)
- func (m *Module) RegisterConfigs(configs Configs)
- func (m *Module) RegisterDriver(name string, driver Driver)
- func (m *Module) Setup()
- func (m *Module) Start()
- func (m *Module) Stats() Map
- func (m *Module) Stop()
- func (m *Module) Trace(meta *infra.Meta, name string, status string, attrs Map) error
- func (m *Module) Write(span Span)
- type Span
Constants ¶
View Source
const ( StatusOK = "ok" StatusFail = "fail" StatusError = "error" )
View Source
const NAME = "TRACE"
Variables ¶
This section is empty.
Functions ¶
func ResolveFields ¶
ResolveFields parses fields config into source->target mapping. Supports:
- []string / []any: ["trace_id","span_id"]
- map[string]any: { trace_id = "tid", span_id = "sid" }
func SpanValues ¶
SpanValues returns all known trace fields (standard + compat aliases).
Types ¶
type Connection ¶
type Driver ¶
type Driver interface {
Connect(*Instance) (Connection, error)
}
type Instance ¶
type Instance struct {
Name string
Config Config
Setting map[string]any
// contains filtered or unexported fields
}
func (*Instance) AllowWithFactor ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) RegisterConfig ¶
func (*Module) RegisterConfigs ¶
func (*Module) RegisterDriver ¶
type Span ¶
type Span struct {
Time time.Time `json:"time"`
TraceId string `json:"trace_id,omitempty"`
SpanId string `json:"span_id,omitempty"`
ParentSpanId string `json:"parent_span_id,omitempty"`
Name string `json:"name,omitempty"`
Kind string `json:"kind,omitempty"`
ServiceName string `json:"service_name,omitempty"`
Target string `json:"target,omitempty"`
Status string `json:"status,omitempty"`
Code int `json:"code"`
Result string `json:"result,omitempty"`
Duration int64 `json:"duration"`
Start int64 `json:"start"`
End int64 `json:"end"`
Attributes Map `json:"attributes,omitempty"`
Resource Map `json:"resource,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.